|
@@ -77,7 +77,7 @@ endif
|
|
|
|
|
|
|
|
|
auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
|
|
|
-auto_gen_others=cfg.tab.h # auto generated, non-c
|
|
|
+auto_gen_others=cfg.tab.h autover.h # auto generated, non-c
|
|
|
|
|
|
COREPATH=.
|
|
|
#include source related defs
|
|
@@ -394,8 +394,13 @@ modules_search_path=$(subst $(space),:,$(strip\
|
|
|
$(foreach m,$(modules_dirs),$($(m)_target))))
|
|
|
# $(addprefix $(modules_target),$(modules_dirs))))
|
|
|
|
|
|
+# special depends for main.o
|
|
|
+main.o: autover.h
|
|
|
main.o: DEFS+=-DMODS_DIR='"$(modules_search_path)"'
|
|
|
|
|
|
+#special depends for core_cmd.o
|
|
|
+core_cmd.o: autover.h
|
|
|
+
|
|
|
include Makefile.shared
|
|
|
|
|
|
ifeq ($(config_mak),1)
|
|
@@ -445,6 +450,24 @@ modules-cfg modules-list modules-lst:
|
|
|
rm -f modules.lst
|
|
|
$(MAKE) modules.lst
|
|
|
|
|
|
+ifneq ($(wildcard .git),)
|
|
|
+# if .git/ exists
|
|
|
+repo_ver=$(shell git rev-parse --short=6 HEAD 2>/dev/null || echo "unknown" )
|
|
|
+autover_h_dep=.git
|
|
|
+else
|
|
|
+# else if .git/ does not exist
|
|
|
+repo_ver="unknown"
|
|
|
+autover_h_dep=
|
|
|
+endif
|
|
|
+
|
|
|
+autover.h: $(autover_h_dep)
|
|
|
+ @echo "generating autover.h ($(autover_h_dep)) ..."
|
|
|
+ @echo "/* this file is autogenerated by make autover.h" >$@
|
|
|
+ @echo " * DO NOT EDIT IT" >>$@
|
|
|
+ @echo " */" >>$@
|
|
|
+ @echo "" >>$@
|
|
|
+ @echo "#define REPO_VER \"$(repo_ver)\"" >>$@
|
|
|
+
|
|
|
.PHONY: all
|
|
|
all: $(NAME) every-module
|
|
|
|