문제

I have written this part of a Contiki Makefile:

fake_eh = 1
CFLAGS += -DSIMULATED_EH=$(fake_eh)

ifeq "fake_eh" "1"
CONTIKI_TARGET_SOURCEFILES += energy-harv.c
endif

However, even if the condition fake_eh equal to 1 is true, the file energy-harv.c is not linked.

If I comment the ifeq - endif lines, the compilation works. Where is the if statement wrong?

Thanks.

도움이 되었습니까?

해결책

instead of

ifeq "fake_eh" "1"

you may try:

ifeq ($(fake_eh),1)

다른 팁

Well,

ifeq "fake_eh" "1"

asks whether both strings are the same. Do you see why they are not?

If not: one of them should be a variable. :-)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top