]> git.sur5r.net Git - cc65/blob - src/ld65/make/gcc.mak
Added a tpool module that implements a global pool for generic types, so we
[cc65] / src / ld65 / make / gcc.mak
1 #
2 # gcc Makefile for ld65
3 #
4
5 # ------------------------------------------------------------------------------
6
7 # The executable to build
8 EXE     = ld65
9
10 # Library dir
11 COMMON  = ../common
12
13 # Several search paths. You may redefine these on the command line
14 LD65_LIB = \"/usr/lib/cc65/lib/\"
15 LD65_OBJ = \"/usr/lib/cc65/lib/\"
16 LD65_CFG = \"/usr/lib/cc65/cfg/\"
17
18 #
19 CC      = gcc
20 CFLAGS  = -g -O2 -Wall -W -std=c89
21 override CFLAGS += -I$(COMMON)
22 override CFLAGS += -DLD65_LIB=$(LD65_LIB) -DLD65_OBJ=$(LD65_OBJ) -DLD65_CFG=$(LD65_CFG)
23 EBIND   = emxbind
24 LDFLAGS =
25
26 # Perl script for config file conversion
27 CVT=cfg/cvt-cfg.pl
28
29 # -----------------------------------------------------------------------------
30 # List of all object files
31
32 OBJS =  asserts.o       \
33         bin.o           \
34         binfmt.o        \
35         cfgexpr.o       \
36         condes.o        \
37         config.o        \
38         dbgfile.o       \
39         dbgsyms.o       \
40         error.o         \
41         exports.o       \
42         expr.o          \
43         extsyms.o       \
44         fileinfo.o      \
45         fileio.o        \
46         filepath.o      \
47         fragment.o      \
48         global.o        \
49         library.o       \
50         lineinfo.o      \
51         main.o          \
52         mapfile.o       \
53         memarea.o       \
54         o65.o           \
55         objdata.o       \
56         objfile.o       \
57         scanner.o       \
58         scopes.o        \
59         segments.o      \
60         span.o          \
61         spool.o         \
62         tgtcfg.o        \
63         tpool.o
64
65 # -----------------------------------------------------------------------------
66 # List of all config includes
67
68 INCS =  apple2.inc      \
69         apple2enh.inc   \
70         atari.inc       \
71         atmos.inc       \
72         bbc.inc         \
73         c128.inc        \
74         c16.inc         \
75         c64.inc         \
76         cbm510.inc      \
77         cbm610.inc      \
78         geos.inc        \
79         lunix.inc       \
80         lynx.inc        \
81         module.inc      \
82         nes.inc         \
83         none.inc        \
84         pet.inc         \
85         plus4.inc       \
86         supervision.inc \
87         vic20.inc
88
89 LIBS = $(COMMON)/common.a
90
91
92 # ------------------------------------------------------------------------------
93 # Makefile targets
94
95 # Main target - must be first
96 .PHONY: all
97 ifeq (.depend,$(wildcard .depend))
98 all:    $(EXE)
99 include .depend
100 else
101 all:    depend
102         @$(MAKE) -f make/gcc.mak all
103 endif
104
105 $(EXE): $(INCS) $(OBJS) $(LIBS)
106         $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
107         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $(EXE) ; fi
108
109 inc:    $(INCS)
110
111 clean:
112         $(RM) *~ core.* *.map
113
114 zap:    clean
115         $(RM) *.o $(INCS) $(EXE) .depend
116
117 # ------------------------------------------------------------------------------
118 # Make the dependencies
119
120 .PHONY: depend dep
121 depend dep:     $(INCS) $(OBJS:.o=.c)
122         @echo "Creating dependency information"
123         $(CC) $(CFLAGS) -MM $(OBJS:.o=.c) > .depend
124
125 # -----------------------------------------------------------------------------
126 # Rules to make config includes
127
128 apple2.inc:     cfg/apple2.cfg
129         @$(CVT) $< $@ CfgApple2
130
131 apple2enh.inc:  cfg/apple2enh.cfg
132         @$(CVT) $< $@ CfgApple2Enh
133
134 atari.inc:      cfg/atari.cfg
135         @$(CVT) $< $@ CfgAtari
136
137 atmos.inc:      cfg/atmos.cfg
138         @$(CVT) $< $@ CfgAtmos
139
140 bbc.inc:        cfg/bbc.cfg
141         @$(CVT) $< $@ CfgBBC
142
143 c16.inc:        cfg/c16.cfg
144         @$(CVT) $< $@ CfgC16
145
146 c64.inc:        cfg/c64.cfg
147         @$(CVT) $< $@ CfgC64
148
149 c128.inc:       cfg/c128.cfg
150         @$(CVT) $< $@ CfgC128
151
152 cbm510.inc:     cfg/cbm510.cfg
153         @$(CVT) $< $@ CfgCBM510
154
155 cbm610.inc:     cfg/cbm610.cfg
156         @$(CVT) $< $@ CfgCBM610
157
158 geos.inc:       cfg/geos.cfg
159         @$(CVT) $< $@ CfgGeos
160
161 lunix.inc:      cfg/lunix.cfg
162         @$(CVT) $< $@ CfgLunix
163
164 lynx.inc:       cfg/lynx.cfg
165         @$(CVT) $< $@ CfgLynx
166
167 module.inc:     cfg/module.cfg
168         @$(CVT) $< $@ CfgModule
169
170 nes.inc:        cfg/nes.cfg
171         @$(CVT) $< $@ CfgNES
172
173 none.inc:       cfg/none.cfg
174         @$(CVT) $< $@ CfgNone
175
176 pet.inc:        cfg/pet.cfg
177         @$(CVT) $< $@ CfgPET
178
179 plus4.inc:      cfg/plus4.cfg
180         @$(CVT) $< $@ CfgPlus4
181
182 supervision.inc:        cfg/supervision.cfg
183         @$(CVT) $< $@ CfgSupervision
184
185 vic20.inc:      cfg/vic20.cfg
186         @$(CVT) $< $@ CfgVic20
187
188