Parallel build error for Blackfin target
Dave Korn
dave.korn.cygwin@googlemail.com
Tue Sep 1 07:11:00 GMT 2009
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.
cheers,
DaveK
--
(*) - or perhaps to be converted to a multiple-output pattern rule, the other
way to resolve this kind of situation and the one place where make does
understand it might generate multiple outputs from a single rule.
More information about the Binutils
mailing list