2 # makefile for CC65 runtime library
7 #--------------------------------------------------------------------------
12 AS = ../../src/ca65/ca65
13 CC = ../../src/cc65/cc65
14 LD = ../../src/ld65/ld65
16 AFLAGS = -t $(SYS) --forget-inc-paths -I../apple2 -I../../asminc
17 CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I ../apple2 -I ../../include
19 #--------------------------------------------------------------------------
23 @$(CC) -o $(notdir $(*).s) $(CFLAGS) $<
24 @$(AS) -o $@ $(AFLAGS) $(*).s
27 @$(AS) -g -o $@ $(AFLAGS) $<
29 extra/%.o: ../apple2/extra/%.s
30 @$(AS) -g -o $@ $(AFLAGS) $<
32 %.emd: %.o ../runtime/zeropage.o
33 @$(LD) -t module -o $@ $^
35 %.joy: %.o ../runtime/zeropage.o
36 @$(LD) -t module -o $@ $^
38 %.mou: %.o ../runtime/zeropage.o
39 @$(LD) -t module -o $@ $^
41 %.ser: %.o ../runtime/zeropage.o
42 @$(LD) -t module -o $@ $^
44 %.tgi: %.o ../runtime/zeropage.o
45 @$(LD) -t module -o $@ $^
47 #--------------------------------------------------------------------------
119 #--------------------------------------------------------------------------
122 EMDS = apple2-auxmem.emd
124 JOYS = apple2-stdjoy.joy
126 MOUS = apple2-stdmou.mou
128 SERS = apple2-ssc.ser
130 TGIS = apple2-280-192-8.tgi apple2-40-48-16.tgi
132 #--------------------------------------------------------------------------
135 .PHONY: all clean zap
137 all: $(C_OBJS) $(S_OBJS) $(S_EXTRA_OBJS) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
139 ../runtime/zeropage.o:
140 $(MAKE) -C $(dir $@) $(notdir $@)
143 @$(RM) $(C_OBJS:.o=.s) $(C_OBJS) $(S_OBJS) $(S_EXTRA_OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(MOUS:.mou=.o) $(SERS:.ser=.o) $(TGIS:.tgi=.o)
146 @$(RM) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)