]> rtime.felk.cvut.cz Git - pes-rpp/rpp-simulink.git/blob - rpp/rpp/target_tools.mk
Change license to MIT
[pes-rpp/rpp-simulink.git] / rpp / rpp / target_tools.mk
1 # Copyright (C) 2013-2015 Czech Technical University in Prague
2 #
3 # Authors:
4 #     - Carlos Jenkins <carlos@jenkins.co.cr>
5 #
6 # Permission is hereby granted, free of charge, to any person
7 # obtaining a copy of this software and associated documentation
8 # files (the "Software"), to deal in the Software without
9 # restriction, including without limitation the rights to use,
10 # copy, modify, merge, publish, distribute, sublicense, and/or sell
11 # copies of the Software, and to permit persons to whom the
12 # Software is furnished to do so, subject to the following
13 # conditions:
14
15 # The above copyright notice and this permission notice shall be
16 # included in all copies or substantial portions of the Software.
17
18 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20 # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 # OTHER DEALINGS IN THE SOFTWARE.
26 #
27 # File : target_tools.mk
28 # Abstract:
29 #     Makefile for CCS toolchain support.
30 #
31 #     This file set variables to CCS tools to support build for this toolchain.
32 #     This file is included by rpp.tmf before declaring the rules for source
33 #     code.
34 #
35 # References:
36 #     "Include a tool specification settings" comment block in rpp.tmf
37 #      Compiler options documentation available in refs/armcl.pdf
38
39
40 include $(START_DIR)/slprj/target_paths.mk
41 include $(RPP_LIB_ROOT)/Makefile.config
42
43 # ARM_COMPILER_DIR is needed by Makefile.rules
44 ARM_COMPILER_DIR = $(COMPILER_ROOT)
45 include $(RPP_LIB_ROOT)/build/Makefile.rules
46
47 # RPP options
48 RPP_STATIC_LIB   = rpp-lib.lib
49
50 # Options for target source files
51 TARGET_INCS      =
52 TARGET_SRCS      =
53
54 # Compiler command and options - use CC and RPP_CFLAGS from Makefile.rules
55 #CC      := "$(COMPILER_ROOT)/bin/armcl"
56 CFLAGS  = $(RPP_CFLAGS) -O2
57
58 # Define when external mode should wait for host connection
59 # CFLAGS += -DON_TARGET_WAIT_FOR_START
60
61 CFLAGS          += $(EXT_CC_OPTS)
62 CFLAGS          += $(OPTS)
63 CDEBUG           = -g
64 CCOUTPUTFLAG     = --output_file=
65
66 CXX              =
67 CXXFLAGS         =
68 CXXDEBUG         =
69
70 # Linker command and options
71 LD      = $(CC)
72 LDFLAGS = $(TARGET_CFLAGS)                                                                                              \
73           -O2 --diag_warning=225 --display_error_number                 \
74           --enum_type=packed --run_linker -m"$(MODEL).map" $(TARGET_LDFLAGS)  \
75           --diag_wrap=on --stack_size=$(RPP_STACK_SIZE)                 \
76           --heap_size=$(RPP_HEAP_SIZE) --reread_libs --warn_sections    \
77           --display_error_number --rom_model                            \
78           --search_path="$(RPP_LIB_ROOT)"                               \
79           --library="$(RPP_STATIC_LIB)"                                 \
80           --retain="$(RPP_STATIC_LIB)<sys_intvecs.obj>(.intvecs)"       \
81           --search_path="$(COMPILER_ROOT)/lib"                          \
82           $(TARGET_LDLIBS)                                                                                              \
83           "$(RPP_LIB_ROOT)/build/$(TARGET)/$(TARGET_LDCMD)"                             \
84           --generate_dead_funcs_list=$(MODEL)-deadfuncs.xml
85
86 LDDEBUG          = -g
87 LDOUTPUTFLAG     = --output_file=
88
89 # Archiver command and options
90 AR               = "$(COMPILER_ROOT)/bin/armar"
91 ARFLAGS          = -r
92
93 # Binary file format converter command and options
94 ifeq ($(OS),Windows_NT)
95 OBJCOPY          = copy
96 else
97 OBJCOPY          = cp
98 endif
99 OBJCOPYFLAGS     =
100
101 # Specify the output extension from compiler
102 OBJ_EXT          = .obj
103
104 # Specify extension from linker
105 PROGRAM_FILE_EXT = .o
106
107 # Specify extension for final product at end of build
108 EXE_FILE_EXT     = .out