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 ...
随机推荐
- Android之断点续传下载
今天学习了Android开发中比较难的一个环节,就是断点续传下载,很多人看到这个标题就感觉头大,的确,如果没有良好的逻辑思维,这块的确很难搞明白.下面我就将自己学到的知识和一些见解写下供那些在这个环节 ...
- [置顶] css3 befor after 简单使用 制作时尚焦点图相框
:befor.:after是CSS的伪元素,什么是伪元素呢?伪元素用于向某些选择器设置特殊效果. 我们用CSS手册可以查询到其基本的用法: E:before/E::before 设置在对象前(依据对象 ...
- hdu 5402 Travelling Salesman Problem(大模拟)
Problem Description Teacher Mai ,) to the bottom right corner (n,m). He can choose one direction and ...
- MVC 控制器详解
Controller: Controllers 文件夹包含负责处理用户输入和响应的控制器类. MVC 要求所有控制器的名称必须以 "Controller" 结尾. 控制器的职责: ...
- Cocos2d-x3.0游戏实例之《别救我》第二篇——创建物理世界
这篇我要给大家介绍两个知识点: 1. 创建游戏物理世界 2. 没了(小若:我噗) 害怕了?不用操心.这太简单了~! 笨木头花心贡献.啥?花心?不呢.是用心~ 转载请注明,原文地址:http://www ...
- ngui点击与场景点击判断
注:NGUI 组件上加上 BoxCollider 并设置区域大小 public void OnMouseDown() { if (UICamera.hoveredObject == null) ...
- Android 编程下 Activity 的创建和应用退出时的销毁
为了确保对应用中 Activity 的创建和销毁状态进行控制,所以就需要一个全局的变量来记录和销毁这些 Activity.这里的大概思路是写一个类继承 Application,并使获取该 Applic ...
- Visual Studio 2015 开发MVC4出现错误
在Visual Studio 2015(以下简称VS2015)中开发MVC4项目时,编译报错"当前上下文中不存在ViewBag",一直无法编译,这个是否是VS2015的Bug? 本 ...
- ios swift(1)冒泡排序
//冒泡排序 稳定性最高 时间复杂度高 O(n(2)) ,交换次数太多, 一次交换等于三次赋值 最简单 var count = 0 func sortInts(inout data : [I ...
- linux打开80端口及80端口占用解决办法
linux打开80端口天客户那边有台服务器同一个局域网中都无法访问,排除lamp环境问题,发现时服务器中的防火墙没有开启80端口. 代码如下 复制代码vi /etc/sysconfig/iptable ...