似乎无法从makefile运行bat文件

时间:2017-08-17 19:22:37

标签: python windows batch-file makefile

所以我试图在makefile中自动化为我正在研究的python项目设置环境。我以前用make在linux上完成了这个,我正在尝试使用make on windows

我已经使用此软件包设置make使用chocolatey:https://chocolatey.org/packages/make

我的Makefile目标如下所示:

setup-local: ##Configures the local dev environment @virtualenv .env-$(ENVIRONMENT_NAME) -p c:\Python27\python27.exe --no-site-packages @echo "Installing requirements" @.env-local/Scripts/pip.exe install -r requirements.txt @echo "Now running .env-$(ENVIRONMENT_NAME)/Scripts/activate.bat to activate the virtual environment" activate-local: @echo "Running activate script" .env-local/Scripts/activate.bat

但我收到以下错误:

make -f MakefileWindows activate-local Running activate script .env-local/Scripts/activate.bat '.env-local' is not recognized as an internal or external command, operable program or batch file. make: *** [activate-local] Error 1

我还尝试将activate.bat脚本复制到root并运行它: @activate.bat 但它也行不通。

如果我使用该行:call .env-local\Scripts\activate.bat我收到以下错误:

process_begin: CreateProcess(NULL, call .env-local\Scripts\activate.bat, ...) failed. make (e=2): The system cannot find the file specified.

这让我觉得make无法找到可执行文件或类似的东西。

有人运气好吗?我现在想,也许make因为隔离而无法改变环境变量但是我仍然想要一些关于如何运行特定bat文件的输入

1 个答案:

答案 0 :(得分:1)

如果您只使用Windows shell命令,请尝试在Makefile的顶部添加query.orderBy(cb.asc(items.get("customerNumber")), cb.desc(documents.get("itemNumber")));

来源:http://gnu-make.2324884.n4.nabble.com/How-to-call-dos-batch-file-from-MAKE-file-td8643.html