I am new to make and Makefiles, but I am trying to create it for my next project and I am facing PATH issues. I keep getting the error: "There is no such file or directory"
I created a simple target called test that runs all my tests using mocha .
Mocha is installed as a local node module, so its executable can be found in ./node_modules/.bin/mocha . I am changing my PATH as described in this tutorial , so I can refer to it as mocha , and not to enter the full path, but something does not seem to work.
Here is what I still have:
export PATH := node_modules/.bin:$(PATH) test: which mocha mocha .PHONY: test
When I run make test , I get the following output:
which mocha node_modules/.bin/mocha mocha make: mocha: No such file or directory make: *** [test] Error 1
As you can see from the output, which mocha correctly prints the path to the mocha executable, but when I just run mocha , it cannot find it.
What am I doing wrong? Is there a bigger picture about the scope or persistence variable in Make files that I skip?
PS If this is important, I use the Mac and the version of make that comes with the Xcode developer tools. This is what I get when I run make -v
GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for i386-apple-darwin11.3.0
source share