接着分析contiki系统的makefile。
之前分析到Makefile.cc2530dk的这个地方
%.upload: %.hex
$(PROG) -P $<
这里这个PROG变量现在还不明确,-P为选项,$<为%.hex文件名
sensinode.serialdump:
$(SERIALDUMP)
伪目标sensinode.serialdump为调试所用,它调用命令SERIALDUMP,这个变量所代表的的意思猜测应该是打开串口,向其中打印数据。
CONTIKI_CPU=$(CONTIKI)/cpu/cc253x
include $(CONTIKI_CPU)/Makefile.cc253x
这里定义CONTIKI_CPU为$(CONTIKI)/cpu/cc253x 然后读取该目录下面的Makefile.cc253x,这里先不展开,因为在上篇文章中只是打开Makefile.cc2530dk,但是make没有真正执行到里面。
回溯到Makefile.include文件中
# Check if the target makefile exists, and create the object directory if necessary.
ifeq ($(strip $(target_makefile)),)
${error The target platform "$(TARGET)" does not exist (maybe it was misspelled?)}
else
ifeq (${wildcard $(OBJECTDIR)},)
DUMMY := ${shell mkdir $(OBJECTDIR)}
endif
ifneq (1, ${words $(target_makefile)})
${error More than one TARGET Makefile found: $(target_makefile)}
endif
include $(target_makefile)
endif
ifeq语句开始调用strip函数去掉变量