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 # Rules how to make each one of the binaries
53 EXELIST=ascii fire gunzip65 hello mousedemo nachtm plasma sieve tgidemo
58 ascii: $(CRT0) ascii.o $(CLIB)
59 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
61 fire: $(CRT0) fire.o $(CLIB)
62 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
64 gunzip65: $(CRT0) gunzip65.o $(CLIB)
65 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
67 hello: $(CRT0) hello.o $(CLIB)
68 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
70 mandelbrot: $(CRT0) mandelbrot.o $(CLIB)
71 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
73 mousedemo: $(CRT0) mousedemo.o $(CLIB)
74 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
76 nachtm: $(CRT0) nachtm.o $(CLIB)
77 @$(LD) -t $(SYS) -m $(basename $@).map -Ln $(basename $@).lbl -o $@ $^
79 plasma: $(CRT0) plasma.o $(CLIB)
80 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
82 sieve: $(CRT0) sieve.o $(CLIB)
83 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
85 tgidemo: $(CRT0) tgidemo.o $(CLIB)
86 @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
89 # --------------------------------------------------------------------------
90 # Rule to make a disk with all samples. Needs the c1541 program that comes
91 # with the VICE emulator.
97 @$(C1541) -format samples,AA d64 $@ > /dev/null
98 @for exe in $(EXELIST); do\
99 $(C1541) -attach $@ -write $$exe > /dev/null;\
101 for tgi in ../libsrc/$(SYS)*.tgi; do\
102 $(C1541) -attach $@ -write $$tgi > /dev/null;\
105 # --------------------------------------------------------------------------
110 $(RM) *~ *.map *.o *.s *.lbl
114 $(RM) $(EXELIST) samples.d64