2002-08-07 05:18:13 +00:00
|
|
|
#
|
|
|
|
# makefile for CC65 runtime library
|
|
|
|
#
|
|
|
|
|
|
|
|
.SUFFIXES: .o .s .c
|
|
|
|
|
2004-10-26 18:58:48 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Programs and flags
|
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
SYS = vic20
|
2004-10-26 18:58:48 +00:00
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
AS = ../../src/ca65/ca65
|
|
|
|
CC = ../../src/cc65/cc65
|
|
|
|
CO = ../../src/co65/co65
|
|
|
|
LD = ../../src/ld65/ld65
|
2004-10-26 18:58:48 +00:00
|
|
|
|
2009-09-24 17:44:22 +00:00
|
|
|
AFLAGS=-t $(SYS) --forget-inc-paths -I../../asminc
|
2004-10-26 18:58:48 +00:00
|
|
|
CFLAGS=-Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
|
|
|
|
|
2002-12-20 23:23:06 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Rules
|
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
%.o: %.c
|
2002-08-07 05:18:13 +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
|
2002-12-20 23:23:06 +00:00
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
%-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
|
|
|
|
|
|
|
|
%-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
|
2010-11-09 21:33:14 +00:00
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
%.emd: %.o ../runtime/zeropage.o
|
2010-11-09 21:33:14 +00:00
|
|
|
@$(LD) -o $@ -t module $^
|
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
%.joy: %.o ../runtime/zeropage.o
|
2010-11-09 21:33:14 +00:00
|
|
|
@$(LD) -o $@ -t module $^
|
2002-12-20 23:23:06 +00:00
|
|
|
|
|
|
|
%.tgi: %.o ../runtime/zeropage.o
|
2010-11-09 21:33:14 +00:00
|
|
|
@$(LD) -o $@ -t module $^
|
2002-12-20 23:23:06 +00:00
|
|
|
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Object files
|
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
OBJS = _scrsize.o \
|
|
|
|
break.o \
|
|
|
|
crt0.o \
|
|
|
|
cgetc.o \
|
|
|
|
clrscr.o \
|
|
|
|
color.o \
|
|
|
|
conio.o \
|
|
|
|
cputc.o \
|
|
|
|
devnum.o \
|
|
|
|
get_tv.o \
|
2012-11-01 19:53:47 +00:00
|
|
|
joy_stat_stddrv.o \
|
2012-10-29 20:26:26 +00:00
|
|
|
joy_stddrv.o \
|
|
|
|
kbhit.o \
|
|
|
|
kernal.o \
|
|
|
|
kplot.o \
|
|
|
|
mainargs.o \
|
|
|
|
randomize.o \
|
|
|
|
revers.o \
|
|
|
|
status.o \
|
|
|
|
sysuname.o \
|
|
|
|
$(EMDS:.emd=-emd.o) \
|
|
|
|
$(JOYS:.joy=-joy.o) \
|
|
|
|
$(TGIS:.tgi=-tgi.o)
|
2002-12-20 23:23:06 +00:00
|
|
|
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Drivers
|
|
|
|
|
|
|
|
EMDS =
|
|
|
|
|
2005-08-28 21:01:59 +00:00
|
|
|
JOYS = vic20-stdjoy.joy vic20-ptvjoy.joy
|
2002-12-20 23:23:06 +00:00
|
|
|
|
|
|
|
TGIS =
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# 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) $(TGIS)
|
2002-08-07 05:18:13 +00:00
|
|
|
|
2002-12-20 23:23:06 +00:00
|
|
|
../runtime/zeropage.o:
|
|
|
|
$(MAKE) -C $(dir $@) $(notdir $@)
|
2002-08-07 05:18:13 +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) \
|
|
|
|
$(TGIS:.tgi=.o) $(TGIS:.tgi=-tgi.s)
|
2002-08-07 05:18:13 +00:00
|
|
|
|
2003-02-06 15:35:30 +00:00
|
|
|
zap: clean
|
2003-08-20 11:59:27 +00:00
|
|
|
@$(RM) $(EMDS) $(JOYS) $(TGIS)
|