]> git.sur5r.net Git - cc65/blob - src/ld65/make/gcc.mak
Removed unneeded include files.
[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-apple.inc  \
79         geos-cbm.inc    \
80         lunix.inc       \
81         lynx.inc        \
82         module.inc      \
83         nes.inc         \
84         none.inc        \
85         pet.inc         \
86         plus4.inc       \
87         supervision.inc \
88         vic20.inc
89
90 LIBS = $(COMMON)/common.a
91
92
93 # ------------------------------------------------------------------------------
94 # Makefile targets
95
96 # Main target - must be first
97 .PHONY: all
98 ifeq (.depend,$(wildcard .depend))
99 all:    $(EXE)
100 include .depend
101 else
102 all:    depend
103         @$(MAKE) -f make/gcc.mak all
104 endif
105
106 $(EXE): $(INCS) $(OBJS) $(LIBS)
107         $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
108         @if [ $(OS2_SHELL) ] ;  then $(EBIND) $(EXE) ; fi
109
110 inc:    $(INCS)
111
112 clean:
113         $(RM) *~ core.* *.map
114
115 zap:    clean
116         $(RM) *.o $(INCS) $(EXE) .depend
117
118 # ------------------------------------------------------------------------------
119 # Make the dependencies
120
121 .PHONY: depend dep
122 depend dep:     $(INCS) $(OBJS:.o=.c)
123         @echo "Creating dependency information"
124         $(CC) $(CFLAGS) -MM $(OBJS:.o=.c) > .depend
125
126 # -----------------------------------------------------------------------------
127 # Rules to make config includes
128
129 apple2.inc:     cfg/apple2.cfg
130         @$(CVT) $< $@ CfgApple2
131
132 apple2enh.inc:  cfg/apple2enh.cfg
133         @$(CVT) $< $@ CfgApple2Enh
134
135 atari.inc:      cfg/atari.cfg
136         @$(CVT) $< $@ CfgAtari
137
138 atmos.inc:      cfg/atmos.cfg
139         @$(CVT) $< $@ CfgAtmos
140
141 bbc.inc:        cfg/bbc.cfg
142         @$(CVT) $< $@ CfgBBC
143
144 c16.inc:        cfg/c16.cfg
145         @$(CVT) $< $@ CfgC16
146
147 c64.inc:        cfg/c64.cfg
148         @$(CVT) $< $@ CfgC64
149
150 c128.inc:       cfg/c128.cfg
151         @$(CVT) $< $@ CfgC128
152
153 cbm510.inc:     cfg/cbm510.cfg
154         @$(CVT) $< $@ CfgCBM510
155
156 cbm610.inc:     cfg/cbm610.cfg
157         @$(CVT) $< $@ CfgCBM610
158
159 geos-apple.inc: cfg/geos-apple.cfg
160         @$(CVT) $< $@ CfgGeosApple
161
162 geos-cbm.inc:   cfg/geos-cbm.cfg
163         @$(CVT) $< $@ CfgGeosCBM
164
165 lunix.inc:      cfg/lunix.cfg
166         @$(CVT) $< $@ CfgLunix
167
168 lynx.inc:       cfg/lynx.cfg
169         @$(CVT) $< $@ CfgLynx
170
171 module.inc:     cfg/module.cfg
172         @$(CVT) $< $@ CfgModule
173
174 nes.inc:        cfg/nes.cfg
175         @$(CVT) $< $@ CfgNES
176
177 none.inc:       cfg/none.cfg
178         @$(CVT) $< $@ CfgNone
179
180 pet.inc:        cfg/pet.cfg
181         @$(CVT) $< $@ CfgPET
182
183 plus4.inc:      cfg/plus4.cfg
184         @$(CVT) $< $@ CfgPlus4
185
186 supervision.inc:        cfg/supervision.cfg
187         @$(CVT) $< $@ CfgSupervision
188
189 vic20.inc:      cfg/vic20.cfg
190         @$(CVT) $< $@ CfgVic20
191
192