]> rtime.felk.cvut.cz Git - pes-rpp/rpp-simulink.git/blob - rpp/rpp/target_tools.mk
doc: Update documentation of external mode and related stuff
[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 # This document contains proprietary information belonging to Czech
7 # Technical University in Prague. Passing on and copying of this
8 # document, and communication of its contents is not permitted
9 # without prior written authorization.
10 #
11 # File : target_tools.mk
12 # Abstract:
13 #     Makefile for CCS toolchain support.
14 #
15 #     This file set variables to CCS tools to support build for this toolchain.
16 #     This file is included by rpp.tmf before declaring the rules for source
17 #     code.
18 #
19 # References:
20 #     "Include a tool specification settings" comment block in rpp.tmf
21 #      Compiler options documentation available in refs/armcl.pdf
22
23
24 include $(START_DIR)/slprj/target_paths.mk
25 include $(RPP_LIB_ROOT)/Makefile.config
26
27 # ARM_COMPILER_DIR is needed by Makefile.rules
28 ARM_COMPILER_DIR = $(COMPILER_ROOT)
29 include $(RPP_LIB_ROOT)/build/Makefile.rules
30
31 # RPP options
32 RPP_STATIC_LIB   = rpp-lib.lib
33
34 # Options for target source files
35 TARGET_INCS      =
36 TARGET_SRCS      =
37
38 # Compiler command and options - use CC and RPP_CFLAGS from Makefile.rules
39 #CC      := "$(COMPILER_ROOT)/bin/armcl"
40 CFLAGS  = $(RPP_CFLAGS) -O2
41
42 # Define when external mode should wait for host connection
43 # CFLAGS += -DON_TARGET_WAIT_FOR_START
44
45 CFLAGS          += $(EXT_CC_OPTS)
46 CFLAGS          += $(OPTS)
47 CDEBUG           = -g
48 CCOUTPUTFLAG     = --output_file=
49
50 CXX              =
51 CXXFLAGS         =
52 CXXDEBUG         =
53
54 # Linker command and options
55 LD      = $(CC)
56 LDFLAGS = $(TARGET_CFLAGS)                                                                                              \
57           -O2 --diag_warning=225 --display_error_number                 \
58           --enum_type=packed --run_linker -m"$(MODEL).map" $(TARGET_LDFLAGS)  \
59           --diag_wrap=on --stack_size=$(RPP_STACK_SIZE)                 \
60           --heap_size=$(RPP_HEAP_SIZE) --reread_libs --warn_sections    \
61           --display_error_number --rom_model                            \
62           --search_path="$(RPP_LIB_ROOT)"                               \
63           --library="$(RPP_STATIC_LIB)"                                 \
64           --retain="$(RPP_STATIC_LIB)<sys_intvecs.obj>(.intvecs)"       \
65           --search_path="$(COMPILER_ROOT)/lib"                          \
66           $(TARGET_LDLIBS)                                                                                              \
67           "$(RPP_LIB_ROOT)/build/$(TARGET)/$(TARGET_LDCMD)"                             \
68           --generate_dead_funcs_list=$(MODEL)-deadfuncs.xml
69
70 LDDEBUG          = -g
71 LDOUTPUTFLAG     = --output_file=
72
73 # Archiver command and options
74 AR               = "$(COMPILER_ROOT)/bin/armar"
75 ARFLAGS          = -r
76
77 # Binary file format converter command and options
78 ifeq ($(OS),Windows_NT)
79 OBJCOPY          = copy
80 else
81 OBJCOPY          = cp
82 endif
83 OBJCOPYFLAGS     =
84
85 # Specify the output extension from compiler
86 OBJ_EXT          = .obj
87
88 # Specify extension from linker
89 PROGRAM_FILE_EXT = .o
90
91 # Specify extension for final product at end of build
92 EXE_FILE_EXT     = .out