AtomBuild / atom-build-make

GNU Make plugin for atom-build
MIT License
13 stars 19 forks source link

Incorrect handling of spaces before colon in rules — "make: *** No rule to make target `clean '. Stop." #38

Open chambost opened 7 years ago

chambost commented 7 years ago

Makefile Rule syntax allows a space before the colon that separates targets and prerequisites [0].

e.g. targets : prerequisites

However this causes problems for atom-build-make. Specifically the build target window (accessible by the F7 keystroke) does not handle this correctly. (This feature interacts with the underlying noseglid/build-make code).

This can be tested with a "clean" target.

When a space exists between "clean" and the colon ("clean :"), the make build will fail with the following error (use F7 to select "clean ", then build).

"make: *** No rule to make target `clean '. Stop."

(Note the space in the target name of the error output).

When the space is removed ("clean:") from the Makefile, then the F7 select build target window chooses the correct target name without spaces and the build completes successfully.

(On my system, Atom needs to be restarted between making these changes … possibly because build-make is caching the target names despite the manual change in spacing).

[0] https://www.gnu.org/software/make/manual/html_node/Rule-Syntax.html#Rule-Syntax

chambost commented 7 years ago

For contrast the underlying POSIX make standard [1], does not use any such spaces in their examples. And their rule syntax notation implies no-spaces is correct (although seems slightly ambiguous):

target [target...]: [prerequisite...][;command]
[<tab>command<tab>command...]

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html