Dan,

Are you actually including the generated dependencies in your Makefile using 
-include?

-Pete

On Mar 9, 2011, at 4:12 PM, 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
> 
> 
> a.o : a.cpp
>          @gcc -MD -c a.cpp; \
>            cp $*.d $*.P; \
>            sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
>                -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
>            rm -f $*.d
>          gcc -c a.cpp -o a.o
> 
> 
> here the command works the first time fine.  Then I change the
> header a.h and run make again and it says nothing needs to be done.
> 
> Dan
> 
> 
> 
> 
> 
> _______________________________________________
> Help-make mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/help-make


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to