Header file dependencies


















Makefile fragment: depend:. Improve this answer. I like this trick, but how can I get depend to run only when the source files have changed? It seems to run every time regardless That's what I get for typing from memory.

Try it now. Is it way to add before every file some prefix to show that it is in another directory e. That seemed to prevent depend from running every time and also caught changes to the header files only. This seems counter to the previous comments.. Show 1 more comment. Community Bot 1 1 1 silver badge. Sophie Sophie 1, 7 7 silver badges 12 12 bronze badges. Thanks ctrucza, should be fixed now. Out of the box, this failed to locate the headers for me even though hpp and cpp are both on the same dir.

Great answer. As a very very minor and slightly off-topic! Show 2 more comments. Martin Fido Martin Fido 1, 11 11 silver badges 12 12 bronze badges. When I try this it results in all of my. Using -MT will resolve the note in the last lines of your answer which updates the target of each dependency list. You need -MMD instead: stackoverflow.

Remove From My Forums. Answered by:. Archived Forums. Visual C. Sign in to vote. Saturday, March 10, AM. If you want to include afx. Directly from the gcc documentation :. We can take a look at the output of the preprocessor stage when compiling our main. This is the code the compiler actually has to compile. Note that also the content of file d. Now you might also take a look at the output of gcc -E main. The preprocessor has to open , read , preprocess and parse all direct and indirect include dependencies for every file to compile!

Notify me of new comments via email. Notify me of new posts via email. This causes a few problems. Share this: Email Tweet. Like this: Like Loading Leave a Reply Cancel reply Enter your comment here Fill in your details below or click an icon to log in:.

Email required Address never made public.



0コメント

  • 1000 / 1000