2004-03-13 23:25:11 +00:00
|
|
|
#
|
|
|
|
# makefile for CC65 runtime library
|
|
|
|
#
|
|
|
|
|
|
|
|
.SUFFIXES: .o .s .c
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------------
|
2004-10-26 19:28:26 +00:00
|
|
|
# Programs and flags
|
|
|
|
|
|
|
|
SYS = apple2enh
|
|
|
|
|
|
|
|
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../apple2 -I../../asminc
|
2005-03-26 17:03:30 +00:00
|
|
|
CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I ../apple2 -I ../../include
|
2004-10-26 19:28:26 +00:00
|
|
|
|
|
|
|
#--------------------------------------------------------------------------
|
2004-03-13 23:25:11 +00:00
|
|
|
# Rules
|
|
|
|
|
2012-10-15 21:59:51 +00:00
|
|
|
%.o: ../apple2/%.c
|
2005-04-18 10:00:40 +00:00
|
|
|
@$(CC) -o $(notdir $(*).s) $(CFLAGS) $<
|
2004-03-13 23:25:11 +00:00
|
|
|
@$(AS) -o $@ $(AFLAGS) $(*).s
|
|
|
|
|
2005-03-26 17:03:30 +00:00
|
|
|
%.o: ../apple2/%.s
|
2004-03-13 23:25:11 +00:00
|
|
|
@$(AS) -g -o $@ $(AFLAGS) $<
|
|
|
|
|
2009-09-22 21:43:57 +00:00
|
|
|
extra/%.o: ../apple2/extra/%.s
|
|
|
|
@$(AS) -g -o $@ $(AFLAGS) $<
|
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
%-emd.o: %.emd
|
|
|
|
@$(CO) -o $(*)-emd.s --code-name _$(subst -,_,$(*)) $<
|
|
|
|
@$(AS) -o $@ $(AFLAGS) $(*)-emd.s
|
|
|
|
|
|
|
|
%-joy.o: %.joy
|
|
|
|
@$(CO) -o $(*)-joy.s --code-name _$(subst -,_,$(*)) $<
|
|
|
|
@$(AS) -o $@ $(AFLAGS) $(*)-joy.s
|
|
|
|
|
|
|
|
%-mou.o: %.mou
|
|
|
|
@$(CO) -o $(*)-mou.s --code-name _$(subst -,_,$(*)) $<
|
|
|
|
@$(AS) -o $@ $(AFLAGS) $(*)-mou.s
|
|
|
|
|
|
|
|
%-ser.o: %.ser
|
|
|
|
@$(CO) -o $(*)-ser.s --code-name _$(subst -,_,$(*)) $<
|
|
|
|
@$(AS) -o $@ $(AFLAGS) $(*)-ser.s
|
|
|
|
|
|
|
|
%-tgi.o: %.tgi
|
|
|
|
@$(CO) -o $(*)-tgi.s --code-name _$(subst -,_,$(*)) $<
|
|
|
|
@$(AS) -o $@ $(AFLAGS) $(*)-tgi.s
|
|
|
|
|
2010-11-09 21:33:14 +00:00
|
|
|
%.emd: %.o ../runtime/zeropage.o
|
|
|
|
@$(LD) -o $@ -t module $^
|
2004-03-13 23:25:11 +00:00
|
|
|
|
|
|
|
%.joy: %.o ../runtime/zeropage.o
|
2010-11-09 21:33:14 +00:00
|
|
|
@$(LD) -o $@ -t module $^
|
2004-03-13 23:25:11 +00:00
|
|
|
|
2006-04-06 19:51:37 +00:00
|
|
|
%.mou: %.o ../runtime/zeropage.o
|
2010-11-09 21:33:14 +00:00
|
|
|
@$(LD) -o $@ -t module $^
|
2006-04-06 19:51:37 +00:00
|
|
|
|
2005-09-08 21:03:46 +00:00
|
|
|
%.ser: %.o ../runtime/zeropage.o
|
2010-11-09 21:33:14 +00:00
|
|
|
@$(LD) -o $@ -t module $^
|
2005-09-08 21:03:46 +00:00
|
|
|
|
2004-03-13 23:25:11 +00:00
|
|
|
%.tgi: %.o ../runtime/zeropage.o
|
2010-11-09 21:33:14 +00:00
|
|
|
@$(LD) -o $@ -t module $^
|
2004-03-13 23:25:11 +00:00
|
|
|
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Object files
|
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
C_OBJS= closedir.o \
|
|
|
|
opendir.o \
|
|
|
|
readdir.o \
|
2005-08-31 20:11:45 +00:00
|
|
|
rewinddir.o
|
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
S_OBJS= _scrsize.o \
|
|
|
|
break.o \
|
|
|
|
cclear.o \
|
|
|
|
cgetc.o \
|
|
|
|
chline.o \
|
|
|
|
close.o \
|
|
|
|
clrscr.o \
|
|
|
|
color.o \
|
|
|
|
cout.o \
|
|
|
|
cputc.o \
|
|
|
|
crt0.o \
|
|
|
|
ctype.o \
|
|
|
|
curdevice.o \
|
|
|
|
cvline.o \
|
|
|
|
devicedir.o \
|
|
|
|
dioclose.o \
|
|
|
|
diocommon.o \
|
|
|
|
dioopen.o \
|
|
|
|
dioread.o \
|
|
|
|
diosectcount.o \
|
|
|
|
diosectsize.o \
|
|
|
|
diowrite.o \
|
|
|
|
dosdetect.o \
|
|
|
|
exec.o \
|
|
|
|
exehdr.o \
|
|
|
|
filedes.o \
|
|
|
|
filename.o \
|
|
|
|
get_ostype.o \
|
|
|
|
getdevice.o \
|
|
|
|
gotoxy.o \
|
|
|
|
gotoy.o \
|
|
|
|
home.o \
|
|
|
|
initcwd.o \
|
|
|
|
iobuf.o \
|
|
|
|
isdevice.o \
|
|
|
|
joy_stddrv.o \
|
|
|
|
kbhit.o \
|
|
|
|
mainargs.o \
|
|
|
|
mcbdefault.o \
|
|
|
|
mli.o \
|
|
|
|
mouse_stddrv.o \
|
|
|
|
open.o \
|
|
|
|
oserrlist.o \
|
|
|
|
oserror.o \
|
|
|
|
randomize.o \
|
|
|
|
rdkey.o \
|
|
|
|
read.o \
|
|
|
|
reboot.o \
|
|
|
|
revers.o \
|
|
|
|
rwcommon.o \
|
|
|
|
syschdir.o \
|
|
|
|
sysmkdir.o \
|
|
|
|
sysremove.o \
|
|
|
|
sysrename.o \
|
|
|
|
sysrmdir.o \
|
|
|
|
systime.o \
|
|
|
|
sysuname.o \
|
|
|
|
textframe.o \
|
|
|
|
tgi_colors.o \
|
|
|
|
tgi_stddrv.o \
|
|
|
|
toascii.o \
|
|
|
|
videomode.o \
|
|
|
|
vtabz.o \
|
|
|
|
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)
|
|
|
|
|
|
|
|
S_EXTRA_OBJS= \
|
2009-09-22 21:43:57 +00:00
|
|
|
extra/iobuf-0800.o
|
|
|
|
|
2004-03-13 23:25:11 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Drivers
|
|
|
|
|
2008-03-16 09:37:22 +00:00
|
|
|
EMDS = apple2-auxmem.emd
|
2004-03-13 23:25:11 +00:00
|
|
|
|
2005-03-26 17:03:30 +00:00
|
|
|
JOYS = apple2-stdjoy.joy
|
2004-03-13 23:25:11 +00:00
|
|
|
|
2006-04-06 19:51:37 +00:00
|
|
|
MOUS = apple2-stdmou.mou
|
|
|
|
|
2005-09-08 21:03:46 +00:00
|
|
|
SERS = apple2-ssc.ser
|
2004-03-13 23:25:11 +00:00
|
|
|
|
2008-03-16 09:37:22 +00:00
|
|
|
TGIS = apple2-280-192-8.tgi apple2-40-48-16.tgi
|
2004-03-13 23:25:11 +00:00
|
|
|
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Targets
|
|
|
|
|
|
|
|
.PHONY: all clean zap
|
|
|
|
|
2012-10-29 20:26:26 +00:00
|
|
|
all: $(C_OBJS) $(S_OBJS) $(S_EXTRA_OBJS) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
|
2004-03-13 23:25:11 +00:00
|
|
|
|
|
|
|
../runtime/zeropage.o:
|
|
|
|
$(MAKE) -C $(dir $@) $(notdir $@)
|
|
|
|
|
|
|
|
clean:
|
2012-10-29 20:26:26 +00:00
|
|
|
@$(RM) $(C_OBJS:.o=.s) $(C_OBJS) $(S_OBJS) $(S_EXTRA_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)
|
2004-03-13 23:25:11 +00:00
|
|
|
|
2012-10-15 21:59:51 +00:00
|
|
|
zap: clean
|
2006-04-06 19:51:37 +00:00
|
|
|
@$(RM) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
|