Is it possible to display variables outside rules using GNU Make?
Consider the following Makefile:
x = foo bar baz
ifdef x
@echo $(x)
endif
This results in Makefile:4: *** commands commence before first target. Stop.
However, if I add a rule, it works:
x = foo bar baz
ifdef x
t:
@echo $(x)
endif
Is it really necessary to add rules for outputting variables for debugging, etc.?
Bonus:
Why does the removal of ifdef result in Makefile:3: *** missing separator. Stop.?
x = foo bar baz
@echo $(x)