2000-05-28 13:40:48 +00:00
|
|
|
#
|
|
|
|
# makefile for CC65 runtime library
|
|
|
|
#
|
|
|
|
|
|
|
|
.SUFFIXES: .o .s .c
|
|
|
|
|
2004-10-26 19:28:26 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Programs and flags
|
|
|
|
|
|
|
|
SYS = cbm610
|
|
|
|
|
|
|
|
AS = ../../src/ca65/ca65
|
|
|
|
CC = ../../src/cc65/cc65
|
2012-10-29 20:26:26 +00:00
|
|
|
CO = ../../src/co65/co65
|
2004-10-26 19:28:26 +00:00
|
|
|
LD = ../../src/ld65/ld65
|
|
|
|
|
2009-09-24 17:44:22 +00:00
|
|
|
AFLAGS = -t $(SYS) --forget-inc-paths -I../../asminc
|
2004-10-26 19:28:26 +00:00
|
|
|
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
|
|
|
|
|
2002-12-10 10:30:01 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Rules
|
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
%.o: %.c
|
2000-05-28 13:40:48 +00:00
|
|
|
@$(CC) $(CFLAGS) $<
|
|
|
|
@$(AS) -o $@ $(AFLAGS) $(*).s
|
|
|
|
|
|
|
|
%.o: %.s
|
|
|
|
@$(AS) -g -o $@ $(AFLAGS) $<
|
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
%-emd.o: %.emd
|
2012-10-31 23:39:58 +00:00
|
|
|
@$(CO) -o $(*)-emd.s --code-label _$(subst -,_,$(*)) $<
|
2012-10-29 20:26:26 +00:00
|
|
|
@$(AS) -o $@ $(AFLAGS) $(*)-emd.s
|
|
|
|
|
|
|
|
%-joy.o: %.joy
|
2012-10-31 23:39:58 +00:00
|
|
|
@$(CO) -o $(*)-joy.s --code-label _$(subst -,_,$(*)) $<
|
2012-10-29 20:26:26 +00:00
|
|
|
@$(AS) -o $@ $(AFLAGS) $(*)-joy.s
|
|
|
|
|
|
|
|
%-ser.o: %.ser
|
2012-10-31 23:39:58 +00:00
|
|
|
@$(CO) -o $(*)-ser.s --code-label _$(subst -,_,$(*)) $<
|
2012-10-29 20:26:26 +00:00
|
|
|
@$(AS) -o $@ $(AFLAGS) $(*)-ser.s
|
|
|
|
|
|
|
|
%-tgi.o: %.tgi
|
2012-10-31 23:39:58 +00:00
|
|
|
@$(CO) -o $(*)-tgi.s --code-label _$(subst -,_,$(*)) $<
|
2012-10-29 20:26:26 +00:00
|
|
|
@$(AS) -o $@ $(AFLAGS) $(*)-tgi.s
|
|
|
|
|
2003-12-20 23:13:26 +00:00
|
|
|
%.emd: %.o ../runtime/zeropage.o extzp.o
|
2010-11-09 21:33:14 +00:00
|
|
|
@$(LD) -o $@ -t module $^
|
|
|
|
|
|
|
|
%.joy: %.o ../runtime/zeropage.o extzp.o
|
|
|
|
@$(LD) -o $@ -t module $^
|
|
|
|
|
2003-12-20 23:13:26 +00:00
|
|
|
%.ser: %.o ../runtime/zeropage.o extzp.o
|
2010-11-09 21:33:14 +00:00
|
|
|
@$(LD) -o $@ -t module $^
|
2003-12-20 23:13:26 +00:00
|
|
|
|
|
|
|
%.tgi: %.o ../runtime/zeropage.o extzp.o
|
2010-11-09 21:33:14 +00:00
|
|
|
@$(LD) -o $@ -t module $^
|
2002-12-10 10:30:01 +00:00
|
|
|
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Object files
|
|
|
|
|
2012-11-07 22:34:08 +00:00
|
|
|
OBJS = _scrsize.o \
|
2012-10-29 20:26:26 +00:00
|
|
|
banking.o \
|
|
|
|
break.o \
|
|
|
|
cgetc.o \
|
|
|
|
clrscr.o \
|
|
|
|
color.o \
|
|
|
|
cputc.o \
|
|
|
|
crt0.o \
|
|
|
|
crtc.o \
|
|
|
|
devnum.o \
|
|
|
|
extzp.o \
|
|
|
|
get_tv.o \
|
2013-02-12 22:39:38 +00:00
|
|
|
irq.o \
|
2012-10-29 20:26:26 +00:00
|
|
|
kbhit.o \
|
|
|
|
kclose.o \
|
|
|
|
kernal.o \
|
|
|
|
kiobase.o \
|
|
|
|
kopen.o \
|
|
|
|
krdtim.o \
|
|
|
|
kreadst.o \
|
|
|
|
kscnkey.o \
|
|
|
|
kscreen.o \
|
|
|
|
ksetnam.o \
|
|
|
|
ksettim.o \
|
|
|
|
kudtim.o \
|
|
|
|
mainargs.o \
|
|
|
|
peeksys.o \
|
|
|
|
pokesys.o \
|
|
|
|
randomize.o \
|
|
|
|
revers.o \
|
|
|
|
systime.o \
|
|
|
|
sysuname.o \
|
|
|
|
$(EMDS:.emd=-emd.o) \
|
|
|
|
$(JOYS:.joy=-joy.o) \
|
|
|
|
$(SERS:.ser=-ser.o) \
|
|
|
|
$(TGIS:.tgi=-tgi.o)
|
2000-11-23 19:05:32 +00:00
|
|
|
|
2002-12-10 10:30:01 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Drivers
|
|
|
|
|
2012-11-07 22:34:08 +00:00
|
|
|
EMDS = cbm610-ram.emd
|
2002-12-10 10:30:01 +00:00
|
|
|
|
2003-12-20 23:13:26 +00:00
|
|
|
JOYS =
|
|
|
|
|
|
|
|
SERS = cbm610-stdser.ser
|
|
|
|
|
|
|
|
TGIS =
|
|
|
|
|
2002-12-10 10:30:01 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Targets
|
|
|
|
|
2003-02-06 15:35:30 +00:00
|
|
|
.PHONY: all clean zap
|
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
all: $(OBJS) $(EMDS) $(JOYS) $(SERS) $(TGIS)
|
2002-12-10 10:30:01 +00:00
|
|
|
|
|
|
|
../runtime/zeropage.o:
|
|
|
|
$(MAKE) -C $(dir $@) $(notdir $@)
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
clean:
|
2012-10-29 20:26:26 +00:00
|
|
|
@$(RM) $(OBJS) \
|
|
|
|
$(EMDS:.emd=.o) $(EMDS:.emd=-emd.s) \
|
|
|
|
$(JOYS:.joy=.o) $(JOYS:.joy=-joy.s) \
|
|
|
|
$(SERS:.ser=.o) $(SERS:.ser=-ser.s) \
|
|
|
|
$(TGIS:.tgi=.o) $(TGIS:.tgi=-tgi.s)
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2003-02-06 15:35:30 +00:00
|
|
|
zap: clean
|
2003-12-20 23:13:26 +00:00
|
|
|
@$(RM) $(EMDS) $(JOYS) $(SERS) $(TGIS)
|