在Linux上的Makefile和Makefile之间选择 [英] Choose between makefile and Makefile on Linux
本文介绍了在Linux上的Makefile和Makefile之间选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在同时带有Makefile和Makefile的目录中进行制作.默认情况下,它将执行makefile.我有什么办法可以代替执行Makefile吗?
I want to do a make in a directory with both Makefile and makefile. By default, it will execute makefile. Is there any options I can do to execute the Makefile instead?
先谢谢了.
推荐答案
简单的选择是使用 -f
:
$ make -f Makefile
来自 man 1 make
(我想是GNU make):
From man 1 make
(the GNU make, I presume):
如果不存在
-f
选项,make会查找GNUmakefile , makefile
和Makefile
,按此顺序.
If no
-f
option is present, make will look for the makefilesGNUmakefile
,makefile
, andMakefile
, in that order.
因此,您将 Makefile 链接到名称 GNUmakefile.但是我的建议是,如果您真的想要这个,请使用别名:
So you con link your Makefile to the name GNUmakefile. But my advise, if you really want this, is to use an alias:
$ alias make='make -f Makefile'
这篇关于在Linux上的Makefile和Makefile之间选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文