add record with module origin (source repo and git hash)

This commit is contained in:
2021-07-20 14:04:51 +02:00
parent dfec91854f
commit df59dabc56
3 changed files with 105 additions and 46 deletions
+11 -3
View File
@@ -167,6 +167,8 @@ export MAKE_FIRST
export SUBMODULES
export USE_LIBVERSION
export ORIGIN=$(firstword $(shell git remote -v 2>/dev/null | awk '/psi.ch.*(fetch)/{print $$2;exit}')$(patsubst %,[%],$(shell git describe --tags --dirty --always --long 2>/dev/null)) $(addsuffix /,$(shell cat CVS/Root 2>/dev/null))$(shell cat CVS/Repository 2>/dev/null) $(PWD))
# Some shell commands:
RMDIR = rm -rf
LN = ln -s
@@ -940,20 +942,26 @@ debug::
@echo "INSTALL_BIN = $(INSTALL_BIN)"
@echo "INSTALL_BINS = $(INSTALL_BINS)"
INSTALLS += .ORIGIN
INSTALLS += ${INSTALL_CFGS} ${INSTALL_SCRS} ${INSTALL_HDRS} ${INSTALL_DBDS} ${INSTALL_DBS} ${INSTALL_LIBS} ${INSTALL_BINS} ${INSTALL_DEPS}
ifdef USE_EXACT_VERSION
INSTALLS += ${EPICS_MODULES}/${PRJ}/use_exact_version
%/use_exact_version:
%/use_exact_version: | %
touch $@
else
ifdef USE_EXACT_MINOR_VERSION
INSTALLS += ${EPICS_MODULES}/${PRJ}/use_exact_minor_version
%/use_exact_minor_version:
%/use_exact_minor_version: | %
touch $@
endif
endif
.ORIGIN: ${INSTALL_REV}
echo '${ORIGIN}' > ${INSTALL_REV}/ORIGIN
${INSTALL_REV}:
$(MKDIR) $@
${INSTALLRULE} ${INSTALLS}
${INSTALL_DBDS}: $(notdir ${INSTALL_DBDS})