Unlike most embedded operating system, which require you to perform monolithic builds of the entire system, including your application, Olmec Linux is built as a set of packages. The operating system is provided as prebuilt packages, but you still need to build your application. We highly recommend that you build your application as one or more packages that get installed on top of the operating system.
The general approach we suggest is to organize your source code into one or more packages, and to maintain your code using a source code repository such as cvs or subversion. If you will be using the Olmec Build System to build you applications, then you'll need to use subversion.
Checkout a copy of your source
You $HOME directory will automatically be mounted inside the SDK chroot for you. We suggest that you check out the local copy of your source repository somewhere under your $HOME directory.
svn update
Change into the chroot
When you enter the SDK chroot, you'll find the approximately the same environment as you have outside the SDK, except that everything will think it is running on the target architecture of your project.
$ schroot -c olmec-armel-h I: [olmec-armel-h-12551ac3-b4b4-4477-b941-46a6ec387365 chroot] Running login shell: '/bin/bash' (olmec-armel-h) $ uname -m armv5tel (olmec-armel-h) $
Build your package
The devscripts package provides some convenient scripts for working with packages. One of these is the debbuild script, which can be used to build your package.
(olmec-armel-h) $ cd giffer/ (olmec-armel-h) $ debuild dpkg-buildpackage -rfakeroot -D -us -uc dpkg-buildpackage: set CFLAGS to default value: -g -O2 dpkg-buildpackage: set CPPFLAGS to default value: dpkg-buildpackage: set LDFLAGS to default value: dpkg-buildpackage: set FFLAGS to default value: -g -O2 dpkg-buildpackage: set CXXFLAGS to default value: -g -O2 dpkg-buildpackage: source package giffer dpkg-buildpackage: source version 1:1.0.6 dpkg-buildpackage: source changed by Stuart R. Anderson <anderson@inaura.com> dpkg-buildpackage: host architecture armel dpkg-checkbuilddeps: Unmet build dependencies: build-essential debhelper (>= 4.0.0) libungif4-dev (>= 4.1.4) dpkg-buildpackage: warning: Build dependencies/conflicts unsatisfied; aborting. dpkg-buildpackage: warning: (Use -d flag to override.) debuild: fatal error at line 1319: dpkg-buildpackage -rfakeroot -D -us -uc failed
Install missing build dependencies
Each package must specify both the build-time and run-time dependencies needed to build or run the applications in the package. You will probably need to install some additional development packages inside the SDK so that you can build your packages.
(olmec-armel-h) $ sudo apt-get install build-essential debhelper libungif4-dev
Build your package
(olmec-armel-h) $ cd giffer/ (olmec-armel-h) $ debuild -b -uc -us
When the package builds successfully, you should be left with one or more .deb file in the directory above your package. These are binary packages, ready to be installed.