[ipxe-devel] [PATCH] [Makefile] Make main.o depend on the git index.

Thomas Miletich thomas.miletich at gmail.com
Thu Oct 25 13:06:02 UTC 2012


This fixes the dependency issue where the version
banner was only updated if main.o was rebuilt.

Now the version banner shows the correct git version after every checkout.

Signed-off-by: Thomas Miletich <thomas.miletich at gmail.com>
---
 src/Makefile.housekeeping |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index 1e05beb..a30059f 100644
--- a/src/Makefile.housekeeping
+++ b/src/Makefile.housekeeping
@@ -650,6 +650,11 @@ $(BIN)/embedded.o : override CC := env CCACHE_DISABLE=1 $(CC)
 
 $(BIN)/clientcert.o : override CC := env CCACHE_DISABLE=1 $(CC)
 
+# Make sure the git version in the banner gets updated on every git checkout.
+ifneq ($(GITVERSION),)
+$(BIN)/main.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
 # $(eval ...), but this function exists only in GNU make >= 3.80.
-- 
1.7.5.4




More information about the ipxe-devel mailing list