]> git.sur5r.net Git - cc65/blobdiff - samples/Makefile
Added SegDef struct and a few functions to the segdefs module
[cc65] / samples / Makefile
index 997c88bc26d55a578133f6caa9077d3240bbe7cd..2e278620afaea8b871431def57eefe404019ceed 100644 (file)
@@ -16,9 +16,12 @@ LD   = ../src/ld65/ld65
 C1541          = c1541
 
 
+# --------------------------------------------------------------------------
+# Generic rules
+
 .c.o:
        @echo $<
-       @$(CC) -g -Oirs -t $(SYS) -I../include/ $<
+       @$(CC) -Oirs -T --codesize 500 -g -t $(SYS) -I../include/ $<
        @$(AS) $(basename $<).s
 
 .s.o:
@@ -26,23 +29,54 @@ C1541       = c1541
        @$(AS) $(basename $<).s
 
 
+# --------------------------------------------------------------------------
+# Rules how to make each one of the binaries
+
+EXELIST=fire hello mousedemo nachtm plasma sieve tgidemo
+
 .PHONY:        all
-all:           nachtm hello sieve
+all:           $(EXELIST)
 
-nachtm:        $(CRT0) nachtm.o $(CLIB)
-       @$(LD) -t $(SYS) -m nachtm.map -Ln nachtm.lbl -o $@ $^
+fire:          $(CRT0) fire.o $(CLIB)
+       @$(LD) -t $(SYS) -m fire.map -Ln fire.lbl -o $@ $^
 
-hello:         $(CRT0) hello.o $(CLIB)
+hello:                 $(CRT0) hello.o $(CLIB)
        @$(LD) -t $(SYS) -m hello.map -Ln hello.lbl -o $@ $^
 
-sieve:         $(CRT0) sieve.o $(CLIB)
+mousedemo:             $(CRT0) mousedemo.o $(CLIB)
+       @$(LD) -t $(SYS) -m mousedemo.map -Ln mousedemo.lbl -o $@ $^
+
+nachtm:                $(CRT0) nachtm.o $(CLIB)
+       @$(LD) -t $(SYS) -vm -m nachtm.map -Ln nachtm.lbl -o $@ $^
+
+plasma:                $(CRT0) plasma.o $(CLIB)
+       @$(LD) -t $(SYS) -m plasma.map -Ln nachtm.lbl -o $@ $^
+
+sieve:                 $(CRT0) sieve.o $(CLIB)
        @$(LD) -t $(SYS) -m sieve.map -Ln sieve.lbl -o $@ $^
 
+tgidemo:       $(CRT0) tgidemo.o $(CLIB)
+       @$(LD) -t $(SYS) -m tgidemo.map -Ln tgidemo.lbl -o $@ $^
+
+
+# --------------------------------------------------------------------------
+# Rule to make a disk with all samples. Needs the c1541 program that comes
+# with the VICE emulator.
+
 .PHONY:        disk
-disk:  c64.d64
+disk:          samples.d64
+
+samples.d64:   all
+       @$(C1541) -format samples,AA  d64 $@ > /dev/null
+       @for exe in $(EXELIST); do\
+           $(C1541) -attach $@ -write $$exe > /dev/null;\
+       done;\
+       for tgi in *.tgi; do\
+           $(C1541) -attach $@ -write $$tgi > /dev/null;\
+       done;
 
-c64.d64:       all
-       $(C1541) < c1541.rsp
+# --------------------------------------------------------------------------
+# Cleanup rules
 
 .PHONY:        clean
 clean:
@@ -50,7 +84,7 @@ clean:
 
 .PHONY:        zap
 zap:   clean
-       rm -f nachtm hello
+       rm -f $(EXELIST) samples.d64