This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Parallel build error for Blackfin target
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: Jie Zhang <jie dot zhang at analog dot com>
- Cc: Ralf dot Wildenhues at gmx dot de, binutils at sourceware dot org
- Date: Tue, 01 Sep 2009 08:25:10 +0100
- Subject: Re: Parallel build error for Blackfin target
- References: <4A9CC410.7060301@analog.com>
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.