]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Make version.o depend on the git index
authorThomas Miletich <thomas.miletich@gmail.com>
Fri, 2 Nov 2012 15:00:09 +0000 (15:00 +0000)
committerMichael Brown <mcb30@ipxe.org>
Fri, 2 Nov 2012 15:00:09 +0000 (15:00 +0000)
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 <thomas.miletich@gmail.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/Makefile.housekeeping

index f607c4d301582a5b16743ee1f4cdf47842dc2d73..d40f226f684761c5572977b0bd7c057a95c6ec78 100644 (file)
@@ -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