diff options
author | Juergen Haug | 2015-08-16 21:49:49 +0000 |
---|---|---|
committer | Juergen Haug | 2015-08-16 21:49:49 +0000 |
commit | 6f0208a1127f4f56f085044ed4cacb32c78be862 (patch) | |
tree | 5cb37a9f9ff957f8fba5fc30dd2e2f590d2dcddb /runtime/org.eclipse.etrice.runtime.c | |
parent | b60e224ecf3eddd9e93fd44308769f84ffc19744 (diff) | |
download | org.eclipse.etrice-6f0208a1127f4f56f085044ed4cacb32c78be862.tar.gz org.eclipse.etrice-6f0208a1127f4f56f085044ed4cacb32c78be862.tar.xz org.eclipse.etrice-6f0208a1127f4f56f085044ed4cacb32c78be862.zip |
[runtime.c] added makefile build
Change-Id: I132524215fa591b5fc7e1387f7a65d71bacf6418
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.c')
7 files changed, 287 insertions, 5 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.c/.cproject b/runtime/org.eclipse.etrice.runtime.c/.cproject index eab210cb1..4b64a3634 100644 --- a/runtime/org.eclipse.etrice.runtime.c/.cproject +++ b/runtime/org.eclipse.etrice.runtime.c/.cproject @@ -9,6 +9,7 @@ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/common"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/config"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW"/> + <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/util"/> <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/WindowsMinGW"/> <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.c" srcPrefixMapping="" srcRootPath=""/> </externalSetting> @@ -39,8 +40,8 @@ <option id="gnu.c.compiler.option.include.paths.1375092420" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/common}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/config}""/> - <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/platforms/MT_WIN_MinGW}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/util}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/platforms/MT_WIN_MinGW}""/> </option> <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.316560634" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> </tool> @@ -49,7 +50,7 @@ </toolChain> </folderInfo> <sourceEntries> - <entry excluding="src/platforms/MT_32Bit_FreeRTOS_Generic|src/platforms/ST_XMC4500_DaveCE_Generic|src/platforms/ST_MSP430_G2553_CCS5_LaunchPad|src/platforms/ST_MSP430_F5438_CCS5_HWElevator|src/platforms/ST_MSP430_F5438_CCS5_EXP430F5438|src/platforms/ST_CoretexM3_Euros_GCCELF_SK_FM3_176PMC_Ethernet|src/platforms/ST_32Bit_Generic|src/platforms/MT_POSIX_GENERIC_GCC|src/platforms/MT_MSP430_F5438_FreeRTOS_CCS5_HWElevator" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> + <entry excluding="src/platforms/MT_32Bit_FreeRTOS_Generic|src/platforms/ST_XMC4500_DaveCE_Generic|src/platforms/ST_MSP430_G2553_CCS5_LaunchPad|src/platforms/MT_POSIX_GENERIC_GCC|src/platforms/ST_MSP430_F5438_CCS5_HWElevator|src/platforms/ST_MSP430_F5438_CCS5_EXP430F5438|src/platforms/MT_MSP430_F5438_FreeRTOS_CCS5_HWElevator|src/platforms/ST_CoretexM3_Euros_GCCELF_SK_FM3_176PMC_Ethernet|src/platforms/ST_32Bit_Generic" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> </sourceEntries> </configuration> </storageModule> @@ -63,6 +64,7 @@ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/common"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/config"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC"/> + <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/util"/> <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/LinuxPosix"/> <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.c" srcPrefixMapping="" srcRootPath=""/> </externalSetting> @@ -76,7 +78,7 @@ </extensions> </storageModule> <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.294295052" name="LinuxPosix" parent="cdt.managedbuild.config.gnu.mingw.lib.debug"> + <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.294295052" name="LinuxPosix" parent="cdt.managedbuild.config.gnu.mingw.lib.debug"> <folderInfo id="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.294295052." name="/" resourcePath=""> <toolChain id="cdt.managedbuild.toolchain.gnu.base.930702274" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base"> <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.1321111210" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/> @@ -90,6 +92,7 @@ <option id="gnu.c.compiler.option.include.paths.1660194049" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/common}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/config}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/src/util}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/platforms/MT_POSIX_GENERIC_GCC}""/> </option> <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.1123878180" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/> @@ -104,7 +107,66 @@ </toolChain> </folderInfo> <sourceEntries> - <entry excluding="src/platforms/MT_32Bit_FreeRTOS_Generic|src/platforms/MT_WIN_MinGW|src/platforms/ST_XMC4500_DaveCE_Generic|src/platforms/ST_MSP430_G2553_CCS5_LaunchPad|src/platforms/ST_MSP430_F5438_CCS5_HWElevator|src/platforms/ST_MSP430_F5438_CCS5_EXP430F5438|src/platforms/ST_CoretexM3_Euros_GCCELF_SK_FM3_176PMC_Ethernet|src/platforms/ST_32Bit_Generic|src/platforms/MT_MSP430_F5438_FreeRTOS_CCS5_HWElevator" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> + <entry excluding="src/platforms/MT_32Bit_FreeRTOS_Generic|src/platforms/ST_XMC4500_DaveCE_Generic|src/platforms/ST_MSP430_G2553_CCS5_LaunchPad|src/platforms/MT_WIN_MinGW|src/platforms/ST_MSP430_F5438_CCS5_HWElevator|src/platforms/ST_MSP430_F5438_CCS5_EXP430F5438|src/platforms/MT_MSP430_F5438_FreeRTOS_CCS5_HWElevator|src/platforms/ST_CoretexM3_Euros_GCCELF_SK_FM3_176PMC_Ethernet|src/platforms/ST_32Bit_Generic" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> + </sourceEntries> + </configuration> + </storageModule> + <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> + </cconfiguration> + <cconfiguration id="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.18376023"> + <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.18376023" moduleId="org.eclipse.cdt.core.settings" name="ExternalMakefile"> + <externalSettings> + <externalSetting> + <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.c"/> + <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/common"/> + <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/config"/> + <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW"/> + <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/util"/> + <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/ExternalMakefile"/> + <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c"/> + <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/buildTools"/> + <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.c" srcPrefixMapping="" srcRootPath=""/> + </externalSetting> + </externalSettings> + <extensions> + <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/> + <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> + <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> + </extensions> + </storageModule> + <storageModule moduleId="cdtBuildSystem" version="4.0.0"> + <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.18376023" name="ExternalMakefile" parent="cdt.managedbuild.config.gnu.mingw.lib.debug"> + <folderInfo id="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.18376023." name="/" resourcePath=""> + <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.lib.debug.1317763190" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.lib.debug"> + <targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.lib.debug.1009481846" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.lib.debug"/> + <builder autoBuildTarget="all" buildPath="${workspace_loc:/org.eclipse.etrice.runtime.c}" cleanBuildTarget="clean" enableAutoBuild="false" enableCleanBuild="true" enabledIncrementalBuild="true" id="cdt.managedbuild.target.gnu.builder.base.165982334" incrementalBuildTarget="build" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="false" superClass="cdt.managedbuild.target.gnu.builder.base"/> + <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.lib.debug.1640372698" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.lib.debug"> + <inputType id="cdt.managedbuild.tool.gnu.assembler.input.2119013694" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> + </tool> + <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.lib.debug.226708852" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.lib.debug"/> + <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.debug.2050526925" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.lib.debug"> + <option id="gnu.cpp.compiler.mingw.lib.debug.option.optimization.level.371457215" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.lib.debug.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> + <option id="gnu.cpp.compiler.mingw.lib.debug.option.debugging.level.241076012" name="Debug Level" superClass="gnu.cpp.compiler.mingw.lib.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> + </tool> + <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug.354393464" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug"> + <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.lib.debug.option.optimization.level.1064029306" name="Optimization Level" superClass="gnu.c.compiler.mingw.lib.debug.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/> + <option id="gnu.c.compiler.mingw.lib.debug.option.debugging.level.1609123346" name="Debug Level" superClass="gnu.c.compiler.mingw.lib.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/> + <option id="gnu.c.compiler.option.include.paths.136770196" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath"> + <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/common}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/config}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/src/util}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/platforms/MT_WIN_MinGW}""/> + </option> + <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1429574570" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> + </tool> + <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.base.958536019" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.base"/> + <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base.1310847882" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base"/> + </toolChain> + </folderInfo> + <sourceEntries> + <entry excluding="src/platforms/MT_32Bit_FreeRTOS_Generic|src/platforms/ST_XMC4500_DaveCE_Generic|src/platforms/ST_MSP430_G2553_CCS5_LaunchPad|src/platforms/MT_POSIX_GENERIC_GCC|src/platforms/ST_MSP430_F5438_CCS5_HWElevator|src/platforms/ST_MSP430_F5438_CCS5_EXP430F5438|src/platforms/MT_MSP430_F5438_FreeRTOS_CCS5_HWElevator|src/platforms/ST_CoretexM3_Euros_GCCELF_SK_FM3_176PMC_Ethernet|src/platforms/ST_32Bit_Generic" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> </sourceEntries> </configuration> </storageModule> @@ -121,6 +183,9 @@ <configuration configurationName="MinGWDebug"> <resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.runtime.c"/> </configuration> + <configuration configurationName="ExternalMakefile"> + <resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.runtime.c"/> + </configuration> <configuration configurationName="Debug"> <resource resourceType="PROJECT" workspacePath="/org.eclipse.etrice.runtime.c"/> </configuration> @@ -128,10 +193,13 @@ <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> <storageModule moduleId="scannerConfiguration"> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> + <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.294295052;cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.294295052.;cdt.managedbuild.tool.gnu.c.compiler.base.183127152;cdt.managedbuild.tool.gnu.c.compiler.input.2145340965"> + <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> + </scannerConfigBuildInfo> <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919;cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.;cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug.62527096;cdt.managedbuild.tool.gnu.c.compiler.input.316560634"> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> </scannerConfigBuildInfo> - <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.294295052;cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.294295052.;cdt.managedbuild.tool.gnu.c.compiler.base.183127152;cdt.managedbuild.tool.gnu.c.compiler.input.2145340965"> + <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.18376023;cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.18376023.;cdt.managedbuild.tool.gnu.c.compiler.mingw.lib.debug.354393464;cdt.managedbuild.tool.gnu.c.compiler.input.1429574570"> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> </scannerConfigBuildInfo> </storageModule> diff --git a/runtime/org.eclipse.etrice.runtime.c/.settings/org.eclipse.cdt.core.prefs b/runtime/org.eclipse.etrice.runtime.c/.settings/org.eclipse.cdt.core.prefs new file mode 100644 index 000000000..5202ded41 --- /dev/null +++ b/runtime/org.eclipse.etrice.runtime.c/.settings/org.eclipse.cdt.core.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.18376023/append=true +environment/project/cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.18376023/appendContributed=true diff --git a/runtime/org.eclipse.etrice.runtime.c/Makefile b/runtime/org.eclipse.etrice.runtime.c/Makefile new file mode 100644 index 000000000..c5762a1b3 --- /dev/null +++ b/runtime/org.eclipse.etrice.runtime.c/Makefile @@ -0,0 +1,17 @@ +include buildTools/defaults.mk + +DIR_COMMON := ./src/common +DIR_CONFIG := ./src/config +DIR_UTIL := ./src/util +DIR_PLATFORM := ./src/platforms/${TARGET_PLATFORM} +RUNTIME_INCDIRS := ${DIR_COMMON} ${DIR_CONFIG} ${DIR_UTIL} ${DIR_PLATFORM} + + +IN_TARGET := lib$(notdir $(shell pwd)).a +IN_INCDIRS := ${RUNTIME_INCDIRS} +IN_SRCDIRS_REC := ${RUNTIME_INCDIRS} + +include buildTools/Makefile.mk + + + diff --git a/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile b/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile new file mode 100644 index 000000000..2122ddab0 --- /dev/null +++ b/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile @@ -0,0 +1,45 @@ +# environment variables: RUNTIME_ROOTDIR, MODELLIB_ROOTDIR, TARGET_PLATFORM, TARGET_BUILD_DIR, ECLIPSE_MODE +# default is windows mingw + +# CDT Environment: +# RUNTIME_ROOTDIR: ${workspace_loc:org.eclipse.etrice.runtime.c} +# MODELLIB_ROOTDIR: ${workspace_loc:org.eclipse.etrice.modellib.c} + +ifeq ($(strip ${RUNTIME_ROOTDIR}),) + RUNTIME_ROOTDIR := ../org.eclipse.etrice.runtime.c +endif +ifeq ($(strip ${MODELLIB_ROOTDIR}),) + MODELLIB_ROOTDIR := ../org.eclipse.etrice.modellib.c +endif + +include ${MODELLIB_ROOTDIR}/buildTools/modellib.mk +include ${RUNTIME_ROOTDIR}/buildTools/runtime.mk + +# --- +IN_TARGET := $(notdir $(shell pwd)).exe +IN_INCDIRS += ./src-gen ./src +IN_SRCDIRS_REC += ./src-gen ./src +#--- + +# Do NOT set IN_XX as make paramater or environment variable, +# instead make variables from outside explicit: +# IN_TARGET := ${APP_TARGET} +# IN_INCDIRS += ${APP_INCDIRS} +# IN_SRCDIRS_REC += ${APP_SRCDIRS_REC} + +# All options: +#IN_TARGET +#IN_TARGET_DIR +#IN_BUILD_DIR +#IN_TARGET_PLATFORM +#IN_INCDIRS +#IN_SRCDIRS_REC +#IN_SOURCES +#IN_CFLAGS +#IN_DEFS +#IN_LDFLAGS +#IN_LDLIBS +#IN_PREREQS + +# Create rules +include ${RUNTIME_ROOTDIR}/buildTools/Makefile.mk
\ No newline at end of file diff --git a/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile.mk b/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile.mk new file mode 100644 index 000000000..b30d42731 --- /dev/null +++ b/runtime/org.eclipse.etrice.runtime.c/buildTools/Makefile.mk @@ -0,0 +1,86 @@ +# CANONICAL_PATH - Given one or more paths, converts the paths to the canonical +# form. The canonical form is the path, relative to the project's top-level +# directory (the directory from which "make" is run), and without +# any "./" or "../" sequences. For paths that are not located below the +# top-level directory, the canonical form is the absolute path (i.e. from +# the root of the filesystem) also without "./" or "../" sequences. +define CANONICAL_PATH +$(patsubst ${CURDIR}/%,%,$(abspath ${1})) +endef + +# USE WITH EVAL +define TARGET_RULE + ifeq "$$(suffix $${M_TARGET})" ".a" + # static library + $${M_TARGET}: $${M_OBJS} + @mkdir -p $$(dir $$@) + $$(strip $${AR} $${ARFLAGS} $${M_TARGET_DIR}/$$@ $${M_OBJS}) + else + # executable + $${M_TARGET}: $${M_OBJS} $${M_PREREQS} + @mkdir -p $$(dir $$@) + $$(strip $${CC} -o $${M_TARGET_DIR}/$$@ $${M_LDFLAGS} $${M_OBJS} $${M_LDLIBS} ) + endif +endef + +ifeq ($(strip ${IN_BUILD_DIR}),) + IN_BUILD_DIR := ${TARGET_BUILD_DIR} +endif + +ifeq ($(strip ${IN_TARGET_DIR}),) + IN_TARGET_DIR := ${IN_BUILD_DIR} +endif + +# Locals, no override +M_TARGET := ${IN_TARGET} +M_TARGET_DIR := ${IN_TARGET_DIR} +M_BUILD_DIR := ${IN_BUILD_DIR} +M_INCDIRS := ${IN_INCDIRS} +M_SRCDIRS_REC := ${IN_SRCDIRS_REC} +M_SOURCES := ${IN_SOURCES} +M_CFLAGS := ${IN_CFLAGS} +M_DEFS := ${IN_DEFS} +M_LDFLAGS := ${IN_LDFLAGS} +M_LDLIBS := ${IN_LDLIBS} +M_PREREQS := ${IN_PREREQS} +M_OBJS := + + +# add sources from M_SRCDIRS_REC +_TRAVERSECHILDREN = ${1} $(foreach CHILD,$(filter-out ${1}/,$(sort $(dir $(wildcard ${1}/*/)))),$(call ${0},$(patsubst %/,%,${CHILD}))) +_RECDIRS := $(foreach BASEDIR, ${M_SRCDIRS_REC}, $(call _TRAVERSECHILDREN, $(patsubst %/,%,${BASEDIR}))) +M_SOURCES += $(foreach DIR, ${_RECDIRS}, $(wildcard ${DIR}/*.c)) + +M_DEFS := $(addprefix -D,${M_DEFS}) +M_INCDIRS := $(addprefix -I,$(call CANONICAL_PATH,${M_INCDIRS})) +M_SOURCES := $(call CANONICAL_PATH,${M_SOURCES}) + +# Convert the source file names to their corresponding object file names. +M_OBJS := $(addprefix ${M_BUILD_DIR}/,$(addsuffix .o,$(basename ${M_SOURCES}))) + +${M_BUILD_DIR}/%.o: %.c + @mkdir -p $(dir $@) + $(strip ${CC} -o $@ -c ${M_CFLAGS} ${M_SRC_CFLAGS} ${M_INCDIRS} \ + ${M_SRC_INCDIRS} ${M_SRC_DEFS} ${M_DEFS} $<) + + +.PHONY: build clean-all + +all: clean build # CDT default + +build: ${M_TARGET} # see M_PREREQS in target rule + +$(eval $(call TARGET_RULE)) + +clean: clean_${M_TARGET} + +clean_${M_TARGET}: + $(strip rm -f ${M_TARGET_DIR}/${M_TARGET} ${M_OBJS:%.o=%.[doP]}) + +# special clean: delete all mains +clean_build: clean + rm -rf ${M_BUILD_DIR} + +clean-all: clean $(foreach REQ, ${M_PREREQS}, clean_${REQ}) + + diff --git a/runtime/org.eclipse.etrice.runtime.c/buildTools/defaults.mk b/runtime/org.eclipse.etrice.runtime.c/buildTools/defaults.mk new file mode 100644 index 000000000..a8543042d --- /dev/null +++ b/runtime/org.eclipse.etrice.runtime.c/buildTools/defaults.mk @@ -0,0 +1,24 @@ +# Global variables, can be in set environment or overriden +# RUNTIME_ROOTDIR e.g. ${workspace_loc:org.eclipse.etrice.runtime.c} default: ../org.eclipse.etrice.runtime.c +# MODELLIB_ROOTDIR e.g. ${workspace_loc:org.eclipse.etrice.modellib.c} default: ../org.eclipse.etrice.modellib.c +# TARGET_PLATFORM MT_WIN_MinGW|MT_POSIX_GENERIC_GCC default MT_WIN_MinGW +# TARGET_BUILD_DIR automatically derived from TARGET_PLATFORM +# ECLIPSE_MODE if set, makefile won't build modellib and runtime (let eclipse handle this) + +#ifeq ($(strip ${RUNTIME_ROOTDIR}),) +# RUNTIME_ROOTDIR := ../org.eclipse.etrice.runtime.c +#endif + +#ifeq ($(strip ${MODELLIB_ROOTDIR}),) +# MODELLIB_ROOTDIR := ../org.eclipse.etrice.modellib.c +#endif + +ifeq ($(strip ${TARGET_PLATFORM}),) + TARGET_PLATFORM := MT_WIN_MinGW +endif + +ifeq (${TARGET_PLATFORM},MT_POSIX_GENERIC_GCC) + TARGET_BUILD_DIR := LinuxPosix +else ifeq (${TARGET_PLATFORM},MT_WIN_MinGW) + TARGET_BUILD_DIR := WindowsMinGW +endif
\ No newline at end of file diff --git a/runtime/org.eclipse.etrice.runtime.c/buildTools/runtime.mk b/runtime/org.eclipse.etrice.runtime.c/buildTools/runtime.mk new file mode 100644 index 000000000..4f377f100 --- /dev/null +++ b/runtime/org.eclipse.etrice.runtime.c/buildTools/runtime.mk @@ -0,0 +1,39 @@ +include ${RUNTIME_ROOTDIR}/buildTools/defaults.mk + +# Includes +DIR_COMMON := ${RUNTIME_ROOTDIR}/src/common +DIR_CONFIG := ${RUNTIME_ROOTDIR}/src/config +DIR_UTIL := ${RUNTIME_ROOTDIR}/src/util +DIR_PLATFORM := ${RUNTIME_ROOTDIR}/src/platforms/${TARGET_PLATFORM} +RUNTIME_INCDIRS := ${DIR_COMMON} ${DIR_CONFIG} ${DIR_UTIL} ${DIR_PLATFORM} + + +IN_INCDIRS += ${RUNTIME_INCDIRS} + +IN_LDFLAGS += -L${RUNTIME_ROOTDIR}/${TARGET_BUILD_DIR} +IN_LDLIBS += -lorg.eclipse.etrice.runtime.c +ifeq ($(strip ${ECLIPSE_MODE}),) + IN_PREREQS += liborg.eclipse.etrice.runtime.c.a +endif + +liborg.eclipse.etrice.runtime.c.a: + ${MAKE} -C ${RUNTIME_ROOTDIR} build + +clean_liborg.eclipse.etrice.runtime.c.a: + ${MAKE} -C ${RUNTIME_ROOTDIR} clean + +# Linker flags +ifeq (${TARGET_PLATFORM},MT_POSIX_GENERIC_GCC) +IN_LDLIBS += -lpthread -lrt -lm +else ifeq (${TARGET_PLATFORM},MT_WIN_MinGW) +IN_LDLIBS += -lws2_32 +endif + + + + + + + + + |