BINARY = rrqforth
-rrqforth: main.fasm
+default: X
+
+VFMT := "RRQ Forth version %h at %aI"
+VERSION := $(shell git log -1 --pretty=format:'$(VFMT)' main.fasm)
+
+main.fasm: machine.fasm readline.fasm syscalls.fasm
+
+version: main.fasm
+ @echo "db '$(VERSION)'\ndb 10" > $@
+
+rrqforth: main.fasm |
fasm $^ $@
+ chmod a+x $@
+
+rrqforth.fas: main.fasm rrqforth
+ fasm $< -s $@
+
+X: rrqforth.fas
+ ./symbols.lsp $< > $@
+clean:
+ rm -f version rrqforth rrqforth.fas