Building FRESCOR with OMK makesystem Using OMK to compile FRESCOR OMK makesystem uses out of source compilation, which means that the same sources can be compiled for multiple targets/architectures/operating systems at the same time. Currently only compilation for MARTE and Linux+AQuoSA is tested. For the following, we will assume that your sources are sored in $HOME/frescor/src with this structure: frescor/src |-- omk-build | |-- aquosa | `-- marte |-- dtm |-- fna |-- fosa |-- frsh |-- frta `-- utils Quick start Marte OS * Install Marte (we use version 1.7) cd $HOME/frescor/src/omk-build/marte * Create config.omk containing MARTE_PATH=/path/to/marte/ * Create symbolic links to components you want to compile. Either manually or simply by using a provided script: ./create-links * Create default-configuration by running make default-config * Run make Linux + AQuoSA * Install AQuoSA (http://aquosa.sourceforge.net) * $HOME/frescor/src/omk-build/aquosa * Adjust symlinks to FRESCOR modules (fosa, frsh, utils, ...) or use ./create-links script * Create config.omk containing (or use a shell variable in your .bashrc) AQUOSA_ROOT=/path/to/aquosa/install/path * Actually, my preferred way of working is adding the following variables in .bashrc: # AQuoSA environment export AQUOSA_ROOT=/usr/local/aquosa export PATH="$PATH:$AQUOSA_ROOT/bin" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$AQUOSA_ROOT/lib" # FRESCOR environment export PLATFORM=AQuoSA export FOSA_ROOT=$HOME/path/to/fosa export FRSH_ROOT=$HOME/path/to/frsh export UTILS_ROOT=$HOME/path/to/utils LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$FOSA_ROOT/lib:$FRSH_ROOT/lib:$UTILS_ROOT/lib" # OMK environment # Use `omk' for OMK-enabled sources alias omk="make -f $HOME/path/to/Makefile.rules" # link headers instead of copying them export LN_HEADERS=y * Create default-configuration by running make default-config * Run make Further remarks * If we are not interested in compilation of some component (because it is currently in uncompilable state), we can simply delete the link to it. * It might be possible that you will need to change some configuration value from config.target. You can override any variable declared there in config.omk. For example, if you have MARTE installed in a different directory that the one specified in config.target, you can put the following in config.omk: MARTE_PATH=/path/to/marte/ * To compile the FRESCOR for Marte, it is not necessary to set PATH variable to GNAT compiler since OMK uses full paths to call the compiler. * Since there are many things in uncompilable state, you may want to use `make -k' to ignore compilation errors. * Since we don't want to modify the original Makefiles, in order to compile only a part of the tree, you cannot simply run make in the desired directory, but you have to specify -f flag with the path to Makefile.rules. For this reason, we recommend defining the following alias: alias omk="make -f $HOME/frescor/src/omk-build/marte/Makefile.rules" Why is OMK good for FRESCOR * It is not easy to test FRESCOR simultaneously on multiple platforms. With OMK, you can have the same sources compiled for multiple platforms/targets at the same time because it uses out of source directory compilation. * Dependencies are not handled correctly in current Makefiles. For example headers (in most tests) and some libraries (fosa_xxx) are not specified as dependencies. OMK handles dependencies automatically, so developers don't have to care about them. * With OMK it is easy to combine multiple components/libraries (from different developers) together and compile them with the same configuration (e.g. PLATFORM variable). The structure of leaf makefiles (Makefile for every component) is very simple and *well specified*. Because of this it is easy to combine components from multiple developers. * Directory structure for compilation with current makefiles must be fixed. In makefiles there is many "..". This prevents the use of symbolic links to create desired directory structure because make always treats ".." physically (i.e. it don't respect the directory structure created by symbolic links). In OMK, the position of directories in the source tree is not important. This is another reason, why integration is simpler with OMK. * OMK already supports compilation for user-space programs/libraries, Linux and RTLinux modules, RTEMS and several other platforms. Now we have also added support for Marte. It works under MinGW and Cygwin, so it can be used to compile for OSE. In Pisa, they already use OMK for Aquosa. FAQ How do I debug my Makefile.omk set-up ? Just activate verbose compilation (V=1 or V=2): make -f /path/to/Makefile.rules binary-pass V=1 How do I get back syntax highlighting in Emacs while editing .omk files ? Just add these lines to your $(HOME)/.emacs: (setq auto-mode-alist (append '(("\.omk$" . makefile-mode)) auto-mode-alist))