This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Makefile rule and dependencies problem


> -----Original Message-----
> From: Jonathan Larmour [mailto:jlarmour@redhat.co.uk]
> Subject: Re: [ECOS] Makefile rule and dependencies problem
> 
> 
> Fabrice Gautier wrote:
> > 
> > Unfortunately, the two following lines:
> > 
> >         @echo $@ ':' $< '\' > $@
> >         @tail +2 $(@:.o.d=.tmp) >> $@
> > 
> > assume that the first dependency line generated by gcc 
> contains only one the
> > .c file dependency. So it would work for something like:
> > 
> > file.o : file.c \
> >         file1.h \
> >         file2.h
> > 
> > but not if the generated depends is like:
> > 
> > file.o : file.c file1.h file2.h
> > 
> > Don't know how to correct that however.
> 
> Are you saying that you have a gcc that produces dependencies 
> in this form?

Yes basically, that's what I witnessed.

In fact I used this rule for my own Makefile and for one file named os.cpp I
get the following first line :
os.o: os.cpp os.h \

So applying the rule the depend on my os.h disapear.

However I've not checked if any of the eCos file is subject to that. I think
this only occur if the filename and the first include filename are short
enough. And I think that in the eCos case this may not occur often because
the include filename are expamded to the full path and so are quite long (In
my case the "os.h" include file was in the same directory than the source
file this is why it is not expanded)

But as sometime I had to do a "clean" in order to rebuild correctly eCos,
maybe this problem is real.

> If so, which version?

$ i386-elf-gcc --version
2.95.2

(the one patched for eCos)

Thanks

-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]