The Contiki build system
========================
The Contiki build system is designed-make it easy to compile Contiki
Applications for different hardware platforms or to a simulation platform by
Simply supplying different parameters to the make command, without have to
Edit Makefiles or modify the application code.
The compilation system is designed to be a common compilation system on different hardware platforms, and only the master needs a few different parameters to edit the makefiles file or modify the application code.
The file example project in Examples/hello-world/shows how the Contiki build
System works. The HELLO-WORLD.C application can be built to a complete
Contiki system by running make in the examples/hello-world/directory. The HelloWorld project in the example project is really how the Contiki build system works.
Where the HELLOWORLD.C file can be compiled into the Contiki system by executing the make command under the Hello-world folder
Running make without parameters would build a Contiki system using the native target.
The native target is a special Contiki platform this builds an entire Contiki
System as a program this runs on the development system.
Executing the make command without parameters will compile a local target,
The local target is a special Contiki platform that compiles a complete contiki system.
After compiling the
Application for the native target it's 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 the can be loaded
into an ESB board.
You can run hello-world.native after compiling, in order to compile the application and Contiki system can run under the ESB platform, you can use command make TARGET=ESB which will produce a HELLO-WORLD.ESB files that can be downloaded to the ESB board.
To compile the Hello-world application into a stand-alone executable that can
be loaded to a running Contiki system, the command make Hello-world.ce is
Used. To build a executable file for the ESB platform, make Target=esb
Hello-world.ce is run.
In order to compile the Hello-world application as a standalone executable file and can be loaded into a running Contiki system, you can use the Make Hello-world.ce command. If you need to specify the platform as an ESB, you can use the command
Make Target=esb Hello-world.ce
To avoid have to type target= every time make is run, it's 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.
To avoid the need to enter target= every time .... The default platform can be configured in 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
have 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 is:
The makefiles file in the
Contiki compilation system consists of several makefile files.
* makefile:the project ' s Makefile, located in the project directory.
1: Project own Makefile file in its own project directory
* Makefile.include:the system-wide Contiki Makefile, located in the root of
the Contiki source tree. The makefile file for the
2:makefile.include Contiki system is in the root directory of the Contiki system source file.
* makefile.$ (target) (where $ (target) is the name of the platform-is
currently being built): rules for the SP Ecific platform, located in the
platform ' s subdirectory in the platform/directory.
3:makefile. (platform) is located under the Platform folder corresponding to the Platform folder.
* makefile.$ (CPU) (where $ (CPU) is the name of the CPU or microcontroller
architecture used on the platform for WH Ich contiki is built): Rules for the
CPU architecture, located in the CPU architecture ' s subdirectory in the cpu/
Directory.
4:makefile. (CPU) under the CPU folder corresponding to the Microprocessor folder.
* makefile.$ (APP) (where $ (app) is the name of a application in the apps/
Directory): Rules for Applications in the apps/directories. Each application
have its own makefile.
5:makefile. (APP) below the app folder under Apps folder, each app corresponds to a folder.
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 is included in the Contiki system. The Makefile used in the Hello-world
Example project looks like this:
Makefile is very simple in the project catalogue. It specifies the location of the Contiki source code in the system, and contains the system's global
Makefile file--makefile-include file. The makefile of this project can be defined in the apps variable.
Contiki_project = Hello-world
All: $ (contiki_project)
Contiki =.. /..
Include $ (Contiki)/makefile.include
First, the location of the Contiki source code tree was given by defining the
Contiki variable. Next, the name of the application is defined. Finally, the
System-wide Makefile.include is included.
First Contiki the source tree for the location is given by the Contiki variable, and then, the name of the application has defined the last system of the makefile file Makefile.include also need to be included in.
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 was run, Makefile.include includes the makefile.$ (TARGET) as well as
All makefiles for the applications in the APPS list (which are specified by the
Project ' s Makefile).
Makefile.include contains the core C file of the Contiki system.
The Makefile.include file is always located in the root directory of the Contiki source code. When the make command is executed
Makefile.include includes makefile.$ (TARGET) and also contains all of the application's makefile files-the makefile file specified by the project.
makefile.$ (target), which is located in the platform/$ (target)/directory,
Contains the list of C files, 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) in Platform folder/$ (target)/directory contains a series of platforms added to the Contiki system of the C file, this list of C files is by contiki_target_ SOURCEFILES variable definition. makefile.$ (TARGET) also contains makfile.$ (CPU) files.
The makefile.$ (CPU) typically contains definitions for the C compiler used for
The particular CPU. If multiple C compilers is 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) typically contains a C compiler for some type of CPU. If more than one C compiler is used, then this file can contain a conditional judgment statement that allows different C compilers, or makefile.$ (TARGET) that can be specified by the platform overridden
The Contiki build system compiles systems