help-make
[Top][All Lists]
Advanced

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

Re: auto-dependency issues


From: Greg Chicares
Subject: Re: auto-dependency issues
Date: Thu, 17 May 2012 15:54:25 +0000
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

On 2012-05-17 14:50Z, Leo wrote:
> I'm having an issue wherby changes to header files are not causing the cpp
> files that depend on them to be rebuilt.  I'm using gnu make auto
> dependencies.  Here is my build rule:
> 
> *$(OUTPUTDIR)/%.o: %.cpp
>     $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c "$<" -MMD -MP -MF"$(@:%.o=%.d)"
> -MT"$(@:%.o=%.d)" -o "$@"
> *

'-MT' should be followed by the '.o' name, not the '.d' name.
Instead of
  -MT"$(@:%.o=%.d)"
try
  -MT $@

http://gcc.gnu.org/onlinedocs/cpp/Invocation.html
| -MT target
| Change the target of the rule emitted by dependency generation.
| By default CPP takes the name of the main input file, deletes any
| directory components and any file suffix such as `.c', and appends
| the platform's usual object suffix. ...
| For example, -MT '$(objpfx)foo.o' might give
|   $(objpfx)foo.o: foo.c



reply via email to

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