makefile to build wormy.86p
authorMischa Poslawsky <wormy@shiar.org>
Wed, 25 Feb 2009 07:12:59 +0000 (08:12 +0100)
committerMischa Poslawsky <wormy@shiar.org>
Mon, 2 Mar 2009 21:42:35 +0000 (22:42 +0100)
Automated make rules to ease Wormy compilation, at least on Unix
systems.  Assume non-Windows, but default to use DOS tasm.exe and
prgm86.exe programs, since they are the most common and seem to work
decently in Wine.  Alternative (native) tools can be specified in a
custom local.mk.

.gitignore
Makefile [new file with mode: 0644]

index 349b6a8d18cfbd8df7e0458daef0f7b6001092be..b40bcd775f1277a0a4a9e5a87ec817ce297e583e 100644 (file)
@@ -1,3 +1,6 @@
+# local configuration
+/local.mk
+
 # common dos utils which need or prefer to run at the cwd
 /tasm80.tab
 /tasm.exe
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..1caebbf
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,33 @@
+Z80C  = tasm.exe
+MK86P = prgm86.exe
+
+-include local.mk
+
+all: wormy.86p
+
+wormy.86p: wormy.obj
+ifeq ($(MK86P), prgm86.exe)
+       ln -sT wormy.obj wormy
+       wine $(MK86P) wormy 2>/dev/null | tail -n 1
+       @echo
+       rm wormy
+else ifeq ($(MK86P), prgm86lin)
+       ln -sT wormy.obj wormy
+       $(MK86P) wormy | tail -n 1
+       rm wormy
+else
+       $(MK86P) wormy.obj wormy.86p
+endif
+       -rm wormy.obj
+
+wormy.obj:
+ifeq ($(Z80C), tasm.exe)
+       wine $(Z80C) -80 -b wormy.z80
+       -rm wormy.lst
+else
+       $(Z80C) wormy.z80 wormy.obj
+endif
+
+clean:
+       rm -f wormy.obj wormy.86p
+