【发布时间】:2014-07-13 15:10:48
【问题描述】:
我想更改这个 Makefile:
SHELL := /bin/bash
PATH := node_modules/.bin:$(PATH)
boot:
@supervisor \
--harmony \
--watch etc,lib \
--extensions js,json \
--no-restart-on error \
lib
test:
NODE_ENV=test mocha \
--harmony \
--reporter spec \
test
clean:
@rm -rf node_modules
.PHONY: test clean
到:
SHELL := /bin/bash
PATH := node_modules/.bin:$(PATH)
boot:
@supervisor \
--harmony \
--watch etc,lib \
--extensions js,json \
--no-restart-on error \
lib
test: NODE_ENV=test
test:
mocha \
--harmony \
--reporter spec \
test
clean:
@rm -rf node_modules
.PHONY: test clean
不幸的是第二个不起作用(节点进程仍然使用默认的NODE_ENV运行。
我错过了什么?
【问题讨论】:
-
您的
Unfortunately评论源于环境变量与Makefile变量之间的误解。证明已设置环境变量的最佳方法是在make将调用的另一个程序中查询此环境变量。只做echo $(BLAH)只是评估Makefile 在Makefile 中的键/值机制。在python中可以print(os.getenv("MURDOC"))真正查询环境变量。
标签: shell makefile environment-variables target