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

Thomas Miletich thomas.miletich at gmail.com
Thu Oct 25 13:08:30 UTC 2012


Please note that I'm actually not sure if it's OK to simply use the
path "../.git/index", even though I can't think of a case where the
path would be different.

On Thu, Oct 25, 2012 at 3:06 PM, Thomas Miletich
<thomas.miletich at gmail.com> wrote:
> 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