]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/blobdiff - rpp/rpp/target_tools.mk
Change license to MIT
[jenkicar/rpp-simulink.git] / rpp / rpp / target_tools.mk
index 33dc9a8cbaa733d77a8bd6dc5835f33c5b8a0ef8..314436dbd81cff993f2b27bd6913bde973eab3e6 100644 (file)
-# Copyright (C) 2013 Czech Technical University in Prague\r
-#\r
-# Authors:\r
-#      - Carlos Jenkins <carlos@jenkins.co.cr>\r
-#\r
-# This program is free software; you can redistribute it and/or modify\r
-# it under the terms of the GNU General Public License as published by\r
-# the Free Software Foundation; either version 2 of the License, or\r
-# (at your option) any later version.\r
-#\r
-# This program is distributed in the hope that it will be useful,\r
-# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-# GNU General Public License for more details.\r
-#\r
-# You should have received a copy of the GNU General Public License\r
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
-#\r
-# File : rpp_srmain.tlc\r
-# Abstract:\r
-#       ?????\r
-#       Reference: ???\r
-\r
-\r
-##########################\r
-# TODO: Adapt file\r
-##########################\r
-\r
-#include $(START_DIR)/slprj/arduino_prefs.mk\r
-\r
-#LOCAL_AVR_TOOLS_PATH = $(ARDUINO_ROOT)/hardware/tools/avr/bin/\r
-\r
-#LOCAL_OPT = -Os\r
-#LOCAL_CDEFS = -DF_CPU=$(F_CPU)\r
-#LOCAL_CXXDEFS = -DF_CPU=$(F_CPU)\r
-#LOCAL_CSTANDARD = -std=gnu99\r
-#LOCAL_CWARN = -Wall -Wstrict-prototypes\r
-#LOCAL_MCU_OPT = -mmcu=$(MCU)\r
-#CDEBUG = -gstabs\r
-\r
-## Compiler command and options\r
-#CC                  = $(LOCAL_AVR_TOOLS_PATH)/avr-gcc\r
-#CFLAGS = $(LOCAL_MCU_OPT) -I. $(LOCAL_CDEFS)\r
-#CFLAGS += $(LOCAL_OPT) $(LOCAL_CWARN) $(LOCAL_CSTANDARD)\r
-\r
-## Specify the output extension from compiler\r
-#CCOUTPUTFLAG        = -o\r
-#OBJ_EXT             = .o\r
-\r
-#CXX                 = $(LOCAL_AVR_TOOLS_PATH)/avr-g++\r
-#CXXFLAGS            = $(LOCAL_MCU_OPT) -I. $(LOCAL_CXXDEFS) $(LOCAL_OPT)\r
-\r
-## Linker command and options\r
-#LD                  = $(LOCAL_AVR_TOOLS_PATH)/avr-gcc\r
-#LDFLAGS = $(LOCAL_MCU_OPT) $(LOCAL_CDEFS) $(LOCAL_OPT) $(LOCAL_CWARN) $(LOCAL_CSTANDARD) -lm -Wl,-Map,mapFile.map,--cref\r
-\r
-## Specify extension from linker\r
-#LDOUTPUTFLAG        = -o\r
-#PROGRAM_FILE_EXT    = .elf\r
-\r
-## Archiver command and options\r
-#AR                  = $(LOCAL_AVR_TOOLS_PATH)/avr-ar\r
-#ARFLAGS             = rcs\r
-\r
-## Binary file format converter command and options\r
-#OBJCOPY             = $(LOCAL_AVR_TOOLS_PATH)/avr-objcopy\r
-#OBJCOPYFLAGS        = -O ihex -R .eeprom\r
-#BINARY_FILE_EXT     = .hex\r
-\r
-## Specify extension for final product at end of build\r
-#EXE_FILE_EXT = $(BINARY_FILE_EXT)\r
-\r
-#TARGET_INC_DIR      = $(ARDUINO_ROOT)/hardware/arduino/cores/arduino\r
-#TARGET_INCS         = -I$(TARGET_INC_DIR)\r
-#TARGET_SRC_DIR      = $(ARDUINO_ROOT)/hardware/arduino/cores/arduino\r
-#LOCAL_ARDUINO_SRCS  = $(notdir $(wildcard $(TARGET_SRC_DIR)/*.cpp)) $(notdir $(wildcard $(TARGET_SRC_DIR)/*.c))\r
-#TARGET_SRCS         = $(filter-out main.cpp,$(LOCAL_ARDUINO_SRCS))\r
-\r
+# Copyright (C) 2013-2015 Czech Technical University in Prague
+#
+# Authors:
+#     - Carlos Jenkins <carlos@jenkins.co.cr>
+#
+# 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:
+#     Makefile for CCS toolchain support.
+#
+#     This file set variables to CCS tools to support build for this toolchain.
+#     This file is included by rpp.tmf before declaring the rules for source
+#     code.
+#
+# References:
+#     "Include a tool specification settings" comment block in rpp.tmf
+#      Compiler options documentation available in refs/armcl.pdf
+
+
+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
+
+# Options for target source files
+TARGET_INCS      =
+TARGET_SRCS      =
+
+# 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
+
+CFLAGS          += $(EXT_CC_OPTS)
+CFLAGS          += $(OPTS)
+CDEBUG           = -g
+CCOUTPUTFLAG     = --output_file=
+
+CXX              =
+CXXFLAGS         =
+CXXDEBUG         =
+
+# Linker command and options
+LD      = $(CC)
+LDFLAGS = $(TARGET_CFLAGS)                                                                                             \
+          -O2 --diag_warning=225 --display_error_number                 \
+          --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                            \
+          --search_path="$(RPP_LIB_ROOT)"                               \
+          --library="$(RPP_STATIC_LIB)"                                 \
+          --retain="$(RPP_STATIC_LIB)<sys_intvecs.obj>(.intvecs)"       \
+          --search_path="$(COMPILER_ROOT)/lib"                          \
+          $(TARGET_LDLIBS)                                                                                             \
+          "$(RPP_LIB_ROOT)/build/$(TARGET)/$(TARGET_LDCMD)"                            \
+          --generate_dead_funcs_list=$(MODEL)-deadfuncs.xml
+
+LDDEBUG          = -g
+LDOUTPUTFLAG     = --output_file=
+
+# Archiver command and options
+AR               = "$(COMPILER_ROOT)/bin/armar"
+ARFLAGS          = -r
+
+# Binary file format converter command and options
+ifeq ($(OS),Windows_NT)
+OBJCOPY          = copy
+else
+OBJCOPY          = cp
+endif
+OBJCOPYFLAGS     =
+
+# Specify the output extension from compiler
+OBJ_EXT          = .obj
+
+# Specify extension from linker
+PROGRAM_FILE_EXT = .o
+
+# Specify extension for final product at end of build
+EXE_FILE_EXT     = .out