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