From 79e62f898f4923150caba5f30207eee85d6dfb9b Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 6 Jan 2019 09:45:14 -0500 Subject: project: added rule for generation of (and dependency on) version.h. --- project/extras.mk | 2 ++ project/headers.mk | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'project') 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 -- cgit v1.2.3