Heute im Sonderangebot:
Ins Makefile eingewobene Hilfe-Einzeiler...
Billig wie [###ZENSIERT###] und dabei mindestens so nützlich wie dressierte Feuerameisen!
Code: Alles auswählen
$ make
help - show help
compile - just compile...
run - calculate the picture using spinsim (compiles if neccessary)
clean - remove editor backup files
clobber - remove built stuff (includes clean)
$ make compile
/opt/openspin/bin/openspin -u main.spin
Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.
Version 1.00.80 Compiled on May 8 2017 04:19:27
Compiling...
main.spin
|-SpinsimConio.spin
Done.
Unused Method Elimination:
7 methods removed
0 objects removed
200 bytes saved
--------------------------
Program size is 420 bytes
Hilfe in Makefiles wollt ich schon lange mal handlich(er) machen... also so, daß die Hilfe bei der jeweiligen Regel steht, statt irgendwo extra als kompletter Hilfe-Klumpen, den man eh dauernd vergißt aktuell zu halten.
...wenn's in ein paar Tagen noch wie eine gute Idee ausschaut, dann ist das wohl Kandidat zum Einbauen in die nächste Version des TriOS-Makefiles... ;-)
Code: Alles auswählen
$ cat Makefile
OPENSPIN = /opt/openspin/bin/openspin
SPINSIM = /opt/parallax/bin/spinsim
#!# show help
help:
@awk -F: 'match($$0,"^#!# .*$$"){s=substr($$0,RSTART+4,RLENGTH-3);getline;printf"%16s - %s\n",$$1,s}' $(MAKEFILE_LIST)
#!# just compile...
compile: main.binary
#!# calculate the picture using spinsim (compiles if neccessary)
run: pic.pgm
#!# remove editor backup files
clean:
rm -f *~
#!# remove built stuff (includes clean)
clobber: clean
rm -f main.binary pic.pgm
main.binary: main.spin $(MAKEFILE_LIST)
$(OPENSPIN) -u main.spin
pic.pgm: main.binary $(MAKEFILE_LIST)
$(SPINSIM) main.binary > $@
----------8<-----{20170606-1606-GMT}----->8----------
Wenn man...
Code: Alles auswählen
#!# show help
help:
@awk -F: 'match($$0,"^#!# .*$$"){s=substr($$0,RSTART+4,RLENGTH-3);getline;printf"%16s - %s\n",$$1,s}' $(MAKEFILE_LIST)
Code: Alles auswählen
include help.mk
----------8<-----{20180428-1405-GMT}----->8----------
Ok... make-Ziele, die keine Dateisystemobjekte darstellen, sollten via ".PHONY: name" gekennzeichnet werden, damit die Existenz gleichnamiger Dateisystemobjekte keine Wervirrung auslöst.
----------8<-----{TBC}----->8----------