diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2010-03-19 22:20:12 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-03-20 08:28:16 -0700 |
commit | a673cfede6987ee815de9189eab054fc462e5c9f (patch) | |
tree | a6c62e6c48968db034084714101ed6abf97b0791 /t/t9603 | |
parent | notes.c: remove inappropriate call to return (diff) | |
download | tgif-a673cfede6987ee815de9189eab054fc462e5c9f.tar.xz |
Makefile: Fix occasional GIT-CFLAGS breakage
GNU make’s target-specific variables facility has one weird facet: any
variables set for a given target apply to all of its dependencies,
too. For example, when running “make exec_cmd.o”, since exec_cmd.o
depends on GIT-CFLAGS, the variable assignment in
exec_cmd.s exec_cmd.o: ALL_CFLAGS += \
'-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
'-DBINDIR="$(bindir_relative_SQ)"' \
'-DPREFIX="$(prefix_SQ)"'
applies when refreshing GIT-CFLAGS, and the extra options get included
in the tracked compiler flags. If an object file like this is the
first target built, GIT-CFLAGS will appear to be out of date,
resulting in useless rebuilds and the dreaded “new build flags or
prefix” message.
This does not happen with every build because GIT-CFLAGS is only
refreshed once in a given “make” run, and usually the first target
does not set any variables. When this problem does rear its head, it
is very annoying.
So put target-specific flags in a separate EXTRA_CPPFLAGS variable
that is not included in $(TRACK_CFLAGS).
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9603')
0 files changed, 0 insertions, 0 deletions