blueshift
blueshift

Reputation: 6882

Why can't I use '=' after define in a GNU makefile? The docs suggest I can

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?

Upvotes: 2

Views: 136

Answers (1)

Eldar Abusalimov
Eldar Abusalimov

Reputation: 25493

define with 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 plain define foo, just use the latter to get it work with pre-3.82 versions.

Upvotes: 6

Related Questions