一个目录中有多个makefile [英] multiple makefiles in one directory
本文介绍了一个目录中有多个makefile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的目录中有一个makefile,该文件构建具有某些环境变量集的脚本.如果我想在设置了不同环境变量的同一目录中创建另一个makefile,该怎么办?我应该如何命名这两个make文件? makefile.1
和makefile.2
是否起作用?我怎么称呼他们?
I have a makefile in a directory of mine which builds scripts with certain environment variables set. What if I want to create another makefile in the same directory with different environment variables set? How should I name the two make files? Does makefile.1
and makefile.2
work? How do I call them?
推荐答案
您可以给诸如makefile.win和makefile.nix之类的文件命名,并使用它们:
You can give sensible names to the files like makefile.win and makefile.nix and use them:
make -f makefile.win
make -f makefile.nix
或有一个包含以下内容的Makefile:
or have a Makefile that contains:
win:
make -f makefile.win
nix:
make -f makefile.nix
并使用make win
或make nix
这篇关于一个目录中有多个makefile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文