From f68b4069b1aeeeff3cef33659efd001125adcb26 Mon Sep 17 00:00:00 2001 From: Thomas Miletich Date: Fri, 2 Nov 2012 15:00:09 +0000 Subject: [build] Make version.o depend on the git index The version number string is currently updated only if version.o happens to be rebuilt due to changes in its dependencies. Add a dependency upon the git index, so that the version number is updated after any checkout. Signed-off-by: Thomas Miletich Modified-by: Michael Brown Signed-off-by: Michael Brown --- src/Makefile.housekeeping | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Makefile.housekeeping') diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index f607c4d3..d40f226f 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -659,6 +659,10 @@ CFLAGS_version += -DVERSION_MAJOR=$(VERSION_MAJOR) \ -DVERSION_MINOR=$(VERSION_MINOR) \ -DVERSION_PATCH=$(VERSION_PATCH) \ -DVERSION="\"$(VERSION)\"" +# Make sure the version number gets updated on every git checkout +ifneq ($(GITVERSION),) +$(BIN)/version.o : ../.git/index +endif # We automatically generate rules for any file mentioned in AUTO_SRCS # using the following set of templates. It would be cleaner to use -- cgit v1.2.3-55-g7522