Skip to main content
added 118 characters in body
Source Link
yaegashi
  • 12.6k
  • 2
  • 39
  • 42

You need tomust not put ifeq in the beginning of a line:after TAB. Spaces are allowed. Read GNU Make document.

test_target: 
ifeq ($(TEST),"TRUE")
    echo "Do something"
endif

Also note that it compares $(TEST) with "TRUE" as is:

$ make TEST=TRUE
make: Nothing to be done for 'test_target'.

$ make TEST='"TRUE"'
echo "Do something"
Do something

You need to put ifeq in the beginning of a line:

test_target: 
ifeq ($(TEST),"TRUE")
    echo "Do something"
endif

Also note that it compares $(TEST) with "TRUE" as is:

$ make TEST=TRUE
make: Nothing to be done for 'test_target'.

$ make TEST='"TRUE"'
echo "Do something"
Do something

You must not put ifeq after TAB. Spaces are allowed. Read GNU Make document.

test_target: 
ifeq ($(TEST),"TRUE")
    echo "Do something"
endif

Also note that it compares $(TEST) with "TRUE" as is:

$ make TEST=TRUE
make: Nothing to be done for 'test_target'.

$ make TEST='"TRUE"'
echo "Do something"
Do something
Source Link
yaegashi
  • 12.6k
  • 2
  • 39
  • 42

You need to put ifeq in the beginning of a line:

test_target: 
ifeq ($(TEST),"TRUE")
    echo "Do something"
endif

Also note that it compares $(TEST) with "TRUE" as is:

$ make TEST=TRUE
make: Nothing to be done for 'test_target'.

$ make TEST='"TRUE"'
echo "Do something"
Do something