2 # makefile for CC65 runtime library
7 #--------------------------------------------------------------------------
12 AS = ../../src/ca65/ca65
13 CC = ../../src/cc65/cc65
14 CO = ../../src/co65/co65
15 LD = ../../src/ld65/ld65
17 AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
18 CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
20 #--------------------------------------------------------------------------
25 @$(AS) -o $@ $(AFLAGS) $(*).s
28 @$(AS) -g -o $@ $(AFLAGS) $<
31 @$(CO) -o $(*)-emd.s --code-name _$(subst -,_,$(*)) $<
32 @$(AS) -o $@ $(AFLAGS) $(*)-emd.s
35 @$(CO) -o $(*)-joy.s --code-name _$(subst -,_,$(*)) $<
36 @$(AS) -o $@ $(AFLAGS) $(*)-joy.s
39 @$(CO) -o $(*)-mou.s --code-name _$(subst -,_,$(*)) $<
40 @$(AS) -o $@ $(AFLAGS) $(*)-mou.s
43 @$(CO) -o $(*)-ser.s --code-name _$(subst -,_,$(*)) $<
44 @$(AS) -o $@ $(AFLAGS) $(*)-ser.s
47 @$(CO) -o $(*)-tgi.s --code-name _$(subst -,_,$(*)) $<
48 @$(AS) -o $@ $(AFLAGS) $(*)-tgi.s
50 %.emd: %.o ../runtime/zeropage.o
51 @$(LD) -o $@ -t module $^
53 %.joy: %.o ../runtime/zeropage.o
54 @$(LD) -o $@ -t module $^
56 %.mou: %.o ../runtime/zeropage.o
57 @$(LD) -o $@ -t module $^
59 %.ser: %.o ../runtime/zeropage.o
60 @$(LD) -o $@ -t module $^
62 %.tgi: %.o ../runtime/zeropage.o
63 @$(LD) -o $@ -t module $^
65 #--------------------------------------------------------------------------
99 #--------------------------------------------------------------------------
104 JOYS = nes-stdjoy.joy
110 TGIS = nes-64-56-2.tgi
112 #--------------------------------------------------------------------------
115 .PHONY: all clean zap
117 all: $(OBJS) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
120 $(MAKE) -C $(dir $@) $(notdir $@)
122 ../runtime/zeropage.o:
123 $(MAKE) -C $(dir $@) $(notdir $@)
125 nes-64-56-2.tgi: nes-64-56-2.o \
127 ../runtime/zeropage.o \
135 @$(LD) -o $@ -t module $^
139 $(EMDS:.emd=.o) $(EMDS:.emd=-emd.s) \
140 $(JOYS:.joy=.o) $(JOYS:.joy=-joy.s) \
141 $(MOUS:.mou=.o) $(MOUS:.mou=-mou.s) \
142 $(SERS:.ser=.o) $(SERS:.ser=-ser.s) \
143 $(TGIS:.tgi=.o) $(TGIS:.tgi=-tgi.s)
146 @$(RM) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)