contiki2.6之Makefile详细解读三

本文详细解读了Contiki2.6系统中Makefile的构建过程,包括%.upload目标、sensinode.serialdump伪目标、CONTIKI_CPU变量、Makefile.include中的条件判断及目标文件路径处理。通过对Makefile的逐行分析,揭示了编译配置、目录结构以及源文件处理的细节。
摘要由CSDN通过智能技术生成

     接着分析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函数去掉变量

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值