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 ...
随机推荐
- cf Sereja and Array
http://codeforces.com/contest/315/problem/B #include <cstdio> #include <cstring> #includ ...
- 【转】Win7系统下安装Ubuntu12.04(EasyBCD硬盘安装)--不错
原文网址:http://blog.csdn.net/lengbuleng1107/article/details/14532177 需要的东西有: 1,ubuntu系统镜像,下载地址:http://w ...
- [VBA]用一个简单例子说明如何在Excel中自定义函数
Excel中的函数无疑是强大的,但是再强大的战士也有他脆弱的脚后跟[1].这两天在使用Excel的时候遇到了一个需求,要在某一个单元格里面自动计算今天是星期几(如显示 Today is Tuesday ...
- c# splitter控件使用简介
摘自:http://blog.itpub.net/26221264/viewspace-735903 1.先在窗体上放置部分一的控件,这里是TreeView控件,然后把它的 Dock 属性设置为 Le ...
- Java 微服务框架 Redkale 入门介绍
Redkale 功能 Redkale虽然只有1.xM大小,但是麻雀虽小五脏俱全.既可作为服务器使用,也可当工具包使用.作为独立的工具包提供以下功能:1.convert包提供JSON的序列化和反序列化功 ...
- c语言sizeof与strlen的区别
#include <stdio.h> #include <stdlib.h> #include <string.h> //strlen与sizeof的区别 //st ...
- Spring初学(一)
Spring核心机制:依赖注入 依赖注入简单的理解就是 由Spring负责对model进行设置,而非由controller直接设置. 通过依赖注入,javaEE各种组件可以解耦. 依赖注入(Depen ...
- uva 11081 - Strings(LCS)
题目链接:11081 - Strings 题目大意:给出三个字符串,从分别从第一个字符串和第二个字符串中挑选子串a,b,用a和b组成第三个字符串,问可组成的子串有多少种. 解题思路:说起来惭愧啊,题目 ...
- myeclipse自动补全设置
第一步: windows -->preference -->java -->editor -->content Assist --> auto activation -- ...
- c语言10个经典小程序
[程序1] 题目:有1.2.3.4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少? 1.程序分析:可填在百位.十位.个位的数字都是1.2.3.4.组成所有的排列后再去 掉不满足条件的排列. ...