I have a makefile with the following code. I'm trying to set a variable in an if statement. It doesn't error, but %OPTION%
just prints %OPTION
(with only one percentage sign) and the $(OPTION)
doesn't print anything. Please help
Makefile
RELEASE_OR_DEBUG=debug
init:
SET OPTION=test
@echo test1 = %OPTION%
@echo test2 = $(OPTION)
if ".$(RELEASE_OR_DEBUG)" == ".debug" SET OPTION="-d"
@echo OPTION = %OPTION%
@echo OPTION = $(OPTION)
Output
test1 = %OPTION
test2 =
if ".debug" == ".debug" SET OPTION="-d"
OPTION = %OPTION
OPTION = $(OPTION)