help-make
[Top][All Lists]
Advanced

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

Re: autodependencies


From: Galen Seitz
Subject: Re: autodependencies
Date: Wed, 09 Mar 2011 17:05:28 -0800
User-agent: Thunderbird 2.0.0.24 (X11/20101213)

Dan Kujovich wrote:
I am trying to get my dependencies working for obvious reasons.  But when I try 
what has been offered, it lacks the primary goal of recompiling objects when 
any of the dependencies (header files) change.

I like the gcc -MD command as it provides the proper dependencies, but I am 
having trouble having my make file actually be able to use it.  Here is an 
example of what I am grabbing from paulandlesley.org/autodep.html

I assume you are actually looking at http://make.mad-scientist.us/autodep.html

In contrast to Mark's response, I had very little trouble incorporating Paul's autodep and multi-architecture suggestions into my build process. The rule you posted is very similar to what I use. In my case the source code is C, not C++.

%$(O) : %$(C)
        $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -MD -o $@ $<
        @cp $*.d $*.P; \
        sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
                -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
        rm -f $*.d


Did you look at the dependency file that was generated? Does it look correct? Did you remember to include it in the Makefile?

-include $(SRCS:.c=.P)


galen
--
Galen Seitz
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]