# # @file Makefile # # @section desc File description # # Makefile for application % !CPUNAME % # automatically generated by goil on % !TIMESTAMP % # from root OIL file % !OILFILENAME % # # @section copyright Copyright # # Trampoline OS # # Trampoline is copyright (c) IRCCyN 2005-2012 # Trampoline is protected by the French intellectual property law. # # This software is distributed under the Lesser GNU Public Licence # # @section infos File informations # # Do not modify directly this file, it can be overwritten by goil # Instead, you can update your .oil file description. # # $Date$ # $Rev$ # $Author$ # $URL$ # # make : build application % !CPUNAME % # make doc : extract both dev and user docs from trampoline sources # (doxygen and dot required). # make clean : remove everything except the Makefile. # # NOTE: dependancies are set by default (to recompile the needed files) # if your compiler does not support it (-MF -MD) you can turn it off: # use the NODEP symbol, i.e. : make clean NODEP=1 # ############################################################################# # USER APPLICATION CONFIGURATION ############################################################################# # Name of the generated executable # it should be declared as APP_NAME in the OS section of the .oil file. # if not, it defaults to 'trampoline' EXEC = % !OS::BUILD_S::APP_NAME % # Name of the source OIL file OIL_FILE = % !OILFILENAME % # Source files of the application. # it should be declared as APP_SRC in the OS section of the .oil file # (many times allowed). % foreach src in exists OS::BUILD_S::APP_SRC default ( @() ) before %SOURCES = % do !src::VALUE between % % after % % end foreach if OS::SYSTEM_CALL then % OIL_GENERATED_FILES += tpl_dispatch_table.c OIL_GENERATED_FILES += tpl_invoque.S % else % OIL_GENERATED_FILES += tpl_os.c % end if if [TRANSACTION length] > 0 then % OIL_GENERATED_FILES += stm_structure.c % end if if [IOC length] > 0 then % OIL_GENERATED_FILES += tpl_ioc_api_config.c WITH_IOC = true % else % WITH_IOC = false % end if if OS::APPLICATIONSTARTUPHOOK > 0 | OS::APPLICATIONSHUTDOWNHOOK > 0 then % # SOURCES += tpl_osapplication_hooks.c % end if % # Trampoline generation flags WITH_TRACE = % ! trueFalse(OS::TRACE) % WITH_MEMMAP = % ! trueFalse(OS::MEMMAP) % WITH_LINKSCRIPT = % ! trueFalse(exists OS::MEMMAP_S::LINKER) % WITH_MEMORY_PROTECTION = % ! trueFalse(USEMEMORYPROTECTION) % % if exists OS::BUILD_S::CFLAGS then foreach flag in OS::BUILD_S::CFLAGS before % # CFLAGS: flags used for the C compilation process # it should be declared as CFLAGS in the OS section of the .oil file # (many times allowed). override CFLAGS += % do !flag::VALUE between % % after % % end foreach end if % % if exists OS::BUILD_S::CPPFLAGS then foreach flag in OS::BUILD_S::CPPFLAGS before % # CPPFLAGS: flags used for the C++ compilation process # it should be declared as CPPFLAGS in the OS section of the .oil file # (many times allowed). override CPPFLAGS += % do !flag::VALUE between % % after % % end foreach end if % # LDFLAGS: flags used for the link process # it should be declared as LDFLAGS in the OS section of the .oil file # (many times allowed). % if exists OS::BUILD_S::LDFLAGS then foreach flag in OS::BUILD_S::LDFLAGS before %LDFLAGS = % do !flag::VALUE between % % after % % end foreach end if % % if exists OS::MEMMAP_S::LINKER then %LDFLAGS += -T % !PROJECT %/% !OS::MEMMAP_S::LINKER_S::SCRIPT end if if OS::TRACE then% EXTRA_FILES_CLEAN += %!PROJECT %.desc% end if if LOGFILE then% EXTRA_FILES_CLEAN += goil.log% end if % # ASFLAGS: flags used for the assembly process (if required) # it should be declared as AS_FLAGS in the OS section of the .oil file # (many times allowed). % if exists OS::BUILD_S::ASFLAGS then foreach flag in OS::BUILD_S::ASFLAGS before %ASFLAGS = % do !flag::VALUE between % % after % % end foreach end if % # Default build directory BUILD_DIR = build # Autosar extension # If 'true', Autosar extension are compiled in (schedule tables, ...) AUTOSAR = % ! trueFalse(AUTOSAR) % AUTOSAR_SC = % !OS::SCALABILITYCLASS % AUTOSAR_OSAPPLICATIONS = % !trueFalse(OS::SCALABILITYCLASS == 3 | OS::SCALABILITYCLASS == 4) % # Scheduler SCHEDULER = % !OS::SCHEDULER% ############################################################################# # COMPILER CONFIGURATION ############################################################################# # Program used to compile files. # it should be declared as COMPILER in the OS section of the .oil file. # default is 'gcc' % if OS::BUILD_S::COMPILER == "comp_undef" then %CC ?= gcc% else %CC = % !OS::BUILD_S::COMPILER end if % # Program used to link files during compilation process. # it should be declared as LINKER in the OS section of the .oil file. # default is 'gcc' % if OS::BUILD_S::LINKER == "ld_undef" then %LD ?= gcc% else %LD = % !OS::BUILD_S::LINKER end if % # Program used to link files during compilation process. # it should be declared as ASSEMBLER in the OS section of the .oil file. # default is 'gcc' % if OS::BUILD_S::ASSEMBLER == "as_undef" then %AS ?= gcc% else %AS = % !OS::BUILD_S::ASSEMBLER end if % ############################################################################# # TRAMPOLINE CONFIGURATION ############################################################################# # Trampoline root path to source code. # it should be declared as TRAMPOLINE_BASE_PATH # in the OS section of the .oil file. TPL_BASE_PATH = % !OS::BUILD_S::TRAMPOLINE_BASE_PATH % # Target is given in goil command line when generating the Makefile. # If you update the target here, it will be taken into account, and # a new Makefile will be generated with the new target. TARGET = % !TARGET % ARCH = % !ARCH if CHIP != "" then % CHIP = % !CHIP end if if BOARD != "" then % BOARD = % !BOARD end if let MACHINESPATH := OS::BUILD_S::TRAMPOLINE_BASE_PATH+"/machines" let PARTIAL_PATH := MACHINESPATH foreach COMPONENT in TARGETPATHLIST before % MACHINE_INCLUDE_PATH =% do let PARTIAL_PATH := PARTIAL_PATH + "/" + COMPONENT % -I% !PARTIAL_PATH end foreach let PARTIAL_PATH := MACHINESPATH foreach COMPONENT in TARGETPATHLIST before % MACHINE_INCLUDE_MAKEFILE =% do let PARTIAL_PATH := PARTIAL_PATH + "/" + COMPONENT % % !PARTIAL_PATH%/Makefile% end foreach let PARTIAL_PATH := MACHINESPATH foreach COMPONENT in TARGETPATHLIST before % MACHINE_ALL_PATHS =% do let PARTIAL_PATH := PARTIAL_PATH + "/" + COMPONENT % % !PARTIAL_PATH end foreach% # WITH_USECOM is true if COM is used WITH_USECOM = % !trueFalse(USECOM) % # WITH_USEDEBUG is true if DEBUG is used WITH_USEDEBUG = % !trueFalse(OS::DEBUG) % # WITH_SYSTEM_CALL is true when compiling trampoline # with system call support. It is false otherwise WITH_SYSTEM_CALL = % !trueFalse(OS::SYSTEM_CALL) % ############################################################################# # OIL COMPILER CONFIGURATION ############################################################################# # Goil OIL compiler tool configuration. # If the GOIL_TEMPLATE_PATH is commented, the default template path is used # (it can be saved in the .profile file). GOIL_COMPILER = goil% if exists TEMPLATEPATH then % GOIL_TEMPLATE_PATH = % !TEMPLATEPATH end if % ############################################################################# # DOCUMENTATION GENERATION ############################################################################# # The doxygen tool is used to extract both user and developpment # documentation from the source code. # See http://www.stack.nl/~dimitri/doxygen/ # You should also install Graphviz dot tool to build dependancy graph in # the documentation: # see http://www.graphviz.org/ DOXYGEN = doxygen ############################################################################# # TARGET SPECIFIC STUFF ############################################################################# % template if exists Makefile_specific % ############################################################################# # KERNEL FILE LIST ############################################################################# % let KERNEL_MAP := mapof KERNEL by NAME foreach file in KERNEL_MAP["osek_kernel"]::FILE do % SOURCES += % !file::VALUE end foreach if USECOM then foreach file in KERNEL_MAP["com_kernel"]::FILE do % SOURCES += % !file::VALUE end foreach end if if OS::SCALABILITYCLASS > 0 then foreach file in KERNEL_MAP["autosar_kernel"]::FILE do % SOURCES += % !file::VALUE end foreach end if if exists OS::TIMINGPROTECTION default (false) then % SOURCES += tpl_as_timing_protec.c tpl_as_protec_hook.c% end if % ############################################################################# # SYSTEM CALL FILE LIST ############################################################################# % foreach service_set in APIUSED do foreach file in service_set::FILE do % SOURCES += % !file::VALUE %.c% end foreach end foreach % ############################################################################# # call Trampoline makefile rules. ############################################################################# # Call main Trampoline Makefile OS_MAKE_PATH = $(TPL_BASE_PATH)/make include $(OS_MAKE_PATH)/Makefile # vim:ft=make