|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
auto-dependency issuesI'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 "$@" * The dependency file is generated. However, the debug output from make says that the header file (EString.h) is NEWER than the target (though it lists the dependency file - EString.d - as the target, but yet it still says that the target does not need to be rebuilt). And, the cpp file that I know depends on it (EString.cpp) is listed as NOT needing to be rebuilt - and this is listed before it indicates that the header file is NEWER. Here is the relevant section of the output: No implicit rule found for `/home/encelium/svn/LTARM1/Sources/../build/build-debug-x86/strings/EString.d'. Considering target file `EString.cpp'. Looking for an implicit rule for `EString.cpp'. Trying pattern rule with stem `EString.cpp'. Trying implicit prerequisite `EString.cpp,v'. Trying pattern rule with stem `EString.cpp'. Trying implicit prerequisite `RCS/EString.cpp,v'. Trying pattern rule with stem `EString.cpp'. Trying implicit prerequisite `RCS/EString.cpp'. Trying pattern rule with stem `EString.cpp'. Trying implicit prerequisite `s.EString.cpp'. Trying pattern rule with stem `EString.cpp'. Trying implicit prerequisite `SCCS/s.EString.cpp'. No implicit rule found for `EString.cpp'. Finished prerequisites of target file `EString.cpp'. * No need to remake target `EString.cpp'. * Pruning file `EString.h'. Pruning file `/home/encelium/svn/LTARM1/Sources/memory/MemoryPool.h'. Pruning file `/home/encelium/svn/LTARM1/Sources/debug/DBC.h'. Pruning file `/home/encelium/svn/LTARM1/Sources/datastructures/CharBuffer.h'. Pruning file `/home/encelium/svn/LTARM1/Sources/misc/Global.h'. Pruning file `/home/encelium/svn/LTARM1/Sources/misc/PackedEnum.h'. Pruning file `EStringFormatter.h'. Pruning file `/home/encelium/svn/LTARM1/Sources/third-party/trio/trio.h'. Pruning file `/home/encelium/svn/LTARM1/Sources/third-party/trio/triop.h'. Pruning file `/home/encelium/svn/LTARM1/Sources/third-party/trio/triodef.h'. Finished prerequisites of target file `/home/encelium/svn/LTARM1/Sources/../build/build-debug-x86/strings/EString.d'. Prerequisite `EString.cpp' is older than target `/home/encelium/svn/LTARM1/Sources/../build/build-debug-x86/strings/EString.d'. * Prerequisite `EString.h' is newer than target `/home/encelium/svn/LTARM1/Sources/../build/build-debug-x86/strings/EString.d'. * Prerequisite `/home/encelium/svn/LTARM1/Sources/memory/MemoryPool.h' is older than target `/home/encelium/svn/LTARM1/Sources/../build/build-debug-x86/strings/EString.d'. Prerequisite `/home/encelium/svn/LTARM1/Sources/debug/DBC.h' is older than target `/home/encelium/svn/LTARM1/Sources/../build/build-debug-x86/strings/EString.d'. Prerequisite `/home/encelium/svn/LTARM1/Sources/datastructures/CharBuffer.h' is older than target `/home/encelium/svn/LTARM1/Sources/../build/build-debug-x86/strings/EString.d'. Prerequisite `/home/encelium/svn/LTARM1/Sources/misc/Global.h' is older than target `/home/encelium/svn/LTARM1/Sources/../build/build-debug-x86/strings/EString.d'. Prerequisite `/home/encelium/svn/LTARM1/Sources/misc/PackedEnum.h' is older than target `/home/encelium/svn/LTARM1/Sources/../build/build-debug-x86/strings/EString.d'. Prerequisite `EStringFormatter.h' is older than target `/home/encelium/svn/LTARM1/Sources/../build/build-debug-x86/strings/EString.d'. Prerequisite `/home/encelium/svn/LTARM1/Sources/third-party/trio/trio.h' is older than target `/home/encelium/svn/LTARM1/Sources/../build/build-debug-x86/strings/EString.d'. Prerequisite `/home/encelium/svn/LTARM1/Sources/third-party/trio/triop.h' is older than target `/home/encelium/svn/LTARM1/Sources/../build/build-debug-x86/strings/EString.d'. Prerequisite `/home/encelium/svn/LTARM1/Sources/third-party/trio/triodef.h' is older than target `/home/encelium/svn/LTARM1/Sources/../build/build-debug-x86/strings/EString.d'. No commands for `/home/encelium/svn/LTARM1/Sources/../build/build-debug-x86/strings/EString.d' and no prerequisites actually changed. * No need to remake target `/home/encelium/svn/LTARM1/Sources/../build/build-debug-x86/strings/EString.d'. * ** Thanks _______________________________________________ Help-make mailing list Help-make@... https://lists.gnu.org/mailman/listinfo/help-make |
|
|
Re: auto-dependency issuesOn 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 _______________________________________________ Help-make mailing list Help-make@... https://lists.gnu.org/mailman/listinfo/help-make |
| Free embeddable forum powered by Nabble | Forum Help |