At the top of my Makefile, before any of the rules, I have the following:
ifeq ($(ENVIRONMENT),LOCAL)
TARGET := local_target
else
TARGET := hello
endif
If the ENVIRONMENT
environment variable is not set, or is set to a value other than LOCAL
, instead of setting TARGET
to hello
, I want the makefile to halt and exit with -1.
Can I do that?? When I change TARGET := hello
to exit -1
, I get the following error:
Makefile:4: *** missing separator. Stop.
How can I make this work??