Thread (49 messages) flat view 49 messages, 4 authors, 2016-06-15

Re: [PATCHv2 1/8] Makefile: apply dependencies consistently to sparse/asm targets

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:54:08

Possibly related (same subject, not in this thread)

Hi,

Jeff King wrote:
When a C file includes a header file or depends on a
command-line "-D" macro, we note it in the Makefile like:

  git.o: common-cmds.h

However, other targets built from the C file should also
know about this dependency (in particular, .sp and .s files
that are not part of the usual build process). We sometimes
noted these and sometimes not; let's make sure they are
always included.
First reactions:

This improves consistency.  Yay!

Making .sp and .s targets depend on generated .h files like
common-cmds.h is very important.  Otherwise, I would not be able to
generate my git.s assembler listing or sparse-check git.c unless
common-cmds.h has already been generated as a side-effect of some
earlier build process.

On the other hand, making .sp and .s targets depend on preexisting .h
files and files like GIT-CFLAGS would not have any effect at all,
because:

 - .sp targets are phony --- there is no stamp file that certifies
   a given file has been checked by a "make sparse" run.  Maybe that
   will change some day.

 - .s targets are rebuilt every time.  Maybe I am just weird, but I
   find myself upgrading my compiler pretty often, so when I manually
   ask for an assembler listing I am happy to see it regenerated
   unconditionally using the new code generation rules.

It turns out that this patch is only about common-cmds.h, which was
the straightforward case.  Why not say so and save the reader from
having to think so hard? ;)

Hope that helps,
Jonathan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help