Menu

How to use FAMOUSO as external library in own projects?

For using FAMOUSO within other projects as an external library you have to provide all relevant definitions to build the whole project without missing one dependency. FAMOUSO's make-system provides all needed means to do this task, but you have to fulfil some prerequisites.

Under the assumption that FAMOUSO was successfully built for the envisioned platform(s) and the project uses also a make-system, the following steps show how to integrate FAMOUSO and build successfully against it.

  1. Open your top-level Makefile and provide the location where is FAMOUSO
    FAMOUSO_INSTALLDIR = famouso root dir
    
  2. You could set the FAMOUSO_CONFIG variable to choose the platform on which FAMOUSO is used in FAMOUSO_CONFIG e.g.:
    FAMOUSO_CONFIG = linux
    
    At the moment, FAMOUSO's supported platforms are:
    • linux
    • linux/openwrt
    • linux/xenomai
    • windows/mingw-cross
    • windows/mingw-native
    • windows/cygwin
    • avr
    If you don't define the variable the current value from FAMOUSO_INSTALLDIR/make/config.mk is chosen.
  3. You can also set the generation of DEBUG messages by setting the FAMOUSO_DEBUG variable. If you set it e.g. to "FAMOUSO_DEBUG=" no debugging information are generated by the compiler, but the normal debugging output of FAMOUSO is generated. Switching this off too, you should use:
    FAMOUSO_DEBUG=-DFAMOUSO_DEBUG_DISABLE
    
  4. The last step is including a special FAMOUSO makefile that puts all relevant variables that are needed in order to build correctly against FAMOUSO
    include $(FAMOUSO_INSTALLDIR)/make/famouso_as_external_lib.mk
    
    After the include the following variables are defined:
    $(FAMOUSO_COMPILER_OPTIONS_MUST_HAVE)
    $(FAMOUSO_COMPILER_OPTIONS_SUGGESTED)
    
    They contain the right settings for includes, libs, preprocessor and so on. The names are self-explanatory and the variables should be used within own defined compiling-rules.

This is all you need to do for integrating FAMOUSO into your project. A minimal example on what is absolut needed looks like thus:

###################################################
# FAMOUSO related stuff                           #
###################################################
FAMOUSO_INSTALLDIR = famouso root dir
include $(FAMOUSO_INSTALLDIR)/make/famouso_as_external_lib.mk

###################################################
# Your Makefile instructions and rules start here #
###################################################
all:
    @echo $(FAMOUSO_COMPILER_OPTIONS_MUST_HAVE)
    @echo $(FAMOUSO_COMPILER_OPTIONS_SUGGESTED)

A complete example Makefile could be found under

famouso-dir/doc/dox/Example_Makefile_for_FAMOUSO_as_external_lib.mk