]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - build/Makefile.arm.inc
rpp-test-suite: Remove various garbage files
[pes-rpp/rpp-lib.git] / build / Makefile.arm.inc
1 # Copyright (C) 2013-2015 Czech Technical University in Prague
2 #
3 # Authors:
4 #     - Michal Sojka <sojkam1@fel.cvut.cz>
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 : Makefile.arm.rules
12 #
13 # This file is meant to be included by Makefiles in build directories
14 # for ARM platforms.
15
16 makefile_arm_inc_dir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
17
18 ifeq ($(TARGET_CFLAGS),)
19 $(error "Makefile.config must be included before this file")
20 endif
21
22 # Code composer studio sets this variable when it invokes make. Let's use it
23 # as a hint for where is the compiler installed.
24 CCS_UTILS_DIR ?= /opt/ti/ccsv5/utils
25
26 ARM_COMPILER_DIR ?= $(dir $(CCS_UTILS_DIR))/tools/compiler/arm_5.1.1
27
28 ifeq ($(wildcard $(CCS_UTILS_DIR)),)
29 define msg
30 '$(CCS_UTILS_DIR)' directory does not exist.
31 Please set CCS_UTILS_DIR variable, e.g. by running 'make CCS_UTILS_DIR=$$HOME/ti/ccsv5/utils'
32 endef
33 $(error $(msg))
34 endif
35
36 include $(makefile_arm_inc_dir)/../common.mk
37
38 CC=$(ARM_COMPILER_DIR)/bin/armcl
39 AR=$(ARM_COMPILER_DIR)/bin/armar
40 LD=$(CC)
41
42 # Include definition of $(rpp_lib_INCLUDES)
43 include $(makefile_arm_inc_dir)/../Makefile.var
44
45 RPP_CFLAGS = $(TARGET_CFLAGS) --gcc -I$(ARM_COMPILER_DIR)/include       \
46                 $(rpp_lib_INCLUDES:%=-I$(makefile_arm_inc_dir)/../%)                    \
47                 --diag_warning=225 --display_error_number --diag_wrap=off               \
48                 --gen_func_subsections=on --enum_type=packed
49
50 RPP_MAKE_CFLAGS = \
51                 --preproc_dependency=$(@:%=%.dep) --obj_directory=$(dir $@)     \
52                 --preproc_with_compile
53
54 define rpp_c_obj_cmds
55         $(call mkdir,$(dir $@))
56         $(CC) $(RPP_CFLAGS) $(RPP_MAKE_CFLAGS) $<
57 endef
58
59 BUILD_DIR ?= Debug
60 RPP_LIB_DIR = $(makefile_arm_inc_dir)/$(TARGET)/$(BUILD_DIR)
61
62 RPP_LDFLAGS = \
63                 --run_linker -m"${@:%=%.map}" $(TARGET_LDFLAGS) --diag_wrap=on  \
64                 --reread_libs --warn_sections --display_error_number                    \
65                 --rom_model --search_path=$(ARM_COMPILER_DIR)/lib                               \
66                 --generate_dead_funcs_list=$(@:%=%.deadfuncs.xml)                               \
67                 --stack_size=0x800
68
69 RPP_LDLIBS = $(TARGET_LDCMD) -l$(RPP_LIB_DIR)/rpp-lib.lib $(TARGET_LDLIBS)
70
71 $(RPP_LIB_DIR)/rpp-lib.lib:
72         $(MAKE) -C $(dir $@)