Parallel build error for Blackfin target

Jie Zhang jie.zhang@analog.com
Tue Sep 1 08:29:00 GMT 2009


Dave Korn wrote:
> 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.
> 
The corresponding "@true" build rules are wrong here! They are

bfin-defs.h: ; @true
$(srcdir)/config/bfin-defs.h: ; @true

They should be

bfin-parse.h: ; @true
$(srcdir)/config/bfin-parse.h: ; @true

With this change, the bfin-* targets build well for me now. I'll make a 
patch and send out for approve soon.

Thanks!


Jie



More information about the Binutils mailing list