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 Mon, Nov 11, 2002 at 06:21:23AM +0100, Robert Schiele wrote:
> On Sun, Nov 10, 2002 at 09:44:35PM +0000, Philip Armstrong wrote:
> > What you need is a set of make rules like the following:
> 
> You don't.
> 
> > include $(patsubst %.o:%.dep,$(OBJS))
> 
> What do you think the "-include $(wildcard *.d) dummy" is for?

Implicit rule? Don't think that'll work for us -- we like to have the
dependency files kept separately from the source files so we can use
the same sources to build on about 6 platforms when developing -- all
the generated files are placed in local scratch directories.

If you can tell me what I have to do to prod make into looking in said
directory as well as in the same place as the source files for things
like dependencies then you'll be telling me something useful! Perhaps
a simple --include argument to make would suffice? (although something
in the makefile itself would be better)

> > $(BUILD)/%.d : %.c
> > 	     gcc -MM -MG $< | sed -e "1s@^\([^ ]*\)\.o:@$(BUILD)/\1.d $(BUILD)/\1.o:@" > $(BUILD)/$(@F)
> 
> What do you think the -MD flag to gcc is for?

It doesn't put the dependency file in -- the dependency file itself
sould depend on the same things that the object file does, otherwise
the dependency file will always be out of date and potentially wrong
-- it will reflect the dependencies at the time of the last
compilation, not the dependencies of the current state of the sources.

The sed command above makes something like

  foo.o: foo.c foo.h

look like

  foo.d foo.o : foo.c foo.h

So that the dependencies are always current (gnu make always updates
all makefiles {like the .d files} first before doing anything else).

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