mirror of
https://github.com/simh/simh.git
synced 2026-03-05 02:45:19 +00:00
makefile: Add support for proper display of commit id when used as a submodule
This commit is contained in:
6
makefile
6
makefile
@@ -755,6 +755,12 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
|
||||
else
|
||||
ifeq (,$(shell grep 'define SIM_GIT_COMMIT_ID' sim_rev.h | grep 'Format:'))
|
||||
GIT_COMMIT_ID=$(shell grep 'define SIM_GIT_COMMIT_ID' sim_rev.h | awk '{ print $$3 }')
|
||||
else
|
||||
ifeq (git-submodule,$(shell if $(TEST) -d ../.git; then echo git-submodule; fi))
|
||||
ifeq (submodule,$(shell grep 'submodule "simh"' ../.gitmodules | awk 'BEGIN { FS = " " } ; { print $$1 }' | awk 'BEGIN { FS = "\[" } ; { print $$2 }'))
|
||||
GIT_COMMIT_ID=$(shell cd .. ; git submodule status | grep simh | awk '{ print $$1 }')
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user