Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: AW: Re: Driver 2002-11-08 problems



On Sat, Nov 09, 2002 at 12:04:37AM +0100, Robert Schiele wrote:
> On Fri, Nov 08, 2002 at 11:55:30PM +0100, Florian Schirmer wrote:
> > Hi,
> > 
> > >>>1. Doesn't adding -MD to the extra flags is enough to make the 
> > >>>dependencys work? At least with gcc 3.1 (haven't tried any version
> > >>>below) it seems to work pretty well without any include changes to 
> > >>>the Makefile.
> > 
> > >No.  How do you expect make to _use_ these dependencies when you didn't
> > inlcude them?
> > 
> > I dont expect make to use them, i expect gcc itself to make use of it.
> 
> You didn't understand how make works.  You should read the manual.
> 
> > Since for generation the dep file it has to look at all the includes
> > files, so gcc will detected the changes itself, without any help from
> > make. I've not verified this and i dont care about it very much. I just
> > can tell you: it just works :D
> 
> This is not possible.  gcc is not invoked, when no failed dependencies
> are detected by make, because of that gcc _cannot_ make any use of
> dependencies.

What you need is a set of make rules like the following:

include $(patsubst %.o:%.dep,$(OBJS))

$(BUILD)/%.d : %.c
	     gcc -MM -MG $< | sed -e "1s@^\([^ ]*\)\.o:@$(BUILD)/\1.d $(BUILD)/\1.o:@" > $(BUILD)/$(@F)

which should sort out including the dependencies into the Makefile and
regenerating them when necessary.

Slightly hacked from a work makefile. $(BUILD) is the directory where
the object and dependency files end up, and $(OBJS) is a set of object
file names, including the $(BUILD) prefix. Hack about to your heart's
content :)

nb. Untested code -- I've cut out a few (hopefully) irrelevant work
specific bits. The above is probably gnu make specific.

cheers,

Phil


-- 
http://www.kantaka.co.uk/ .oOo. public key: http://www.kantaka.co.uk/gpg.txt



-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index