added auto-versioning
authorRalph Ronnquist <ralph.ronnquist@gmail.com>
Wed, 12 May 2021 05:02:21 +0000 (15:02 +1000)
committerRalph Ronnquist <ralph.ronnquist@gmail.com>
Wed, 12 May 2021 05:02:21 +0000 (15:02 +1000)
Makefile
main.fasm

index 012248adc33017fad4b886d323cc4fd043c8c3ef..39e68f2b2adf940a953fa6520b32b14fc9ad48c7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,14 @@
 BINARY = rrqforth
 
-rrqforth: main.fasm
+default: rrqforth
+
+version: main.fasm
+       git log --pretty=format:"msg db 'RRQ Forth version %h at %aI'" $< > $@
+       echo "\ndb 10" >> $@
+
+rrqforth: main.fasm | version
        fasm $^ $@
+       chmod a+x $@
 
+clean:
+       rm -f version rrqforth
index 6bd525a8e3e84c5daa0de659457879e28940e544..dd4f30de6e0fdcc9b9625768d9b0ab67a419c237 100644 (file)
--- a/main.fasm
+++ b/main.fasm
@@ -3,8 +3,7 @@
        entry main
 
        segment readable executable
-       msg db 'hello world.'
-       db 10
+       include 'version'
        length = $ - msg
 
 main: