In a make
recipe, each command is executed as a separate process, so setting an environment variable in one command will not affect the others. To do what you want, you need to make sure all the related commands run in a single instance of the shell, where environment variables are passed as you would expect:
test:
@PATH="./node_modules/api-easy/node_modules/.bin:$$PATH"; \
echo $$PATH; \
vows; \
node ./test/tests.js
The trailing backslash tells make
to concatenate a line with the one that follows it. Note also that you need to quote $
characters if you want them interpreted by the shell. Hence the $$
.