summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-05-07 10:11:54 -0400
committermidipix <writeonce@midipix.org>2016-09-21 19:45:53 -0400
commit352a46c4e9f480860c281570ae886794cd35a552 (patch)
tree8933f00acd0ecd50e7c4449a48a88caedbeede0d
parent99b1a6b8aa006eebd9550d156d6ff9f4501a5966 (diff)
downloadbcparser-352a46c4e9f480860c281570ae886794cd35a552.tar.bz2
bcparser-352a46c4e9f480860c281570ae886794cd35a552.tar.xz
build system: git version: integrated cparser_version.h, CPARSER_GIT_VERSION.
-rw-r--r--project/extras.mk3
-rw-r--r--project/revision.h18
-rw-r--r--project/tagver.mk15
3 files changed, 36 insertions, 0 deletions
diff --git a/project/extras.mk b/project/extras.mk
index c0415f8..e878dc0 100644
--- a/project/extras.mk
+++ b/project/extras.mk
@@ -6,6 +6,9 @@ CFLAGS_PATH += -I$(PROJECT_DIR)/include/cparser/firm
CFLAGS_PATH += -I$(PROJECT_DIR)/include/cparser/parser
CFLAGS_PATH += -I$(PROJECT_DIR)/include/cparser/wrappergen
+src/driver/actions.o: version.tag
+src/driver/actions.lo: version.tag
+
install-headers-custom:
mkdir -p $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)
mkdir -p $(DESTDIR)$(INCLUDEDIR)/$(PACKAGE)/adt
diff --git a/project/revision.h b/project/revision.h
new file mode 100644
index 0000000..f03f656
--- /dev/null
+++ b/project/revision.h
@@ -0,0 +1,18 @@
+#include "cparser_version.h"
+
+#ifndef CPARSER_THREAD
+#define CPARSER_THREAD
+#endif
+
+static CPARSER_THREAD char cparser_revision_buffer[64] = {0};
+
+static inline char * cparser_revision()
+{
+ if (strcmp(CPARSER_GIT_VERSION,"unknown"))
+ sprintf(cparser_revision_buffer,"%s-dirty",
+ CPARSER_GIT_VERSION);
+
+ return cparser_revision_buffer;
+}
+
+#define cparser_REVISION cparser_revision()
diff --git a/project/tagver.mk b/project/tagver.mk
index 3af5070..2be8a23 100644
--- a/project/tagver.mk
+++ b/project/tagver.mk
@@ -3,3 +3,18 @@ VER_NAMESPACE = CPARSER
VER_MAJOR = 0
VER_MINOR = 0
VER_PATCH = 0
+
+
+revision.tag: $(PROJECT_DIR)/project/revision.h
+ mkdir -p build
+ cp $(PROJECT_DIR)/project/revision.h build
+ touch revision.tag
+
+version.tag: revision.tag
+
+
+clean-revision:
+ rm -f build/revision.h
+ rm -f revision.tag
+
+clean: clean-revision