The Contiki build system 编译系统
The Contiki build system
========================
The Contiki build system is designed to make it easy to compile Contiki
applications for different hardware platforms or into a simulation platform by
simply supplying different parameters to the make command, without having to
edit makefiles or modify the application code.
编译系统旨在设计成在不同的硬件平台上都通用的编译系统,仅仅主需要几个不同的参数就可以比哪一不用编辑makefiles文件或者修改应用代码。
The file example project in examples/hello-world/ shows how the Contiki build
system works. The hello-world.c application can be built into a complete
Contiki system by running make in the examples/hello-world/ directory. 在example项目中的Helloworld项目真是了contiki编译系统是怎么工作的。
其中的Helloworld.c文件可以被编译进入contiki系统中通过在hello-world文件夹下执行make命令
Running make without parameters will build a Contiki system using the native target.
The native target is a special Contiki platform that builds an entire Contiki
system as a program that runs on the development system.
执行没有参数的make命令将会编译一个 本地的目标,
本地目标是一个特殊的contiki平台它编译了一个完整的contiki系统。
After compiling the
application for the native target it is possible to run the Contiki system with
the application by running the file hello-world.native. To compile the
application and a Contiki system for the ESB platform the command make
TARGET=esb is used. This produces a hello-world.esb file that can be loaded
into an ESB board.
在编译完之后可以通过运行 hello-world.native 来运行, 为了编译应用和contiki系统能够在ESB平台下运行,那么可以使用命令 make TARGET=esb 这将会产生一个 hello-world.esb文件,能够下载到ESB板中。
To compile the hello-world application into a stand-alone executable that can
be loaded into a running Contiki system, the command make hello-world.ce is
used. To build an executable file for the ESB platform, make TARGET=esb
hello-world.ce is run.
为了编译hello-world应用成为一个独立的可执行的文件并可以加载到一个正在运行的contiki系统中,那么可以使用 make hello-world.ce 命令。 如果需要指定平台为ESB的话可以用命令
make TARGET=ESB hello-world.ce
To avoid having to type TARGET= every time make is run, it is possible to run
make TARGET=esb savetarget to save the selected target as the default target
platform for subsequent invocations of make. A file called Makefile.target
containing the currently saved target is saved in the project's directory.
为了避免每次都要输入TARGET= ....可以在makfile.targe 中进行配置默认的平台
Beside TARGET= there's DEFINES= which allows to set arbitrary variables for the
C preprocessor in form of a comma-separated list. Again it is possible to avoid
having to re-type i.e. DEFINES=MYTRACE,MYVALUE=4711 by running make TARGET=esb
DEFINES=MYTRACE,MYVALUE=4711 savedefines. A file called Makefile.esb.defines is
saved in the project's directory containing the currently saved defines for the
ESB platform.
Makefiles used in the Contiki build system The Contiki build system is composed
of a number of Makefiles. These are:
contiki编译系统中的makefiles文件由几个makefile文件组成。
* Makefile: the project's makefile, located in the project directory.
1:工程项目自己的makefile文件 在自己的工程目录下
* Makefile.include: the system-wide Contiki makefile, located in the root of
the Contiki source tree.
2:makefile.include contiki系统的makefile文件在contiki系统源文件的根目录下。
* 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.
3: makefile.(平台) 位于platform文件夹对应的平台文件夹下面。
* 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.
4:makefile.(CPU) 在CPU文件夹下对应微处理器文件夹下。
* 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.
5: makefile.(应用) 在apps文件夹下对应的应用文件夹下面,每个应用对应一个文件夹。
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:
makefile在工程项目目录中非常的简单。它指定了contiki源代码在系统中的位置,并且包含了系统全局的
makefile文件——makefile-include文件。这个工程的makefile可以定义在apps变量。
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.
首先 contiki的源代码树为位置由 CONTIKI变量给出,然后,应用的名称已经定义了 最后系统的makefile文件 makefile.include也需要被包含进来。
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.include 包含了 contiki系统的核心c文件。
makefile.include 文件总是位于contiki源代码的根目录下。当make命令执行时
makefile.include 包括了makefile.$(TARGET)并且也包含了所有的 应用的makefile文件——被工程项目指定的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.
makefile.$(TARGET) 在platform文件夹/$(TARGET)/directory 包含了一系列的平台添加到contiki系统的的c文件,这个c文件列表是由CONTIKI_TARGET_SOURCEFILES 变量定义。 makefile.$(TARGET) 也包含了makfile.$(CPU) 文件。
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).
makefile.$(CPU)一般包含针对某种型号CPU的c编译器。 如果有多个c编译器被使用,那么此文件可以包含一个条件判断语句允许不同的c编译器,或者可以被 平台指定的makefile.$(TARGET) overridden
The Contiki build system 编译系统的更多相关文章
- The Contiki build system
The Contiki build system http://contiki.sourceforge.net/docs/2.6/a01796.html 先看官方文档的说明,对contiki的构建系统 ...
- sublime text 配置 builder [build system]
有时候需要用运行一段 PHP 代码,比如测试某个函数返回值等等,如果启动 Http Server,再打开浏览器,那黄花菜都凉了.我们可以在 Sublime Text 3 中创建 PHP 的 build ...
- 【转】Android ROM研究---Android build system增加模块
原文网址:http://hualang.iteye.com/blog/1141315 Android build system就是编译系统的意思 在我们需要向自己编译的源代码中增加模块的时候,需要一些 ...
- Android Build System
归类一些Android build system 相关的知识. http://elinux.org/Android_Build_System make <local_module> - m ...
- Gradle: The New Android Build System
Gradle: The New Android Build System Google selected Gradle as the foundation of the Android SDK bui ...
- Android uiautomator gradle build system
This will guide you through the steps to write your first uiautomator test using gradle as it build ...
- lua语言入门之Sublime Text设置lua的Build System
转自: http://blog.csdn.net/wangbin_jxust/article/details/8911956 最近开始学习LUA语言,使用Sublime Text作为编辑器,不得不说, ...
- Sublime Text 2 新建C++ build system
首先要有个MinGW(我这里借用ceemple的编译器 ,mingw32) 设置环境变量 右击我的电脑,点属性->高级->环境变量. 在系统环境变量在PATH里加入D:\Ceemple\m ...
- sublime C++ build system配置体验
近期准备实习,于是终于步入了sublime的阵营,sublime确实性感. 在配置win7下C++编译运行集成环境的时候遇到点问题,于是接触了一下JSON格式,最后终于自己搞定了.. 参考文档:htt ...
随机推荐
- 继网易博客后搜狐博客也增加了nofollow标签
继网易博客后搜狐博客也增加了nofollow标签 今天在搜狐博客发表了篇文章,在末端添加上我的版权,结果回头查看是发现,这个锚文本被加上了nofollow标签,也就是说这样的外链已经没有传递权重的作用 ...
- Feedly订阅Blog部落格RSS网摘 - Blog透视镜
网络信息爆炸的时代,如何更有效率地阅读文章,订阅RSS网摘,可以快速地浏览文章标题,当对某些文章有兴趣时,才点下连结连到原网站,阅读更详细的文章,Feedly Reader阅读器除了提供在线版订阅RS ...
- 在NGINX作反向代理,CI(CodeIgniter)的PHP框架下限制管理目录的IP的实现
这个搞得有点久,不过,还算完美解决. 主要是前端NGINX,后端也是NGINX. 前端的NGINX不好作相关的URL权限限制,因为所有的URL在CI里都要经过INDEX.PHP重定向. 并且,在后端N ...
- scheme 阴阳谜题
本篇分析continuation的一个著名例子"阴阳迷题",这是由David Madore先生提出的,原谜题如下: (let* ((yin ((lambda (foo) (disp ...
- 转:Android 测试 Appium、Robotium、monkey等框架或者工具对比
原文地址:http://demo.netfoucs.com/u012565107/article/details/36419297# 1. Appium测试 (功能测试,用户接受度测试,黑盒测试) - ...
- spring framework 4 源码阅读(1) --- 前期准备
在开始看代码之前,需要做的第一件事是下载代码. 在这里:https://github.com/spring-projects/spring-framework 下载完成了发现使用gradle做的源代码 ...
- cf494A Treasure
A. Treasure time limit per test 2 seconds memory limit per test 256 megabytes input standard input o ...
- 免费 Bootstrap 管理后台模块下载
在这文章中我们将分享17+个最好的免费 Bootstrap 管理模板.你可以免费下载这些Twitter bootstrap 框架来开发网站后台. SB Admin 2 SB Admin is a fr ...
- acdream1412:2-3 trees 组合数dp
题意: 给出一个标准2-3树的叶子节点(最底层节点)个数 L,求2-3数的形成方案数并取余 分析: 如果有L个叶子枚举 每个 可以使x*2+y*3=L 的 x y 那么在最底层就有 c(x+y,x) ...
- LeetCode 191. Number of 1 Bits Question
题意:给你一个整数,计算该整数的二进制形式里有多少个“1”.比如6(110),就有2个“1”. 一开始我就把数字n不断右移,然后判定最右位是否为1,是就cnt++,否则就继续右移直到n为0. 可是题目 ...