2000-05-28 13:40:48 +00:00
|
|
|
#
|
|
|
|
# Makefile for cc65 samples
|
|
|
|
#
|
2000-06-06 17:45:06 +00:00
|
|
|
# This Makefile requires GNU make
|
|
|
|
#
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
# Enter the target system here
|
|
|
|
SYS = c64
|
|
|
|
|
2000-06-14 21:14:47 +00:00
|
|
|
CRT0 = ../libsrc/$(SYS).o
|
|
|
|
CLIB = ../libsrc/$(SYS).lib
|
|
|
|
CC = ../src/cc65/cc65
|
|
|
|
CL = ../src/cl65/cl65
|
|
|
|
AS = ../src/ca65/ca65
|
|
|
|
LD = ../src/ld65/ld65
|
2000-05-28 13:40:48 +00:00
|
|
|
C1541 = c1541
|
|
|
|
|
|
|
|
|
2001-09-26 17:55:09 +00:00
|
|
|
# --------------------------------------------------------------------------
|
|
|
|
# Generic rules
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
.c.o:
|
|
|
|
@echo $<
|
2001-09-13 15:58:32 +00:00
|
|
|
@$(CC) -Oirs -T --codesize 500 -g -t $(SYS) -I../include/ $<
|
2000-06-14 21:14:47 +00:00
|
|
|
@$(AS) $(basename $<).s
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
.s.o:
|
|
|
|
@echo $<
|
2000-06-14 21:14:47 +00:00
|
|
|
@$(AS) $(basename $<).s
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
2001-09-26 17:55:09 +00:00
|
|
|
# --------------------------------------------------------------------------
|
|
|
|
# Rules how to make each one of the binaries
|
|
|
|
|
2002-11-25 14:20:33 +00:00
|
|
|
EXELIST=fire hello mousedemo nachtm plasma sieve tgidemo
|
2001-09-26 17:55:09 +00:00
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
.PHONY: all
|
2001-09-26 17:55:09 +00:00
|
|
|
all: $(EXELIST)
|
|
|
|
|
2002-11-25 14:20:33 +00:00
|
|
|
fire: $(CRT0) fire.o $(CLIB)
|
|
|
|
@$(LD) -t $(SYS) -m fire.map -Ln fire.lbl -o $@ $^
|
|
|
|
|
2002-10-03 17:36:18 +00:00
|
|
|
hello: $(CRT0) hello.o $(CLIB)
|
2001-09-26 17:55:09 +00:00
|
|
|
@$(LD) -t $(SYS) -m hello.map -Ln hello.lbl -o $@ $^
|
|
|
|
|
|
|
|
mousedemo: $(CRT0) mousedemo.o $(CLIB)
|
|
|
|
@$(LD) -t $(SYS) -m mousedemo.map -Ln mousedemo.lbl -o $@ $^
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2002-10-03 17:36:18 +00:00
|
|
|
nachtm: $(CRT0) nachtm.o $(CLIB)
|
|
|
|
@$(LD) -t $(SYS) -vm -m nachtm.map -Ln nachtm.lbl -o $@ $^
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2002-10-03 17:36:18 +00:00
|
|
|
plasma: $(CRT0) plasma.o $(CLIB)
|
|
|
|
@$(LD) -t $(SYS) -m plasma.map -Ln nachtm.lbl -o $@ $^
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2002-10-03 17:36:18 +00:00
|
|
|
sieve: $(CRT0) sieve.o $(CLIB)
|
2000-05-28 13:40:48 +00:00
|
|
|
@$(LD) -t $(SYS) -m sieve.map -Ln sieve.lbl -o $@ $^
|
|
|
|
|
2002-10-03 17:36:18 +00:00
|
|
|
tgidemo: $(CRT0) tgidemo.o $(CLIB)
|
|
|
|
@$(LD) -t $(SYS) -m tgidemo.map -Ln tgidemo.lbl -o $@ $^
|
|
|
|
|
2001-09-26 17:55:09 +00:00
|
|
|
|
|
|
|
# --------------------------------------------------------------------------
|
|
|
|
# Rule to make a disk with all samples. Needs the c1541 program that comes
|
|
|
|
# with the VICE emulator.
|
2001-09-13 15:58:32 +00:00
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
.PHONY: disk
|
2001-09-13 15:58:32 +00:00
|
|
|
disk: samples.d64
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2001-09-13 15:58:32 +00:00
|
|
|
samples.d64: all
|
2002-11-25 14:20:33 +00:00
|
|
|
@$(C1541) -format samples,AA d64 $@ > /dev/null
|
|
|
|
@for exe in $(EXELIST); do\
|
|
|
|
$(C1541) -attach $@ -write $$exe > /dev/null;\
|
|
|
|
done;\
|
2002-12-13 00:24:22 +00:00
|
|
|
for tgi in ../libsrc/$(SYS)*.tgi; do\
|
2002-11-25 14:20:33 +00:00
|
|
|
$(C1541) -attach $@ -write $$tgi > /dev/null;\
|
|
|
|
done;
|
2001-09-26 17:55:09 +00:00
|
|
|
|
|
|
|
# --------------------------------------------------------------------------
|
|
|
|
# Cleanup rules
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f *~ *.map *.o *.s *.lbl
|
|
|
|
|
|
|
|
.PHONY: zap
|
|
|
|
zap: clean
|
2001-09-26 17:55:09 +00:00
|
|
|
rm -f $(EXELIST) samples.d64
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|