Difference between revisions of "MansOS Makefiles"
(New page: == MansOS and Makefiles == MansOS has a makefile system to speed up the development of your applications and the development of MansOS itself === For application developers === ==== Runn...) |
(→Makefile basics) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
⚫ | |||
== MansOS and Makefiles == |
|||
⚫ | |||
your applications and the development of MansOS itself |
your applications and the development of MansOS itself |
||
== For application developers == |
|||
==== Running make ==== |
==== Running the make ==== |
||
The common targets of the makefile are as follows: |
The common targets of the makefile are as follows: |
||
* '''build''' - (optional, default) build the module or application |
* '''build''' - (optional, default) build the module or application |
||
* '''upload''' - upload the application |
* '''upload''' - upload the application via hard wire (USB or COM). Make will upload to the first attached mote it finds. |
||
* '''<target>''' - targed platform, such as '''telosb''' |
* '''''<target>''''' - targed platform, such as '''telosb''' |
||
* '''clean''' - clear the generated object and other files. |
|||
For example, if you want to build your system and then upload it to the telos mote: |
For example, if you want to build your system and then upload it to the telos mote: |
||
make telosb |
make telosb |
||
make telosb upload |
make telosb upload |
||
Read on about the various [[MansOS_Platforms]] and options available for make. |
|||
==== Creating the application Makefile ==== |
==== Creating the application Makefile ==== |
||
Line 45: | Line 46: | ||
include ${MOSROOT}/mos/make/Makefile |
include ${MOSROOT}/mos/make/Makefile |
||
Another way to setup MOSROOT, is to write in bash before executing make: |
|||
export MOSROOT=/home/raimonds/MansOS_Work |
|||
== For MansOS developers == |
|||
Add path(s) to the source files in the platform makefile. |
Add path(s) to the source files in the platform makefile. |
||
Line 55: | Line 58: | ||
For a general info on how to work with makefiles look here: |
For a general info on how to work with makefiles look here: |
||
* |
* [http://www.gnu.org/software/make/manual/make.html GNU Make manual] |
||
* [http://www.cs.cmu.edu/cgi-bin/info2www?(make.info)Top (make.info) at CMU] |
|||
Here is an example of a makefile system for Java development: |
|||
* [http://geosoft.no/development/javamake.html Javamake at Geosoft] |
Latest revision as of 13:43, 19 August 2010
MansOS has a makefile system to speed up the development of your applications and the development of MansOS itself
Contents
For application developers
Running the make
The common targets of the makefile are as follows:
- build - (optional, default) build the module or application
- upload - upload the application via hard wire (USB or COM). Make will upload to the first attached mote it finds.
- <target> - targed platform, such as telosb
- clean - clear the generated object and other files.
For example, if you want to build your system and then upload it to the telos mote:
make telosb make telosb upload
Read on about the various MansOS_Platforms and options available for make.
Creating the application Makefile
You need just one Makefile in your project directory. Examples can be found in the apps directory. This makefile must define the following variables:
- SOURCES - a space-delimited list of source (.c) files. It is assumed that the include files reside in the same directory
- MODULE - the module name being developed. This could be the application name.
- PROJDIR - most likely the current directory $(CURDIR) containing the application files.
For example:
# My makefile SOURCES = main.c MODULE = MySystem PROJDIR = $(CURDIR)
Optional:
- INCLUDES - space-delimited list of include file directories. The project directory itself is included by default.
The makefile must end with the definition of path to MansOS system MOSROOT and include of the main MansOS Makefile, like this:
ifndef MOSROOT MOSROOT = /home/elo/c/elo/WSN/projects/MansOS/svn endif # Include the main makefile include ${MOSROOT}/mos/make/Makefile
Another way to setup MOSROOT, is to write in bash before executing make:
export MOSROOT=/home/raimonds/MansOS_Work
For MansOS developers
Add path(s) to the source files in the platform makefile.
Makefile basics
For a general info on how to work with makefiles look here:
Here is an example of a makefile system for Java development: