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...) |
m (→Makefile basics) |
||
Line 55: | Line 55: | ||
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.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] |
Revision as of 01:33, 31 March 2008
Contents
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
Running make
The common targets of the makefile are as follows:
- build - (optional, default) build the module or application
- upload - upload the application
- <target> - targed platform, such as telosb
For example, if you want to build your system and then upload it to the telos mote:
make telosb make telosb upload
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
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: