summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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