Windows 相当于此 Makefile
编写 Makefile 的优点是“make”通常被假定存在于各种 Unices 上(主要是 Linux 和 Mac)。
现在我有以下 Makefile:
PYTHON := python
all: e installdeps
e:
virtualenv --distribute --python=${PYTHON} e
installdeps:
e/bin/python setup.py develop
e/bin/pip install unittest2
test:
e/bin/unit2 discover
clean:
rm -rf e
正如您所看到的,该 Makefile 使用简单的目标和变量替换。在 Windows 上可以实现吗?通过这种方式 - 无需安装外部工具(如 cygwin make);也许是make.cmd?例如,输入“make installdeps”应该可以在 Unix 和 Windows 上运行。
The advantage of writing a Makefile is that "make" is generally assumed to be present on the various Unices (Linux and Mac primarily).
Now I have the following Makefile:
PYTHON := python
all: e installdeps
e:
virtualenv --distribute --python=${PYTHON} e
installdeps:
e/bin/python setup.py develop
e/bin/pip install unittest2
test:
e/bin/unit2 discover
clean:
rm -rf e
As you can see this Makefile uses simple targets and variable substitution. Can this be achieved on Windows? By that mean - without having to install external tools (like cygwin make); perhaps make.cmd? Typing "make installdeps" for instance, should work both on Unix and Windows.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就这样简单的事情,是的。但是,如果您想继续改进该 makefile,您可能会考虑以更可移植的语言编写“makefile”(而不是安装脚本)。你必须有一些假设。如果它是一个 python 项目,我确信你假设已经安装了 python。因此,在 python 中编写与 makefile 等效的内容。
Something simple like that, yes. However, if you'd like to continue to improve that makefile, you might consider just writing the "makefile" (rather installation script) in a more portable language. You have to have some assumptions. If its a python project, I'm sure you assume python is installed. So write the equivalent of your makefile in python.