The Contiki build system

The Contiki build system
========================

Makefiles used in the Contiki build system The Contiki build system is composed
of a number of Makefiles. These are:


* Makefile: the project's makefile, located in the project directory.


* Makefile.include: the system-wide Contiki makefile, located in the root of
  the Contiki source tree.


* Makefile.$(TARGET) (where $(TARGET) is the name of the platform that is
  currently being built): rules for the specific platform, located in the
  platform's subdirectory in the platform/ directory.


* Makefile.$(CPU) (where $(CPU) is the name of the CPU or microcontroller
  architecture used on the platform for which Contiki is built): rules for the
  CPU architecture, located in the CPU architecture's subdirectory in the cpu/
  directory.


* Makefile.$(APP) (where $(APP) is the name of an application in the apps/
  directory): rules for applications in the apps/ directories. Each application
  has its own makefile.


The Makefile in the project's directory is intentionally simple. It specifies
where the Contiki source code resides in the system and includes the
system-wide Makefile, Makefile.include. The project's makefile can also define
in the APPS variable a list of applications from the apps/ directory that
should be included in the Contiki system. The Makefile used in the hello-world
example project looks like this:


    CONTIKI_PROJECT = hello-world
    all: $(CONTIKI_PROJECT)


    CONTIKI = ../..
    include $(CONTIKI)/Makefile.include


First, the location of the Contiki source code tree is given by defining the
CONTIKI variable. Next, the name of the application is defined. Finally, the
system-wide Makefile.include is included.


The Makefile.include contains definitions of the C files of the core Contiki
system. Makefile.include always reside in the root of the Contiki source tree.
When make is run, Makefile.include includes the Makefile.$(TARGET) as well as
all makefiles for the applications in the APPS list (which is specified by the
project's Makefile).


Makefile.$(TARGET), which is located in the platform/$(TARGET)/ directory,
contains the list of C files that the platform adds to the Contiki system. This
list is defined by the CONTIKI_TARGET_SOURCEFILES variable. The
Makefile.$(TARGET) also includes the Makefile.$(CPU) from the cpu/$(CPU)/
directory.


The Makefile.$(CPU) typically contains definitions for the C compiler used for
the particular CPU. If multiple C compilers are used, the Makefile.$(CPU) can
either contain a conditional expression that allows different C compilers to be
defined, or it can be completely overridden by the platform specific makefile
Makefile.$(TARGET).
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值