3 # Makefile for CC65 Libraries
6 .SUFFIXES: .o .obj .s .c
8 # Defines for executables. AR is used within this makefile, the others are
9 # passed to the submakes and contain paths relative to the subdirectories
10 # handled by the make subprocesses.
12 AS = ../../src/ca65/ca65
13 CC = ../../src/cc65/cc65
14 LD = ../../src/ld65/ld65
16 # List of shared directories
47 #-----------------------------------------------------------------------------
51 for tgt in $(ALLTARGETS); do \
52 $(MAKE) mostly-clean "$$tgt"lib || exit 1; \
55 #-----------------------------------------------------------------------------
60 for i in runtime apple2 common conio dbg em joystick mouse serial tgi zlib; do \
61 $(MAKE) SYS=apple2 -C $$i || exit 1; \
62 $(AR) a apple2.lib $$i/*.o || exit 1; \
64 cp apple2/apple2-auxmem.emd a2.auxmem.emd
65 cp apple2/apple2-stdjoy.joy a2.stdjoy.joy
66 cp apple2/apple2-stdmou.mou a2.stdmou.mou
67 cp apple2/apple2-ssc.ser a2.ssc.ser
68 cp apple2/apple2-280-192-8.tgi a2.hi.tgi
69 cp apple2/apple2-40-48-16.tgi a2.lo.tgi
70 if [ -d apple2/extra ]; then \
71 for i in apple2/extra/*.o; do \
72 cp $$i apple2-`basename $$i` || exit 1; \
76 #-----------------------------------------------------------------------------
81 for i in runtime apple2enh common conio dbg em joystick mouse serial tgi zlib; do \
82 $(MAKE) SYS=apple2enh -C $$i || exit 1; \
83 $(AR) a apple2enh.lib $$i/*.o || exit 1; \
85 cp apple2enh/apple2-auxmem.emd a2e.auxmem.emd
86 cp apple2enh/apple2-stdjoy.joy a2e.stdjoy.joy
87 cp apple2enh/apple2-stdmou.mou a2e.stdmou.mou
88 cp apple2enh/apple2-ssc.ser a2e.ssc.ser
89 cp apple2enh/apple2-280-192-8.tgi a2e.hi.tgi
90 cp apple2enh/apple2-40-48-16.tgi a2e.lo.tgi
91 if [ -d apple2enh/extra ]; then \
92 for i in apple2enh/extra/*.o; do \
93 cp $$i apple2enh-`basename $$i` || exit 1; \
97 #-----------------------------------------------------------------------------
102 for i in runtime atari common conio dbg em joystick tgi zlib; do \
103 $(MAKE) SYS=atari -C $$i || exit 1; \
104 $(AR) a atari.lib $$i/*.o || exit 1; \
106 cp atari/atari-stdjoy.joy ataristd.joy
107 cp atari/atari-multijoy.joy atarimj8.joy
108 cp atari/atari-10.tgi atari10.tgi
109 cp atari/atari-10p2.tgi atr10p2.tgi
110 cp atari/atari-11.tgi atari11.tgi
111 cp atari/atari-14.tgi atari14.tgi
112 cp atari/atari-15.tgi atari15.tgi
113 cp atari/atari-15p2.tgi atr15p2.tgi
114 cp atari/atari-3.tgi atari3.tgi
115 cp atari/atari-4.tgi atari4.tgi
116 cp atari/atari-5.tgi atari5.tgi
117 cp atari/atari-6.tgi atari6.tgi
118 cp atari/atari-7.tgi atari7.tgi
119 cp atari/atari-8.tgi atari8.tgi
120 cp atari/atari-8p2.tgi atr8p2.tgi
121 cp atari/atari-9.tgi atari9.tgi
122 cp atari/atari-9p2.tgi atr9p2.tgi
123 if [ -d atari/extra ]; then \
124 for i in atari/extra/*.o; do \
125 cp $$i atari-`basename $$i` || exit 1; \
129 #-----------------------------------------------------------------------------
134 for i in runtime atmos common conio em joystick tgi zlib; do \
135 $(MAKE) SYS=atmos -C $$i || exit 1; \
136 $(AR) a atmos.lib $$i/*.o || exit 1; \
140 if [ -d atmos/extra ]; then \
141 for i in atmos/extra/*.o; do \
142 cp $$i atmos-`basename $$i` || exit 1; \
146 #-----------------------------------------------------------------------------
151 for i in runtime c16 cbm common conio dbg em joystick mouse tgi zlib; do \
152 $(MAKE) SYS=c16 -C $$i || exit 1; \
153 $(AR) a c16.lib $$i/*.o || exit 1; \
157 if [ -d c16/extra ]; then \
158 for i in c16/extra/*.o; do \
159 cp $$i c16-`basename $$i` || exit 1; \
163 #-----------------------------------------------------------------------------
168 for i in runtime c64 cbm common conio dbg em joystick mouse serial tgi zlib; do \
169 $(MAKE) SYS=c64 -C $$i || exit 1; \
170 $(AR) a c64.lib $$i/*.o || exit 1; \
174 cp c64/c64-1351.mou .
175 cp c64/c64-joymouse.mou c64-joy.mou
176 cp c64/c64-potmouse.mou c64-pot.mou
178 cp c64/c64-320-200-2.tgi c64-hi.tgi
179 if [ -d c64/extra ]; then \
180 for i in c64/extra/*.o; do \
181 cp $$i c64-`basename $$i` || exit 1; \
185 #-----------------------------------------------------------------------------
190 for i in runtime c128 cbm common conio dbg em joystick mouse serial tgi zlib; do \
191 $(MAKE) SYS=c128 -C $$i || exit 1; \
192 $(AR) a c128.lib $$i/*.o || exit 1; \
196 cp c128/c128-1351.mou .
197 cp c128/c128-joymouse.mou c128-joy.mou
198 cp c128/c128-potmouse.mou c128-pot.mou
200 cp c128/c128-640-200-2.tgi c128-vdc.tgi
201 cp c128/c128-640-480-2.tgi c128-vdc2.tgi
202 if [ -d cbm/extra ]; then \
203 for i in cbm/extra/*.o; do \
204 cp $$i cbm-`basename $$i` || exit 1; \
207 if [ -d c128/extra ]; then \
208 for i in c128/extra/*.o; do \
209 cp $$i c128-`basename $$i` || exit 1; \
213 #-----------------------------------------------------------------------------
214 # Commodore P500 / CBM 5x0
218 for i in runtime cbm510 cbm common conio dbg em joystick mouse serial tgi zlib; do \
219 $(MAKE) SYS=cbm510 -C $$i || exit 1; \
220 $(AR) a cbm510.lib $$i/*.o || exit 1; \
223 cp cbm510/cbm510-stdjoy.joy cbm510-std.joy
224 cp cbm510/cbm510-stdser.ser cbm510-std.ser
225 if [ -d cbm510/extra ]; then \
226 for i in cbm510/extra/*.o; do \
227 cp $$i cbm510-`basename $$i` || exit 1; \
231 #-----------------------------------------------------------------------------
236 for i in runtime cbm610 cbm common conio dbg em joystick serial tgi zlib; do \
237 $(MAKE) SYS=cbm610 -C $$i || exit 1; \
238 $(AR) a cbm610.lib $$i/*.o || exit 1; \
241 cp cbm610/cbm610-stdser.ser cbm610-std.ser
242 if [ -d cbm610/extra ]; then \
243 for i in cbm610/extra/*.o; do \
244 cp $$i cbm610-`basename $$i` || exit 1; \
248 #-----------------------------------------------------------------------------
249 # GEOS on the C64/128
257 AFLAGS="-t geos-cbm --forget-inc-paths -I../../../asminc" \
258 CFLAGS="-Osir -g -T -t geos-cbm --forget-inc-paths -I. -I../../../include" \
260 for i in em joystick tgi conio common runtime zlib; do \
264 AFLAGS="-t geos-cbm --forget-inc-paths -I../../asminc" \
265 CFLAGS="-Osir -g -T -t geos-cbm --forget-inc-paths -I. -I../../include" \
266 $(MAKE) SYS=geos-cbm -C $$i || exit 1; \
267 for objfile in $$i/*.o; do \
268 if [ -f geos-cbm/$$objfile ]; then \
269 $(AR) a geos-cbm.lib geos-cbm/$$objfile || exit 1; \
271 $(AR) a geos-cbm.lib $$objfile || exit 1; \
275 cp geos-cbm/devel/*.emd .
276 cp geos-cbm/devel/*.joy .
277 cp geos-cbm/devel/*.tgi .
278 if [ -d geos-cbm/extra ]; then \
279 for i in geos-cbm/extra/*.o; do \
280 cp $$i geos-cbm-`basename $$i` || exit 1; \
284 #-----------------------------------------------------------------------------
289 for i in runtime lynx common conio em joystick serial tgi zlib; do \
290 $(MAKE) SYS=lynx -C $$i || exit 1; \
291 $(AR) a lynx.lib $$i/*.o || exit 1; \
296 if [ -d lynx/extra ]; then \
297 for i in lynx/extra/*.o; do \
298 cp $$i lynx-`basename $$i` || exit 1; \
302 #-----------------------------------------------------------------------------
307 for i in runtime nes common conio em joystick tgi zlib; do \
308 $(MAKE) SYS=nes -C $$i || exit 1; \
309 $(AR) a nes.lib $$i/*.o || exit 1; \
313 if [ -d nes/extra ]; then \
314 for i in nes/extra/*.o; do \
315 cp $$i nes-`basename $$i` || exit 1; \
319 #-----------------------------------------------------------------------------
324 for i in runtime pet cbm common conio dbg em joystick tgi zlib; do \
325 $(MAKE) SYS=pet -C $$i || exit 1; \
326 $(AR) a pet.lib $$i/*.o || exit 1; \
329 if [ -d pet/extra ]; then \
330 for i in pet/extra/*.o; do \
331 cp $$i pet-`basename $$i` || exit 1; \
335 #-----------------------------------------------------------------------------
340 for i in runtime plus4 cbm common conio dbg em joystick mouse serial tgi zlib; do \
341 $(MAKE) SYS=plus4 -C $$i || exit 1; \
342 $(AR) a plus4.lib $$i/*.o || exit 1; \
346 if [ -d plus4/extra ]; then \
347 for i in plus4/extra/*.o; do \
348 cp $$i plus4-`basename $$i` || exit 1; \
352 #-----------------------------------------------------------------------------
355 .PHONY: supervisionlib
357 for i in runtime supervision common; do \
358 $(MAKE) SYS=supervision -C $$i || exit 1; \
359 $(AR) a supervision.lib $$i/*.o || exit 1; \
361 if [ -d supervision/extra ]; then \
362 for i in supervision/extra/*.o; do \
363 cp $$i supervision-`basename $$i` || exit 1; \
367 #-----------------------------------------------------------------------------
372 for i in runtime vic20 cbm common conio dbg em joystick mouse tgi zlib; do \
373 $(MAKE) SYS=vic20 -C $$i || exit 1; \
374 $(AR) a vic20.lib $$i/*.o || exit 1; \
377 if [ -d vic20/extra ]; then \
378 for i in vic20/extra/*.o; do \
379 cp $$i vic20-`basename $$i` || exit 1; \
383 #-----------------------------------------------------------------------------
388 @for i in $(SHAREDDIRS); do \
389 $(MAKE) --no-print-directory -C $$i clean || exit 1; \
394 @for i in $(ALLTARGETS); do \
395 $(MAKE) -C $$i $@ || exit 1; \
400 @for i in $(SHAREDDIRS) $(ALLTARGETS); do \
401 $(MAKE) -C $$i $@ || exit 1; \
403 @$(RM) *.lib *.o *.emd *.joy *.mou *.ser *.tgi