Jie Zhang wrote:
Previously
bfin-lex.o: bfin-lex.c bfin-parse.h $(srcdir)/config/bfin-defs.h
$(COMPILE) -c $< $(NO_WERROR)
Now
bfin-lex.o: bfin-lex.c
if am__fastdepCC
$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@
bfin-lex.c $(NO_WERROR)
mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
else
if AMDEP
source='bfin-lex.c' object='$@' libtool=no @AMDEPBACKSLASH@
DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif
$(COMPILE) -c bfin-lex.c $(NO_WERROR)
endif
Should I add back "bfin-parse.h $(srcdir)/config/bfin-defs.h" as the
dependency of bfin-lex.o?
Perhaps $(srcdir)/config/bfin-defs.h should be added as a preqrequisite of
bfin-parse.c (and hence implicitly of bfin-parse.h).
Really the whole thing needs some kind of sentinel or stamp wrapped around
it(*); what we've got here is the typical "make doesn't understand when a
single rule updates more than one target at once" situation. Running the rule
for bfin-parse.c actually also creates bfin-parse.h, which is what
necessitates the not-really-true-actually dependency of bfin-parse.h on
bfin-parse.c and the corresponding "@true" build rule. See also Paul D.
Smith's Rules of Makefiles; this violates #2.