2002-06-03 20:23:15 +00:00
|
|
|
#
|
|
|
|
# makefile for CC65 runtime library
|
|
|
|
#
|
|
|
|
|
|
|
|
.SUFFIXES: .o .s .c
|
|
|
|
|
2004-10-26 19:28:26 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Programs and flags
|
|
|
|
|
|
|
|
SYS = atmos
|
|
|
|
|
|
|
|
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-12-18 11:58:50 +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
|
|
|
|
|
2003-02-06 15:35:30 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Rules
|
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
%.o: %.c
|
2002-06-03 20:23:15 +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
|
|
|
|
|
|
|
|
%-mou.o: %.mou
|
2012-10-31 23:39:58 +00:00
|
|
|
@$(CO) -o $(*)-mou.s --code-label _$(subst -,_,$(*)) $<
|
2012-10-29 20:26:26 +00:00
|
|
|
@$(AS) -o $@ $(AFLAGS) $(*)-mou.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
|
|
|
|
|
2004-06-03 21:27:56 +00:00
|
|
|
%.emd: %.o ../runtime/zeropage.o
|
2010-11-09 21:33:14 +00:00
|
|
|
@$(LD) -o $@ -t module $^
|
2004-06-03 21:27:56 +00:00
|
|
|
|
|
|
|
%.joy: %.o ../runtime/zeropage.o
|
2010-11-09 21:33:14 +00:00
|
|
|
@$(LD) -o $@ -t module $^
|
2004-06-03 21:27:56 +00:00
|
|
|
|
|
|
|
%.mou: %.o ../runtime/zeropage.o
|
2010-11-09 21:33:14 +00:00
|
|
|
@$(LD) -o $@ -t module $^
|
2004-06-03 21:27:56 +00:00
|
|
|
|
|
|
|
%.ser: %.o ../runtime/zeropage.o
|
2010-11-09 21:33:14 +00:00
|
|
|
@$(LD) -o $@ -t module $^
|
2004-06-03 21:27:56 +00:00
|
|
|
|
|
|
|
%.tgi: %.o ../runtime/zeropage.o
|
2010-11-09 21:33:14 +00:00
|
|
|
@$(LD) -o $@ -t module $^
|
2004-06-03 21:27:56 +00:00
|
|
|
|
2003-02-06 15:35:30 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Object files
|
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
OBJS = _scrsize.o \
|
|
|
|
atmos_load.o \
|
|
|
|
atmos_save.o \
|
|
|
|
cclear.o \
|
|
|
|
cgetc.o \
|
|
|
|
chline.o \
|
|
|
|
clock.o \
|
|
|
|
clrscr.o \
|
|
|
|
color.o \
|
|
|
|
cputc.o \
|
|
|
|
crt0.o \
|
|
|
|
ctype.o \
|
|
|
|
cvline.o \
|
|
|
|
gotox.o \
|
|
|
|
gotoxy.o \
|
|
|
|
gotoy.o \
|
2012-11-01 19:53:47 +00:00
|
|
|
joy_stat_stddrv.o \
|
2012-11-01 15:58:27 +00:00
|
|
|
joy_stddrv.o \
|
2012-10-29 20:26:26 +00:00
|
|
|
kbhit.o \
|
|
|
|
mainargs.o \
|
|
|
|
oserrlist.o \
|
|
|
|
oserror.o \
|
|
|
|
revers.o \
|
|
|
|
store_filename.o \
|
|
|
|
systime.o \
|
|
|
|
sysuname.o \
|
|
|
|
tgi_colors.o \
|
2012-11-01 19:53:47 +00:00
|
|
|
tgi_stat_stddrv.o \
|
2012-11-01 15:58:27 +00:00
|
|
|
tgi_stddrv.o \
|
2012-10-29 20:26:26 +00:00
|
|
|
wherex.o \
|
|
|
|
wherey.o \
|
|
|
|
write.o \
|
|
|
|
$(EMDS:.emd=-emd.o) \
|
|
|
|
$(JOYS:.joy=-joy.o) \
|
|
|
|
$(MOUS:.mou=-mou.o) \
|
|
|
|
$(SERS:.ser=-ser.o) \
|
|
|
|
$(TGIS:.tgi=-tgi.o)
|
|
|
|
|
2004-06-03 21:27:56 +00:00
|
|
|
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Drivers
|
|
|
|
|
|
|
|
EMDS =
|
|
|
|
|
2009-12-21 21:14:21 +00:00
|
|
|
JOYS = atmos-pase.joy
|
2004-06-03 21:27:56 +00:00
|
|
|
|
|
|
|
MOUS =
|
|
|
|
|
2012-03-09 10:48:59 +00:00
|
|
|
SERS = atmos-acia.ser
|
2004-06-03 21:27:56 +00:00
|
|
|
|
|
|
|
TGIS = atmos-240-200-2.tgi
|
2002-11-12 22:49:38 +00:00
|
|
|
|
2003-02-06 15:35:30 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Targets
|
|
|
|
|
|
|
|
.PHONY: all clean zap
|
|
|
|
|
2004-06-03 21:27:56 +00:00
|
|
|
all: $(OBJS) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
|
|
|
|
|
|
|
|
../runtime/zeropage.o:
|
|
|
|
$(MAKE) -C $(dir $@) $(notdir $@)
|
2002-06-03 20:23:15 +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) \
|
|
|
|
$(MOUS:.mou=.o) $(MOUS:.mou=-mou.s) \
|
|
|
|
$(SERS:.ser=.o) $(SERS:.ser=-ser.s) \
|
|
|
|
$(TGIS:.tgi=.o) $(TGIS:.tgi=-tgi.s)
|
2002-06-03 20:23:15 +00:00
|
|
|
|
2003-02-06 15:35:30 +00:00
|
|
|
zap: clean
|
2004-06-03 21:27:56 +00:00
|
|
|
@$(RM) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
|