I’m trying to use define in GNU make. Running make on this test Makefile echoes “dummy”:
define FOO =
$$(error foo $(1))
endef
$(eval $(call FOO,bar))
all:
@echo dummy
If I remove the =, then it errors with foo bar as I intended.
The GNU make manual has all the define examples using the form with the equals sign present. Why does that seem to be ignored for me?
definewith assignment was introduced in GNU Make 3.82, most likely that you’re using an older version.However, in the recent version
define foo =is the same as plaindefine foo, just use the latter to get it work with pre-3.82 versions.