Makefile: use `find` to determine static header dependencies
commitd85b0dff7297fb43a57a0c1e697417bb7723247c
authorJeff King <peff@peff.net>
Mon, 25 Aug 2014 20:00:42 +0000 (25 16:00 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Aug 2014 21:03:07 +0000 (25 14:03 -0700)
treebeed096ff5fc40a3edff8ffa0240f50e02a19005
parent1f31963e9214e5907bc00908100d3a2902ab35dc
Makefile: use `find` to determine static header dependencies

Most modern platforms will use automatically computed header
dependencies to figure out when a C file needs rebuilt due
to a header changing. With old compilers, however, we
fallback to a static list of header files. If any of them
changes, we recompile everything. This is overly
conservative, but the best we can do on older platforms.

It is unfortunately easy for our static header list to grow
stale, as none of the regular developers make use of it.
Instead of trying to keep it up to date, let's invoke "find"
to generate the list dynamically.

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 <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile