开发者

Windows equivalent to this Makefile

开发者 https://www.devze.com 2022-12-28 22:45 出处:网络
The advantage of writing a Makefile is that \"make\" is generally assumed to be present on the various Unices (Linux and Mac primarily).

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:
      开发者_如何学JAVA  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.


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.

0

精彩评论

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