In my makefile, I have a:
include .depend
I also have a
depend:
rules for buiding .depend
Now, here is the problem, when ".depend" does not exist, I can't run "make depend"; I have to do "touch .depend; make depend"
Is there anyway to tell Make "if .depend does not exi开发者_StackOverflowst, still allow me to run 'make depend'" ?
Thanks!
I assume you mean that you can't run "make depend" because Make balks at trying to include a file that doesn't exist. If you're using GNUMake you can use -include:
-include .depend
This will include the file if it exists, but continue without error if it doesn't.
(I've heard that sinclude does the same thing in some other versions of Make.)
精彩评论