# Makefile
#
# 2012-0302 by Lisias Toledo

all: mingus lisias catalog hello credits

SYS=apple2

CC=cc65
AS=ca65
LD=ld65
AR=ar65
CP=copy
RM=rm

INCLUDE = -I .. -I ../..
CFLAGS  = -t $(SYS) $(INCLUDE) -O --cpu 6502
AFLAGS  = -t $(SYS) $(INCLUDE) -l --cpu 6502
LDFLAGS = -t $(SYS)
LIBS=


.c.o:
	$(CC) $(CFLAGS) -o $(*).s $<
	$(AS) $(AFLAGS) -o $@ $(*).s

.s.o:
	$(AS) $(AFLAGS) -o $@ $<

mingus: mingus.o
	$(LD) $(LDFLAGS) -o 4.$@#064000 $^
	
lisias: lisias.o
	$(LD) $(LDFLAGS) -o 1.$@#064000 $^
	
catalog: catalog.o
	$(LD) $(LDFLAGS) -o 8.$@#064000 $^
	
credits: credits.o
	$(LD) $(LDFLAGS) -o 6.$@#064000 $^
	
hello: hello.o
	$(LD) $(LDFLAGS) -o $@ $^
	cat	$@ hello_data.mac.txt > 0.$@#060800
	
clean:
	$(RM) -f *.o *#06* *.lst
