2 # Makefile for cc65 samples
4 # This Makefile requires GNU make
7 # Enter the target system here
10 # Determine the path to the executables and libraries. If the samples
11 # directory is part of a complete source tree, use the stuff from this
12 # source tree, otherwise use the "official" directories.
13 ifeq "$(wildcard ../src)" ""
23 # Samples is part of a complete source tree
24 CRT0 = ../libsrc/$(SYS).o
25 CLIB = ../libsrc/$(SYS).lib
30 export CC65_INC = ../include
33 # This one comes with VICE
37 # --------------------------------------------------------------------------
42 @$(CC) -Oirs -T --forget-inc-paths --codesize 500 -g -t $(SYS) -I../include/ $<
43 @$(AS) $(basename $<).s
47 @$(AS) $(basename $<).s
50 # --------------------------------------------------------------------------
51 # List of executables. This list could be made target dependent by checking
65 # --------------------------------------------------------------------------
66 # Rules how to make each one of the binaries
71 ascii: $(CRT0) ascii.o $(CLIB)
72 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
74 diodemo: $(CRT0) diodemo.o $(CLIB)
75 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
77 fire: $(CRT0) fire.o $(CLIB)
78 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
80 gunzip65: $(CRT0) gunzip65.o $(CLIB)
81 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
83 hello: $(CRT0) hello.o $(CLIB)
84 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
86 mandelbrot: $(CRT0) mandelbrot.o $(CLIB)
87 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
89 mousedemo: $(CRT0) mousedemo.o $(CLIB)
90 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
92 nachtm: $(CRT0) nachtm.o $(CLIB)
93 @$(LD) -t $(SYS) -m $(basename $@).map -Ln $(basename $@).lbl -o $@ $^
95 plasma: $(CRT0) plasma.o $(CLIB)
96 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
98 sieve: $(CRT0) sieve.o $(CLIB)
99 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
101 tgidemo: $(CRT0) tgidemo.o $(CLIB)
102 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
105 # --------------------------------------------------------------------------
106 # Rule to make a disk with all samples. Needs the c1541 program that comes
107 # with the VICE emulator.
113 @$(C1541) -format samples,AA d64 $@ > /dev/null
114 @for exe in $(EXELIST); do\
115 $(C1541) -attach $@ -write $$exe > /dev/null;\
117 for tgi in ../libsrc/$(SYS)*.tgi; do\
118 $(C1541) -attach $@ -write $$tgi > /dev/null;\
121 # --------------------------------------------------------------------------
126 $(RM) *~ *.map *.o *.s *.lbl
130 $(RM) $(EXELIST) samples.d64