aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2022-12-10 18:08:27 -0500
committerB. Watson <urchlay@slackware.uk>2022-12-10 18:08:27 -0500
commit2c420394ee7a5d177e2485828c4fdb4dd35a28f8 (patch)
treebe2b14bf9f74b2230ce669b3daa33b7d22e5def3 /Makefile
downloadtmu45tools-2c420394ee7a5d177e2485828c4fdb4dd35a28f8.tar.gz
Initial commit.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile112
1 files changed, 112 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4471d45
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,112 @@
+# Makefile for tmu45tools
+# Only seems to work with GNU make (not BSD, sorry).
+
+PROJECT=tmu45tools
+VERSION=0.0.2
+
+CL65=cl65
+CL65FLAGS=-g -t none
+
+# comment this out if you need to see start/run addresses
+CL65FLAGS+= --asm-define xex_verbose=0
+
+C=$(CL65) $(CL65FLAGS)
+MVAL0=--asm-define magic_value=0
+MVAL1=--asm-define magic_value=1
+MVAL2=--asm-define magic_value=2
+RLOGIC=--asm-define reverse_logic=1
+COLD=--asm-define coldstart=1
+
+UTOOLS=u256.xex u512.xex uoff.xex u256r.xex u512r.xex uoffx.xex u256x.xex u512x.xex u256rx.xex u512rx.xex
+SETMEMS=setmem.xex setmemr.xex setmemx.xex setmemrx.xex
+
+UDEPS=u.s ver.s xex.inc
+SMDEPS=setmem.s xex.inc inv.inc
+
+ZIP=zip
+ZIPFILE=$(PROJECT)-$(VERSION).zip
+
+AXE=axe
+ATRFILE=$(PROJECT)-$(VERSION).atr
+
+all: setmems utools
+
+utools: $(UTOOLS)
+
+setmems: $(SETMEMS)
+
+setmem.da65.s: setmem.xex setmem.info
+ da65 -i setmem.info
+
+setmem.xex: $(SMDEPS)
+ $(C) -l $@.list -o $@ $<
+ @if cmp setmem.xex setmem.orig.xex; then \
+ echo "OK: setmem.xex identical to setmem.orig.xex"; \
+ else \
+ echo "*** setmem.s is broken (setmem.xex not identical to setmem.orig.xex)"; \
+ exit 1; \
+ fi
+
+setmemr.xex: $(SMDEPS)
+ $(C) $(RLOGIC) -l $@.list -o $@ $<
+
+setmemx.xex: $(SMDEPS)
+ $(C) $(COLD) -l $@.list -o $@ $<
+
+setmemrx.xex: $(SMDEPS)
+ $(C) $(RLOGIC) $(COLD) -l $@.list -o $@ $<
+
+uoff.xex: $(UDEPS)
+ $(C) $(MVAL1) -l $@.list -o $@ $<
+
+u256.xex: $(UDEPS)
+ $(C) $(MVAL2) -l $@.list -o $@ $<
+
+u512.xex: $(UDEPS)
+ $(C) $(MVAL0) -l $@.list -o $@ $<
+
+u256r.xex: $(UDEPS)
+ $(C) $(MVAL0) $(RLOGIC) -l $@.list -o $@ $<
+
+u512r.xex: $(UDEPS)
+ $(C) $(MVAL2) $(RLOGIC) -l $@.list -o $@ $<
+
+uoffx.xex: $(UDEPS)
+ $(C) $(COLD) $(MVAL1) -l $@.list -o $@ $<
+
+u256x.xex: $(UDEPS)
+ $(C) $(COLD) $(MVAL2) -l $@.list -o $@ $<
+
+u512x.xex: $(UDEPS)
+ $(C) $(COLD) $(MVAL0) -l $@.list -o $@ $<
+
+u256rx.xex: $(UDEPS)
+ $(C) $(COLD) $(MVAL0) $(RLOGIC) -l $@.list -o $@ $<
+
+u512rx.xex: $(UDEPS)
+ $(C) $(COLD) $(MVAL2) $(RLOGIC) -l $@.list -o $@ $<
+
+ver.s:
+ echo " .define VERSION \"$(VERSION)\"" > ver.s
+
+clean:
+ rm -f *.o setmem.da65.s *.list $(UTOOLS) $(SETMEMS) README.1ST
+
+zip: $(ZIPFILE)
+
+atr: $(ATRFILE)
+
+$(ZIPFILE): atr
+ rm -f $(PROJECT)-$(VERSION).zip
+ $(ZIP) $(ZIPFILE) README.txt $(UTOOLS) $(SETMEMS) $(ATRFILE)
+
+$(ATRFILE): utools setmems README.1ST
+ rm -f $(ATRFILE)
+ cp mydos450.atr $(ATRFILE)
+ $(AXE) -w README.1ST $(ATRFILE)
+ for i in $(UTOOLS) $(SETMEMS); do $(AXE) -w $$i $(ATRFILE); done
+
+README.1ST: README.txt
+ perl -000 -ne 'print unless /https?:/' README.txt | fmt -w 40 | tr '\n' '\233' > README.1ST
+
+.PHONY: all setmems utools clean zip atr