Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经编写了 Contiki Makefile 的这一部分:
fake_eh = 1 CFLAGS += -DSIMULATED_EH=$(fake_eh) ifeq "fake_eh" "1" CONTIKI_TARGET_SOURCEFILES += energy-harv.c endif
但是,即使条件 fake_eh 等于 1 为真,文件 energy-harv.c 也不会链接。
如果我评论 ifeq - endif 行,编译工作。if语句错在哪里?
谢谢。
出色地,
ifeq "fake_eh" "1"
询问两个字符串是否相同。你明白为什么他们不是吗?
如果不是:其中一个应该是变量。:-)
代替
你可以试试:
ifeq ($(fake_eh),1)