33 lines
624 B
Makefile
33 lines
624 B
Makefile
GBDK_HOME = gbdk
|
|
|
|
CC = $(GBDK_HOME)/bin/lcc -mz80:sms -Wm-yoA -Wl-j
|
|
|
|
BINS = BiffBolton.sms
|
|
|
|
all: $(BINS)
|
|
|
|
ASRC = $(wildcard *.s)
|
|
CSRC = $(wildcard *.c)
|
|
|
|
OBJS = $(CSRC:%.c=%.o) $(ASRC:%.s=%.o)
|
|
|
|
compile.bat: Makefile
|
|
@echo "REM Automatically generated from Makefile" > compile.bat
|
|
@make -sn | sed y/\\//\\\\/ | sed s/mkdir\ -p\/mkdir\/ | grep -v make >> compile.bat
|
|
|
|
# Compile and link single file in one pass
|
|
|
|
%.o: %.c
|
|
$(CC) -c -o $@ $<
|
|
|
|
%.o: %.s
|
|
$(CC) -c -o $@ $<
|
|
|
|
$(BINS): $(OBJS)
|
|
$(CC) -Wm-yS -o $@ $^
|
|
rm -f *.map *.noi *.ihx *.lst
|
|
|
|
clean:
|
|
rm -f *.o *.lst *.map *.sms *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm *.noi
|
|
|