Question

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.

Was it helpful?

Solution

instead of

ifeq "fake_eh" "1"

you may try:

ifeq ($(fake_eh),1)

OTHER TIPS

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. :-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top