Skip to content
Snippets Groups Projects
Commit 50f4bb3c authored by Adam Knapp's avatar Adam Knapp
Browse files

Revising common/Makefile (issue #561, epic &29)


Signed-off-by: default avatarAdam Knapp <adam.knapp@ericsson.com>
parent 79d52ad9
No related branches found
No related tags found
1 merge request!194Revising common/Makefile (issue #561, epic &29)
......@@ -27,24 +27,16 @@ TOP := ..
include $(TOP)/Makefile.cfg
# Generating git_version.c according to GIT_COMMIT_ID
ifeq ($(GIT_COMMIT_ID), yes)
$(shell echo -e "// this file was generated by make\n#include \"version_internal.h\"\n\nchar const *const GIT_COMMIT_ID = \"$$(git describe --always --dirty --match 'NOT A TAG')\";" > git_version.c.tmp; \
if [ ! -f git_version.c.tmp ]; then \
echo -e "// this file was generated by make\n#include \"version_internal.h\"\n\nchar const *const GIT_COMMIT_ID = \"\";" > git_version.c.tmp; \
fi; \
if diff -q git_version.c.tmp git_version.c >/dev/null 2>&1; then \
rm git_version.c.tmp; \
else \
mv git_version.c.tmp git_version.c; \
fi)
else
$(shell echo -e "// this file was generated by make\n#include \"version_internal.h\"\n\nchar const *const GIT_COMMIT_ID = \"\";" > git_version.c.tmp; \
if diff -q git_version.c.tmp git_version.c >/dev/null 2>&1; then \
rm git_version.c.tmp; \
else \
mv git_version.c.tmp git_version.c; \
fi)
GIT_HASH=`git describe --always --dirty --match 'NOT A TAG'`
ifeq ($(GIT_COMMIT_ID), no)
GIT_HASH=""
endif
$(shell printf "// this file was generated by make\n#include \"version_internal.h\"\n\nchar const *const GIT_COMMIT_ID = \"${GIT_HASH}\";" > git_version.c.tmp)
$(shell if diff -q git_version.c.tmp git_version.c >/dev/null 2>&1; then \
rm git_version.c.tmp; \
else \
mv git_version.c.tmp git_version.c; \
fi)
TARGETS :=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment