2003-04-14 21:28:51 +00:00
|
|
|
#
|
|
|
|
# makefile for CC65 runtime library
|
|
|
|
#
|
|
|
|
|
|
|
|
.SUFFIXES: .o .s .c
|
|
|
|
|
2004-10-26 19:28:26 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Programs and flags
|
|
|
|
|
|
|
|
SYS = nes
|
|
|
|
|
|
|
|
AS = ../../src/ca65/ca65
|
|
|
|
CC = ../../src/cc65/cc65
|
|
|
|
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
|
|
|
|
|
2003-04-14 21:28:51 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Rules
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
@$(CC) $(CFLAGS) $<
|
|
|
|
@$(AS) -o $@ $(AFLAGS) $(*).s
|
|
|
|
|
|
|
|
%.o: %.s
|
|
|
|
@$(AS) -g -o $@ $(AFLAGS) $<
|
|
|
|
|
2004-10-26 21:01:50 +00:00
|
|
|
%.emd: %.o ../runtime/zeropage.o
|
|
|
|
@$(LD) -t module -o $@ $^
|
|
|
|
|
|
|
|
%.joy: %.o ../runtime/zeropage.o
|
|
|
|
@$(LD) -t module -o $@ $^
|
|
|
|
|
|
|
|
%.mou: %.o ../runtime/zeropage.o
|
|
|
|
@$(LD) -t module -o $@ $^
|
|
|
|
|
|
|
|
%.ser: %.o ../runtime/zeropage.o
|
|
|
|
@$(LD) -t module -o $@ $^
|
|
|
|
|
|
|
|
%.tgi: %.o ../runtime/zeropage.o
|
|
|
|
@$(LD) -t module -o $@ $^
|
|
|
|
|
2003-04-14 21:28:51 +00:00
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Object files
|
|
|
|
|
2004-10-26 21:01:50 +00:00
|
|
|
OBJS = _scrsize.o \
|
|
|
|
cclear.o \
|
|
|
|
chline.o \
|
|
|
|
clock.o \
|
|
|
|
clrscr.o \
|
|
|
|
color.o \
|
|
|
|
cputc.o \
|
|
|
|
crt0.o \
|
|
|
|
ctype.o \
|
|
|
|
cvline.o \
|
2008-04-10 20:12:20 +00:00
|
|
|
get_tv.o \
|
2004-10-26 21:01:50 +00:00
|
|
|
gotox.o \
|
|
|
|
gotoxy.o \
|
|
|
|
gotoy.o \
|
|
|
|
mainargs.o \
|
|
|
|
ppu.o \
|
|
|
|
ppubuf.o \
|
|
|
|
randomize.o \
|
|
|
|
revers.o \
|
|
|
|
setcursor.o \
|
|
|
|
sysuname.o \
|
|
|
|
waitvblank.o \
|
|
|
|
wherex.o \
|
|
|
|
wherey.o
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Drivers
|
|
|
|
|
|
|
|
EMDS =
|
|
|
|
|
|
|
|
JOYS = nes-stdjoy.joy
|
|
|
|
|
|
|
|
MOUS =
|
|
|
|
|
|
|
|
SERS =
|
|
|
|
|
|
|
|
TGIS =
|
2003-04-14 21:28:51 +00:00
|
|
|
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Targets
|
|
|
|
|
|
|
|
.PHONY: all clean zap
|
|
|
|
|
2004-10-26 21:01:50 +00:00
|
|
|
all: $(OBJS) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
|
|
|
|
|
|
|
|
../runtime/zeropage.o:
|
|
|
|
$(MAKE) -C $(dir $@) $(notdir $@)
|
2003-04-14 21:28:51 +00:00
|
|
|
|
|
|
|
clean:
|
2004-10-26 21:01:50 +00:00
|
|
|
@$(RM) $(OBJS) $(EMDS:.emd=.o) $(JOYS:.joy=.o) $(MOUS:.mou=.o) $(SERS:.ser=.o) $(TGIS:.tgi=.o)
|
2003-04-14 21:28:51 +00:00
|
|
|
|
|
|
|
zap: clean
|
2004-10-26 21:01:50 +00:00
|
|
|
@$(RM) $(EMDS) $(JOYS) $(MOUS) $(SERS) $(TGIS)
|
2003-04-14 21:28:51 +00:00
|
|
|
|
2005-04-21 21:31:16 +00:00
|
|
|
|