2 # makefile for CC65 Atari runtime library
4 # NUMDRVS - number of supported drives (max. 16)
5 # 4 bytes for each device are statically allocated
6 # LINEBUF - support line buffered reads from E: (the number specifies
7 # the length of the buffer)
8 # UCASE_FILENAME - all filenames get uppercased
9 # DEFAULT_DEVICE - if the string passed to the uppercase function doesn't
10 # include a device (":" at position 2 or 3), provide "Dn:"
11 # as a default disk device
12 # n is the value of DEFAULT_DEVICE, unless DYNAMIC_DD is
13 # also set, in which case it's overridden by a runtime
14 # check (on SpartaDOS only)
15 # needs UCASE_FILENAME to be defined, otherwise no effect
16 # DYNAMIC_DD - determine default disk device at runtime (SpartaDOS only)
17 # needs DEFAULT_DEVICE to be defined, otherwise no effect
19 ATARIDEFS = -DNUMDRVS=4 -DUCASE_FILENAME=1 -DDEFAULT_DEVICE=1 -DLINEBUF=80
20 ATARIDEFS += -DDYNAMIC_DD=1
24 #--------------------------------------------------------------------------
29 AS = ../../src/ca65/ca65
30 CC = ../../src/cc65/cc65
31 CO = ../../src/co65/co65
32 LD = ../../src/ld65/ld65
34 AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
35 CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
37 #--------------------------------------------------------------------------
41 @$(CC) $(CFLAGS) $(ATARIDEFS) $<
42 @$(AS) -o $@ $(AFLAGS) $(*).s
45 @$(AS) -g -o $@ $(AFLAGS) $(ATARIDEFS) $<
48 @$(CO) -o $(*)-emd.s --code-label _$(subst -,_,$(*)) $<
49 @$(AS) -o $@ $(AFLAGS) $(*)-emd.s
52 @$(CO) -o $(*)-joy.s --code-label _$(subst -,_,$(*)) $<
53 @$(AS) -o $@ $(AFLAGS) $(*)-joy.s
56 @$(CO) -o $(*)-tgi.s --code-label _$(subst -,_,$(*)) $<
57 @$(AS) -o $@ $(AFLAGS) $(*)-tgi.s
59 %.emd: %.o ../runtime/zeropage.o
60 @$(LD) -o $@ -t module $^
62 %.joy: %.o ../runtime/zeropage.o
63 @$(LD) -o $@ -t module $^
65 %.tgi: %.o ../runtime/zeropage.o atari_tgi_common.inc
66 @$(LD) -o $@ -t module $< ../runtime/zeropage.o
69 #--------------------------------------------------------------------------
140 $(EMDS:.emd=-emd.o) \
141 $(JOYS:.joy=-joy.o) \
145 #--------------------------------------------------------------------------
148 EMDS = atari-130xe.emd
150 JOYS = atari-stdjoy.joy atari-multijoy.joy
152 TGIS = atari-3.tgi atari-4.tgi atari-5.tgi atari-6.tgi atari-7.tgi atari-8.tgi \
153 atari-9.tgi atari-10.tgi atari-11.tgi atari-14.tgi atari-15.tgi atari-8p2.tgi \
154 atari-9p2.tgi atari-10p2.tgi atari-15p2.tgi
156 #--------------------------------------------------------------------------
159 all: $(OBJS) $(EMDS) $(JOYS) $(TGIS)
161 ../runtime/zeropage.o:
162 $(MAKE) -C $(dir $@) $(notdir $@)
166 $(EMDS:.emd=.o) $(EMDS:.emd=-emd.s) \
167 $(JOYS:.joy=.o) $(JOYS:.joy=-joy.s) \
168 $(TGIS:.tgi=.o) $(TGIS:.tgi=-tgi.s)
171 @$(RM) $(EMDS) $(JOYS) $(TGIS)