Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:02:20

Jeff King [off-list ref] writes:
Since we do not use the value $(LIB_H) unless either
COMPUTE_HEADER_DEPENDENCIES is turned on or the user is
building "po/git.pot" (where it comes in via $(LOCALIZED_C),
make is smart enough to not even run this "find" in most
cases. However, we do need to stop using the "immediate"
variable assignment ":=" for $(LOCALIZED_C). That's OK,
because it was not otherwise useful here.

Signed-off-by: Jeff King <redacted>
---
I cannot see any reason for the ":=", but maybe I am missing something.
If the right-hand-side were something like $(shell find ...) that
was heavy-weight then it might have made sense, but I do not think
it is that.  It has stayed to be := ever since it was introduced by
cd5513a7 (i18n: Makefile: "pot" target to extract messages marked
for translation, 2011-02-22).

And now you use LIB_H only once ;-).

Also interestingly, I notice that it is very clear that it is not
"LIB_H" but "ANY_H" ;-)
quoted hunk
 Makefile | 140 ++++-----------------------------------------------------------
 1 file changed, 8 insertions(+), 132 deletions(-)
diff --git a/Makefile b/Makefile
index cf0ccdf..f2b85c9 100644
--- a/Makefile
+++ b/Makefile
...
@@ -2128,9 +2004,9 @@ XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \
 XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \
 	--keyword=gettextln --keyword=eval_gettextln
 XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --keyword=__ --language=Perl
-LOCALIZED_C := $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
-LOCALIZED_SH := $(SCRIPT_SH)
-LOCALIZED_PERL := $(SCRIPT_PERL)
+LOCALIZED_C = $(C_OBJ:o=c) $(GENERATED_H)
+LOCALIZED_SH = $(SCRIPT_SH)
+LOCALIZED_PERL = $(SCRIPT_PERL)
 
 ifdef XGETTEXT_INCLUDE_TESTS
 LOCALIZED_C += t/t0200/test.c

Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

From: Jeff King <hidden>
Date: 2016-06-15 23:02:20

On Mon, Aug 25, 2014 at 12:30:51PM -0700, Junio C Hamano wrote:
Also interestingly, I notice that it is very clear that it is not
"LIB_H" but "ANY_H" ;-)
Yeah, it has been that way for quite a while. I don't know if it is that
big a deal, but it would not be unreasonable to do a patch to rename on
top (I am not sure what the new one would be; ANY_H is probably OK).

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help