From daf705210fba563823e887a716c2c0525482360e Mon Sep 17 00:00:00 2001 From: yoogx Date: Fri, 7 Apr 2017 15:52:22 -0400 Subject: [PATCH] * Add support for FreeRTOS For issue #21 --- share/make/Makefile.common.in | 20 +++++++++++++++++--- share/make/Makefile.freertos | 20 ++++---------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/share/make/Makefile.common.in b/share/make/Makefile.common.in index efe3d92..be7dcdb 100644 --- a/share/make/Makefile.common.in +++ b/share/make/Makefile.common.in @@ -5,7 +5,7 @@ CYGPATH_U = @CYGPATH_U@ CYGPATH_W = @CYGPATH_U@ -GCC_GENERIC_CFLAGS= -g -Wall -Wextra -fdiagnostics-show-option -Wcast-align -Wjump-misses-init -Wswitch-enum -fprofile-arcs -ftest-coverage +GCC_GENERIC_CFLAGS= -g -Wall -Wextra -fdiagnostics-show-option -Wcast-align -Wjump-misses-init -Wswitch-enum all: build-node @@ -41,9 +41,9 @@ ifneq ($(USER_LD),) LD=$(USER_LD) endif -CFLAGS=$(TARGET_CFLAGS) $(USER_CFLAGS)$(GCC_GENERIC_CFLAGS) +CFLAGS=$(TARGET_CFLAGS) $(USER_CFLAGS) $(GCC_GENERIC_CFLAGS) CPPFLAGS=$(CFLAGS) $(USER_CPPFLAGS) -LDFLAGS=$(TARGET_LDFLAGS) $(USER_LDFLAGS) -lgcov +LDFLAGS=$(TARGET_LDFLAGS) $(USER_LDFLAGS) ifdef USE_GPROF CFLAGS+=-D__PO_HI_USE_GPROF -pg @@ -356,6 +356,13 @@ $(BINARY): check-linuxtaste generate-asn1-deployment target-objects compile-po-h $(CC) -o $(BINARY) $(EXTERNAL_OBJECTS) $(PO_HI_OBJS) $(GENERATED_OBJS) $(USER_OBJS) $(LDFLAGS) endif +ifeq ($(TARGET), freertos) +OBJS = $(USER_OBJS) $(PO_HI_OBJS) $(GENERATED_OBJS) $(EXTERNAL_OBJECTS) +$(BINARY): generate-asn1-deployment compile-po-hi compile-c-files compile-cpp-files $(USER_OBJS) $(GENERATED_OBJS) $(COMPILE_FREERTOS_OBJ) + $(make-exe) + $(LD) $(LDFLAGS) -T $(AADL_FOLDER)/LinkerScript.ld -o $(EXE).elf $(PO_HI_OBJS) $(GENERATED_OBJS) $(COMPILE_FREERTOS_OBJ) $(USER_OBJS) $(USER_LIBS) +endif + %.o: %.cpp $(CXX) $(INCLUDE) $(CPPFLAGS) -c -o $@ $< @@ -365,6 +372,9 @@ endif %.o: %.c $(CC) $(INCLUDE) $(CFLAGS) -c -o $@ $< +%.o: %.s + $(AS) $(INCLUDE) $(CFLAGS) -c -o $@ $< + clean: #target-clean @-rm -f *~ *.o *.al temp.* *.metrix $(BINARY) $(BINARY).bin $(BINARY).bt $(BINARY).num $(BINARY).nxe b~*.* *.ali *.gcda *.gcno *.log *.xml @-rm -rf drivers @@ -405,6 +415,10 @@ sonar_run: clean make coverage sonar-scanner +export SONAR_PROJECT_DIR=$(PWD)/.. +export SONAR_RESULTS_RELATIVE_PATH=$(shell echo "$(PWD)" | sed 's:$(SONAR_PROJECT_DIR)/::g') +export TEMPLATE_PATH=$(shell sed -e 's:polyorb-hi-c/.*:polyorb-hi-c:' <<< $(PWD)) + ################################################################################ # sonarproperties: generation of configuration file for sonarqube # diff --git a/share/make/Makefile.freertos b/share/make/Makefile.freertos index c41f077..e2cb7ce 100644 --- a/share/make/Makefile.freertos +++ b/share/make/Makefile.freertos @@ -1,16 +1,4 @@ -## This file is a template of a specific Makefile -## for PolyORB-HI-C. The name of the file must respect -## the form Makefile.targetname where targetname -## is the name of the execution platform in the model. - -## This file set some variables useful to compile -## the source code to the target. - -CC = your_c_compiler -CFLAGS = options and flags useful for your compiler -LD = the linker used (not used at this time) -LDFLAGS = flags useful for the link step - -## The target-clean rule is useful if you have to handle -## specific actions to clean the target. -target-clean: +# This file is an empty placeholder for the FreeRTOS target. Given the +# many supported targets of FreeRTOS, and its model of compilation, +# the user has to provide all information in a user-defined +# makefile. See examples for more details. -- GitLab