2 # Makefile for cc65 samples
4 # This Makefile requires GNU make
7 # Enter the target system here
10 CRT0 = ../libsrc/$(SYS).o
11 CLIB = ../libsrc/$(SYS).lib
19 # --------------------------------------------------------------------------
24 @$(CC) -Oirs -T --forget-inc-paths --codesize 500 -g -t $(SYS) -I../include/ $<
25 @$(AS) $(basename $<).s
29 @$(AS) $(basename $<).s
32 # --------------------------------------------------------------------------
33 # Rules how to make each one of the binaries
35 EXELIST=ascii fire gunzip65 hello mousedemo nachtm plasma sieve tgidemo
40 ascii: $(CRT0) ascii.o $(CLIB)
41 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
43 fire: $(CRT0) fire.o $(CLIB)
44 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
46 gunzip65: $(CRT0) gunzip65.o $(CLIB)
47 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
49 hello: $(CRT0) hello.o $(CLIB)
50 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
52 mousedemo: $(CRT0) mousedemo.o $(CLIB)
53 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
55 nachtm: $(CRT0) nachtm.o $(CLIB)
56 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
58 plasma: $(CRT0) plasma.o $(CLIB)
59 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
61 sieve: $(CRT0) sieve.o $(CLIB)
62 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
64 tgidemo: $(CRT0) tgidemo.o $(CLIB)
65 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
68 # --------------------------------------------------------------------------
69 # Rule to make a disk with all samples. Needs the c1541 program that comes
70 # with the VICE emulator.
76 @$(C1541) -format samples,AA d64 $@ > /dev/null
77 @for exe in $(EXELIST); do\
78 $(C1541) -attach $@ -write $$exe > /dev/null;\
80 for tgi in ../libsrc/$(SYS)*.tgi; do\
81 $(C1541) -attach $@ -write $$tgi > /dev/null;\
84 # --------------------------------------------------------------------------
89 $(RM) *~ *.map *.o *.s *.lbl
93 $(RM) $(EXELIST) samples.d64