diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-06-11 14:36:48 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-06-11 14:37:15 -0400 |
commit | db53602d19e2d9c42400d7734a21843ddc47577b (patch) | |
tree | a5d9c0b6d49ab48f653fbc4af39be6a425defeff | |
parent | 5892768446068984af27d14a09a1c39903a29060 (diff) | |
download | nodeMCU_rf_source_lmx2487-db53602d19e2d9c42400d7734a21843ddc47577b.tar.gz nodeMCU_rf_source_lmx2487-db53602d19e2d9c42400d7734a21843ddc47577b.zip |
added version generation
-rw-r--r-- | Makefile | 13 | ||||
-rw-r--r-- | version.lua | 2 | ||||
-rw-r--r-- | version.template | 2 |
3 files changed, 15 insertions, 2 deletions
@@ -1,6 +1,8 @@ # -*- make -*- # (C) 2016 by Eugeniy Mikhailov, <evgmik@gmail.com> +TOPDIR=. + include ./local.mk # this file is a bit complex since it tries to be general enough to use @@ -28,7 +30,7 @@ endif UPLOAD_STAMPS = .upload_stamps -lua_files = $(wildcard *.lua) +lua_files = $(wildcard *.lua) version.lua httpserver_lua_files = $(wildcard nodemcu-httpserver/httpserver*.lua) html_files = $(wildcard http/*) @@ -36,7 +38,7 @@ lua_files_upload_stamps = $(lua_files:%=$(UPLOAD_STAMPS)/%.uploaded) httpserver_files_upload_stamps = $(httpserver_lua_files:%=$(UPLOAD_STAMPS)/%.uploaded) html_files_upload_stamps = $(html_files:%=$(UPLOAD_STAMPS)/%.uploaded) -upload: $(UPLOAD_STAMPS) $(html_files_upload_stamps) $(lua_files_upload_stamps) $(httpserver_files_upload_stamps) +upload: $(UPLOAD_STAMPS) $(html_files_upload_stamps) version $(lua_files_upload_stamps) $(httpserver_files_upload_stamps) $(UPLOAD_STAMPS): mkdir -p $(UPLOAD_STAMPS) @@ -65,6 +67,13 @@ else ($(upload_cmd) --src $< --dest $<) && touch $@ endif +GIT_VERSION:="$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1), branch $(shell [ -f $(TOPDIR)/.git/HEAD ] && sed 's/ref: refs\/heads\/\(.*\)/\\\\\\"\1\\\\\\"/g' $(TOPDIR)/.git/HEAD || echo 'unknown'))" +VERSION:=$(shell git describe --tags --abbrev=0) + +version: version.lua + +version.lua: version.template $(lua_files%version.lua%) + sed s/__VERSION__/{$(GIT_VERSION)}/ < $< > $@ term: $(term_cmd) diff --git a/version.lua b/version.lua new file mode 100644 index 0000000..5fa212c --- /dev/null +++ b/version.lua @@ -0,0 +1,2 @@ +print("{v1.0-home-cooked-binary-25-g5892768 (2021-06-11, branch "binary-speedup")}") + diff --git a/version.template b/version.template new file mode 100644 index 0000000..5a64f5c --- /dev/null +++ b/version.template @@ -0,0 +1,2 @@ +print("__VERSION__") + |