C1541 = c1541
+# --------------------------------------------------------------------------
+# Generic rules
+
.c.o:
@echo $<
- @$(CC) -Oirs -T --codesize 500 -g -t $(SYS) -I../include/ $<
+ @$(CC) -Oirs -T --forget-inc-paths --codesize 500 -g -t $(SYS) -I../include/ $<
@$(AS) $(basename $<).s
.s.o:
@$(AS) $(basename $<).s
+# --------------------------------------------------------------------------
+# Rules how to make each one of the binaries
+
+EXELIST=ascii fire gunzip65 hello mousedemo nachtm plasma sieve tgidemo
+
.PHONY: all
-all: nachtm hello sieve mousedemo
+all: $(EXELIST)
-nachtm: $(CRT0) nachtm.o $(CLIB)
- @$(LD) -t $(SYS) -m nachtm.map -Ln nachtm.lbl -o $@ $^
+ascii: $(CRT0) ascii.o $(CLIB)
+ @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
-hello: $(CRT0) hello.o $(CLIB)
- @$(LD) -t $(SYS) -m hello.map -Ln hello.lbl -o $@ $^
+fire: $(CRT0) fire.o $(CLIB)
+ @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
-sieve: $(CRT0) sieve.o $(CLIB)
- @$(LD) -t $(SYS) -m sieve.map -Ln sieve.lbl -o $@ $^
+gunzip65: $(CRT0) gunzip65.o $(CLIB)
+ @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
+
+hello: $(CRT0) hello.o $(CLIB)
+ @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
mousedemo: $(CRT0) mousedemo.o $(CLIB)
- @$(LD) -t $(SYS) -m mousedemo.map -Ln mousedemo.lbl -o $@ $^
+ @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
+
+nachtm: $(CRT0) nachtm.o $(CLIB)
+ @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
+
+plasma: $(CRT0) plasma.o $(CLIB)
+ @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
+
+sieve: $(CRT0) sieve.o $(CLIB)
+ @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
+
+tgidemo: $(CRT0) tgidemo.o $(CLIB)
+ @$(LD) -t $(SYS) -m $(basename $@).map -o $@ $^
+
+
+# --------------------------------------------------------------------------
+# Rule to make a disk with all samples. Needs the c1541 program that comes
+# with the VICE emulator.
.PHONY: disk
disk: samples.d64
samples.d64: all
- $(C1541) -format samples,AA d64 $@
- $(C1541) -attach $@ -write nachtm -write hello -write sieve -write mousedemo
+ @$(C1541) -format samples,AA d64 $@ > /dev/null
+ @for exe in $(EXELIST); do\
+ $(C1541) -attach $@ -write $$exe > /dev/null;\
+ done;\
+ for tgi in ../libsrc/$(SYS)*.tgi; do\
+ $(C1541) -attach $@ -write $$tgi > /dev/null;\
+ done;
+
+# --------------------------------------------------------------------------
+# Cleanup rules
.PHONY: clean
clean:
- rm -f *~ *.map *.o *.s *.lbl
+ $(RM) *~ *.map *.o *.s *.lbl
.PHONY: zap
zap: clean
- rm -f nachtm hello sieve mousedemo samples.d64
+ $(RM) $(EXELIST) samples.d64