Reputation: 12269
Snippet 1:
define HELP_TEXT
This is the help text.
endef
.PHONY: help
help:
@echo $(HELP_TEXT)
Test:
$ make help
This is the help text.
$
Snippet 2:
define HELP_TEXT =
This is the help text.
endef
.PHONY: help
help:
@echo $(HELP_TEXT)
Test:
$ make help
$
What is going on here? According to the documentation there should be no difference in behaviour between both syntaxes.
NOTE: My GNU Make version is 3.81.
Upvotes: 0
Views: 33
Reputation: 33719
The NEWS file for version 3.82 (28 Jul 2010) mentions this:
- The
define
make directive now allows a variable assignment operator after the variable name, to allow for simple, conditional, or appending multi-line variable assignment.
So it's simply a feature not present in GNU make 3.81. In fact, in earlier make versions, the variable is called HELP_TEXT =
, as can be seen if you try this:
define HELP_TEXT =
This is the help text.
endef
.PHONY: help
help:
@echo $(HELP_TEXT =)
Upvotes: 1