]> rtime.felk.cvut.cz Git - pes-rpp/rpp-simulink.git/blobdiff - rpp/rpp/target_tools.mk
Change license to MIT
[pes-rpp/rpp-simulink.git] / rpp / rpp / target_tools.mk
index 532887d35849f5d19069844365b531f43560285e..314436dbd81cff993f2b27bd6913bde973eab3e6 100644 (file)
@@ -1,12 +1,28 @@
-# Copyright (C) 2013-2014 Czech Technical University in Prague
+# Copyright (C) 2013-2015 Czech Technical University in Prague
 #
 # Authors:
 #     - Carlos Jenkins <carlos@jenkins.co.cr>
 #
-# This document contains proprietary information belonging to Czech
-# Technical University in Prague. Passing on and copying of this
-# document, and communication of its contents is not permitted
-# without prior written authorization.
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
 #
 # File : target_tools.mk
 # Abstract:
 
 
 include $(START_DIR)/slprj/target_paths.mk
+include $(RPP_LIB_ROOT)/Makefile.config
+
+# ARM_COMPILER_DIR is needed by Makefile.rules
+ARM_COMPILER_DIR = $(COMPILER_ROOT)
+include $(RPP_LIB_ROOT)/build/Makefile.rules
 
 # RPP options
 RPP_STATIC_LIB   = rpp-lib.lib
-RPP_OS_LAYER_INC = $(RPP_LIB_ROOT)/os/7.0.2_tms570/include/
 
 # Options for target source files
 TARGET_INCS      =
 TARGET_SRCS      =
 
-# Compiler command and options
-CC      = "$(COMPILER_ROOT)/bin/armcl"
-CFLAGS  = -mv7R4 -me --code_state=32 --float_support=VFPv3D16           \
-          --abi=eabi --compile_only -O2 --gcc --diag_wrap=on            \
-          --diag_warning=225 --display_error_number                     \
-          --enum_type=packed --gen_func_subsections                     \
-          -DEXTMODE_DISABLEPRINTF                                       \
-          --include_path="$(RPP_LIB_ROOT)/rpp/include"                  \
-          --include_path="$(RPP_LIB_ROOT)/lwip/src/include"             \
-          --include_path="$(RPP_LIB_ROOT)/lwip/src/include/ipv4"        \
-          --include_path="$(RPP_LIB_ROOT)/lwip/src/include/ipv6"        \
-          --include_path="$(RPP_OS_LAYER_INC)"                          \
-          --include_path="$(COMPILER_ROOT)/include"
+# Compiler command and options - use CC and RPP_CFLAGS from Makefile.rules
+#CC      := "$(COMPILER_ROOT)/bin/armcl"
+CFLAGS  = $(RPP_CFLAGS) -O2
 
 # Define when external mode should wait for host connection
 # CFLAGS += -DON_TARGET_WAIT_FOR_START
@@ -59,9 +69,9 @@ CXXDEBUG         =
 
 # Linker command and options
 LD      = $(CC)
-LDFLAGS = -mv7R4 --code_state=32 --float_support=VFPv3D16 --abi=eabi    \
+LDFLAGS = $(TARGET_CFLAGS)                                                                                             \
           -O2 --diag_warning=225 --display_error_number                 \
-          --enum_type=packed --run_linker -m"$(MODEL).map"              \
+          --enum_type=packed --run_linker -m"$(MODEL).map" $(TARGET_LDFLAGS)  \
           --diag_wrap=on --stack_size=$(RPP_STACK_SIZE)                 \
           --heap_size=$(RPP_HEAP_SIZE) --reread_libs --warn_sections    \
           --display_error_number --rom_model                            \
@@ -69,8 +79,8 @@ LDFLAGS = -mv7R4 --code_state=32 --float_support=VFPv3D16 --abi=eabi    \
           --library="$(RPP_STATIC_LIB)"                                 \
           --retain="$(RPP_STATIC_LIB)<sys_intvecs.obj>(.intvecs)"       \
           --search_path="$(COMPILER_ROOT)/lib"                          \
-          --library="rtsv7R4_T_le_v3D16_eabi.lib"                       \
-          "$(RPP_LIB_ROOT)/rpp/TMS570LS313xFlashLnk.cmd"                \
+          $(TARGET_LDLIBS)                                                                                             \
+          "$(RPP_LIB_ROOT)/build/$(TARGET)/$(TARGET_LDCMD)"                            \
           --generate_dead_funcs_list=$(MODEL)-deadfuncs.xml
 
 LDDEBUG          = -g