Thursday, February 10, 2011

[Level2] Pass parameters to make.

$ cat Makefile
all:
ifdef aa
        echo "defined"
ifeq "${aa}" "123"
        echo "true"
else
        echo "false"
endif
else
        echo "not defined"
endif
$
$ make
echo "not defined"
not defined
$
$ make aa="000"
echo "defined"
defined
echo "false"
false
$
$ make aa="123"
echo "defined"
defined
echo "true"
true
$


Wish this helps.
 regards,
Stanley Huang