prodos-path/Makefile

39 lines
752 B
Makefile
Raw Permalink Normal View History

2019-01-07 00:44:54 +00:00
2021-03-08 03:26:19 +00:00
CAFLAGS := --target apple2enh --list-bytes 0
LDFLAGS := --config apple2-asm.cfg
2019-01-07 00:44:54 +00:00
2021-03-08 03:26:19 +00:00
OUTDIR := out
2019-01-07 00:44:54 +00:00
2021-03-08 03:26:19 +00:00
TARGETS := $(OUTDIR)/path.BIN \
2021-04-17 17:05:22 +00:00
$(shell cat COMMANDS | while read line; do echo "out/$${line}.CMD"; done)
2019-01-07 00:44:54 +00:00
2021-03-08 00:31:54 +00:00
XATTR := $(shell command -v xattr 2> /dev/null)
2020-06-07 15:02:08 +00:00
.PHONY: clean all package
2019-01-07 00:44:54 +00:00
all: $(OUTDIR) $(TARGETS)
$(OUTDIR):
mkdir -p $(OUTDIR)
2021-03-08 03:26:19 +00:00
HEADERS := $(wildcard *.inc)
2019-01-07 00:44:54 +00:00
clean:
rm -f $(OUTDIR)/*.o
rm -f $(OUTDIR)/*.list
rm -f $(TARGETS)
2019-01-07 00:44:54 +00:00
2020-06-07 15:02:08 +00:00
package:
./package.sh
2019-01-07 00:44:54 +00:00
$(OUTDIR)/%.o: %.s $(HEADERS)
2019-09-23 04:34:34 +00:00
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<
2019-01-07 00:44:54 +00:00
$(OUTDIR)/%.BIN $(OUTDIR)/%.SYS: $(OUTDIR)/%.o
2019-09-23 04:34:34 +00:00
ld65 $(LDFLAGS) -o $@ $<
2021-03-08 00:31:54 +00:00
ifdef XATTR
xattr -wx prodos.AuxType '00 20' $@
endif
2019-01-07 01:23:56 +00:00
$(OUTDIR)/%.CMD: $(OUTDIR)/%.cmd.o
2019-09-23 04:34:34 +00:00
ld65 $(LDFLAGS) -o $@ $<