diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2010-02-28 03:11:55 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-02-28 10:58:50 -0800 |
commit | 5b8805e75cd54439e2b0208e9512420794bc1ecd (patch) | |
tree | 2ae4728203fe0d76469744d20ed6843f835ac080 /t/t7508-status.sh | |
parent | Makefile: always remove .depend directories on 'make clean' (diff) | |
download | tgif-5b8805e75cd54439e2b0208e9512420794bc1ecd.tar.xz |
Makefile: clarify definition of TEST_OBJS
The definition of TEST_OBJS in commit daa99a91 (Makefile: make sure
test helpers are rebuilt when headers change, 2010-01-26) moved a use
of $X to before the platform-specific section where it gets defined.
There are at least two ways to fix that:
- Change the definition of TEST_OBJS to use the = delayed
evaluation operator. This way, one need not worry about $(X)
needing to be defined before TEST_OBJS is set.
- Move the definition of TEST_OBJS to below the definition of $X.
Carry out the second. The later site of definition makes the code more
readable, since now a reader only has to look down one line to see what
TEST_OBJS is meant to be used for.
Oddly enough, with or without this change the behavior of the Makefile
is the same. Since TEST_PROGRAMS is defined with delayed evaluation,
the value of
TEST_OBJS := $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
is independent of the value of $X when it is evaluated: the $X in the
pattern and the $X in $(TEST_PROGRAMS) will simply always cancel out.
Make sure $X has the expected expansion anyway to make the code and
the reader’s sanity more robust in the face of future changes.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7508-status.sh')
0 files changed, 0 insertions, 0 deletions