]> git.sur5r.net Git - cc65/blob - samples/Makefile
Added tgidemo
[cc65] / samples / Makefile
1 #
2 # Makefile for cc65 samples
3 #
4 # This Makefile requires GNU make
5 #
6
7 # Enter the target system here
8 SYS     = c64
9
10 CRT0    = ../libsrc/$(SYS).o
11 CLIB    = ../libsrc/$(SYS).lib
12 CC      = ../src/cc65/cc65
13 CL      = ../src/cl65/cl65
14 AS      = ../src/ca65/ca65
15 LD      = ../src/ld65/ld65
16 C1541   = c1541
17
18
19 # --------------------------------------------------------------------------
20 # Generic rules
21
22 .c.o:
23         @echo $<
24         @$(CC) -Oirs -T --codesize 500 -g -t $(SYS) -I../include/ $<
25         @$(AS) $(basename $<).s
26
27 .s.o:
28         @echo $<
29         @$(AS) $(basename $<).s
30
31
32 # --------------------------------------------------------------------------
33 # Rules how to make each one of the binaries
34
35 EXELIST=hello mousedemo nachtm plasma sieve tgidemo
36
37 .PHONY: all
38 all:    $(EXELIST)
39
40 hello:          $(CRT0) hello.o $(CLIB)
41         @$(LD) -t $(SYS) -m hello.map -Ln hello.lbl -o $@ $^
42
43 mousedemo:      $(CRT0) mousedemo.o $(CLIB)
44         @$(LD) -t $(SYS) -m mousedemo.map -Ln mousedemo.lbl -o $@ $^
45
46 nachtm:         $(CRT0) nachtm.o $(CLIB)
47         @$(LD) -t $(SYS) -vm -m nachtm.map -Ln nachtm.lbl -o $@ $^
48
49 plasma:         $(CRT0) plasma.o $(CLIB)
50         @$(LD) -t $(SYS) -m plasma.map -Ln nachtm.lbl -o $@ $^
51
52 sieve:          $(CRT0) sieve.o $(CLIB)
53         @$(LD) -t $(SYS) -m sieve.map -Ln sieve.lbl -o $@ $^
54
55 tgidemo:        $(CRT0) tgidemo.o $(CLIB)
56         @$(LD) -t $(SYS) -m tgidemo.map -Ln tgidemo.lbl -o $@ $^
57
58
59 # --------------------------------------------------------------------------
60 # Rule to make a disk with all samples. Needs the c1541 program that comes
61 # with the VICE emulator.
62
63 .PHONY: disk
64 disk:   samples.d64
65
66 samples.d64:    all
67         $(C1541) -format samples,AA  d64 $@
68         for exe in $(EXELIST); do\
69             $(C1541) -attach $@ -write $$exe;\
70         done
71
72
73 # --------------------------------------------------------------------------
74 # Cleanup rules
75
76 .PHONY: clean
77 clean:
78         rm -f *~ *.map *.o *.s *.lbl
79
80 .PHONY: zap
81 zap:    clean
82         rm -f $(EXELIST) samples.d64
83
84
85
86