35 lines
706 B
Makefile
Raw Normal View History

2019-02-24 20:03:51 -08:00
CAFLAGS = --target apple2enh --list-bytes 0
2019-09-22 21:33:54 -07:00
LDFLAGS = --config apple2-asm.cfg
2019-02-24 20:03:51 -08:00
OUTDIR = out
2019-10-03 21:23:00 -07:00
HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc)
2019-02-24 20:03:51 -08:00
2019-10-04 18:10:01 -07:00
TARGETS = \
$(OUTDIR)/ram.drv.system.SYS
2019-02-24 20:03:51 -08:00
2019-09-30 20:34:17 -07:00
# For timestamps
MM = $(shell date "+%-m")
DD = $(shell date "+%-d")
YY = $(shell date "+%-y")
DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY)
2019-02-24 20:03:51 -08:00
.PHONY: clean all
all: $(OUTDIR) $(TARGETS)
$(OUTDIR):
mkdir -p $(OUTDIR)
clean:
rm -f $(OUTDIR)/*.o
rm -f $(OUTDIR)/*.list
2020-03-12 20:15:18 -07:00
rm -f $(TARGETS)
2019-02-24 20:03:51 -08:00
$(OUTDIR)/%.o: %.s $(HEADERS)
2019-09-30 20:34:17 -07:00
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<
2019-02-24 20:03:51 -08:00
$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
2019-10-04 18:10:01 -07:00
ld65 $(LDFLAGS) -o $@ $<
2021-03-07 15:58:30 -08:00
command -v xattr &> /dev/null && xattr -wx prodos.AuxType '00 20' $@