|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
"generating prerequisites automatically" causes all *.d makefiles to be regenerated?Hello, There seems to be a problem however with this
approach. I write “seems” because it must be that I don’t
understand something, as I am sure the GNU Make manual recommends the “right
thing”. Please help me understand what I am missing. The problem I have is: when I do >make foobar.o make then tries to generate all these *.d files, all of them
– not just the one that is needed foobar.d ! That is not good –takes
a lot of time if I just want one foobar.o. Also, what is worse, if I do >make clean Then again, all the *.d files are generated first, takes a
very long time, before everything is deleted. How to do it so that only the *.d files that are really
needed are generated, and none are generated on make clean? Thank you for any insight, Mark _______________________________________________ Help-make mailing list Help-make@... http://lists.gnu.org/mailman/listinfo/help-make |
|
|
Re: "generating prerequisites automatically" causes all *.d makefiles to be regenerated?On Mon, Oct 19, 2009 at 10:43 AM, Mark Galeck (CW) <mgaleck@...> wrote:
i think the general workaround for that is to skip generation when clean is running: ifneq (,$(strip $(filter distclean clean,$(MAKECMDGOALS))))
# $(warning Skipping C/C++ deps generation.) ... else ... endif but the placement depends on how your rules are structured (and is easier if you generate only one dep file, though that has other problems compared to .d files).
----- stephan beal http://wanderinghorse.net/home/stephan/ _______________________________________________ Help-make mailing list Help-make@... http://lists.gnu.org/mailman/listinfo/help-make |
|
|
Re: "generating prerequisites automatically" causes all *.d makefiles to be regenerated?Mark,
Unfortunately the GNU Make manual does not recommend the "right thing". The trick is that you should build the dependencies when you run the compile. They are only needed for the next compile anyway, not the current. Make knew it needed to build foobar.o since it didn't exist. It is only on the next run that it needs the dependency generation. See http://make.paulandlesley.org/autodep.html for details on how to really do the "right thing". -Pete On Oct 19, 2009, at 1:43 AM, Mark Galeck (CW) wrote: > Hello, > > I read and implemented the guidelines in the section of the GNU Make > manual “4.14 Generating Prerequisities Automatically”. It works > great, for each C source file, I have a corresponding .d file, which > is also a makefile, generated, and all those makefiles are included > in the main makefile with the “include” directive. In the .d file > are header file dependencies for that particular C file. > > There seems to be a problem however with this approach. I write > “seems” because it must be that I don’t understand something, as I > am sure the GNU Make manual recommends the “right thing”. Please > help me understand what I am missing. > > > > The problem I have is: when I do > >make foobar.o > > make then tries to generate all these *.d files, all of them – not > just the one that is needed foobar.d ! That is not good –takes a > lot of time if I just want one foobar.o. Also, what is worse, > if I do > > >make clean > > Then again, all the *.d files are generated first, takes a very long > time, before everything is deleted. > > > How to do it so that only the *.d files that are really needed are > generated, and none are generated on make clean? > > Thank you for any insight, > > Mark > _______________________________________________ > Help-make mailing list > Help-make@... > http://lists.gnu.org/mailman/listinfo/help-make _______________________________________________ Help-make mailing list Help-make@... http://lists.gnu.org/mailman/listinfo/help-make |
| Free embeddable forum powered by Nabble | Forum Help |