开发者

Makefile include .depend

开发者 https://www.devze.com 2022-12-21 14:24 出处:网络
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 \

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.)

0

精彩评论

暂无评论...
验证码 换一张
取 消