summaryrefslogtreecommitdiffhomepage
path: root/project
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-01-06 09:45:14 -0500
committermidipix <writeonce@midipix.org>2019-01-09 22:43:14 -0500
commit79e62f898f4923150caba5f30207eee85d6dfb9b (patch)
treecac57e7d9807569b5fc6a6a62786701ab260e2a0 /project
parent3a6f4c4376eba5d20038331a1a8f147cee8d9d2a (diff)
downloadmmglue-79e62f898f4923150caba5f30207eee85d6dfb9b.tar.bz2
mmglue-79e62f898f4923150caba5f30207eee85d6dfb9b.tar.xz
project: added rule for generation of (and dependency on) version.h.
Diffstat (limited to 'project')
-rw-r--r--project/extras.mk2
-rw-r--r--project/headers.mk7
2 files changed, 9 insertions, 0 deletions
diff --git a/project/extras.mk b/project/extras.mk
index e69de29..80ac425 100644
--- a/project/extras.mk
+++ b/project/extras.mk
@@ -0,0 +1,2 @@
+./src/internal/version.o: build/version.h
+./src/internal/version.lo: build/version.h
diff --git a/project/headers.mk b/project/headers.mk
index d254dc0..14fbfbc 100644
--- a/project/headers.mk
+++ b/project/headers.mk
@@ -1,3 +1,9 @@
+# build/version.h
+build/version.h:$(SOURCE_DIR)/VERSION $(SOURCE_DIR)/.git/index
+ mkdir -p build
+ printf '#define VERSION "%s"\n' \
+ "$$(cd $(SOURCE_DIR); $(SHELL) ./tools/version.sh)" > $@
+
# alltypes.h, syscall.h
build/include/bits/:
mkdir -p $@
@@ -93,6 +99,7 @@ build/headers.tag: $(ARCH_HEADERS)
clean-headers:
rm -f $(src_bits_h)
rm -f $(SYSCALL_H).tmp
+ rm -f build/version.h
rmdir build/include/bits 2>/dev/null || true
rmdir build/include 2>/dev/null || true
rm -f build/headers.tag