Init basesystem source codes.
[staging/basesystem.git] / nsframework / framework_unified / client / NativeServices / cfg / PosixBasedOS001_armv7.mk
1 #
2 # @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 # QCC arm COMPILER SETTINGS
18 #  Standard form of tool.mk file configured for PosixBasedOS001 arm v7
19 #  Note: Make sure PosixBasedOS001_HOST is set to install version desired
20
21 # Tools and Options
22 LIB_EXT = a
23 SO_EXT = so
24 LIB_PREFIX = lib
25 OBJ_EXT = o
26 BIN_EXT =
27 CC = ${PosixBasedOS001_HOST}/usr/bin/qcc -c
28 CPP = ${PosixBasedOS001_HOST}/usr/bin/qcc -c
29 AS = ${PosixBasedOS001_HOST}/usr/bin/ntoarmv7-as
30 AR = ${PosixBasedOS001_HOST}/usr/bin/ntoarmv7-ar
31 OBJCPY := ${PosixBasedOS001_HOST}/usr/bin/ntoarmv7-objcopy
32 LD = qcc
33 # Add addtion Linker Flags....
34 # If your application contains c++ code you will need
35 # the -lang-c++
36 LD_CPP = -lang-c++ #-lm
37
38 # Compile options and commands
39 TARGET_FLG = -Vgcc_ntoarmv7le
40
41 # Define Map file Option
42 MAP_FILE_FLG=-M
43
44 # Set Debug Flag
45 ifdef DEBUG
46 CC_DEBUG_FLG = -g
47 DEBUG_EXT=_g
48 endif
49
50 # Set Profiling Flag
51 ifdef PROFILING
52 CC_PROFILING_FLG = -p
53 endif
54
55 # Set Optimization Flag (precident to force none, force full, force basic, or default remain as defined)
56 ifeq ($(OPTIMIZATION),OPTIMIZE)
57 CC_OPT_FLG = -O2
58 else
59 ifeq ($(OPTIMIZATION),FULL_OPTIMIZE)
60 CC_OPT_FLG = -O3
61 else
62 ifeq ($(OPTIMIZATION),NONE)
63 CC_OPT_FLG =
64 endif
65 endif
66 endif
67
68
69 # Compiler Options
70 CC_OFLAG = -o
71 CC_IFLAG = -I
72 CC_FLAGS = $(TARGET_FLG) -w9 -Wc,-Wall -shared $(CC_OPT_FLG) $(CC_PROFILING_FLG) $(CC_DEBUG_FLG)
73 CC_TARGET = $(@)
74 CC_CMD = $(CC) $(CC_FLAGS) $(DEFS) $(INCLUDES) $(@F:.$(OBJ_EXT)=.c) -o $(@)
75 CPP_CMD = $(CPP) $(CC_FLAGS) $(DEFS) $(INCLUDES) $(@F:.$(OBJ_EXT)=.cpp) -o $(@)
76 CPP_D_CMD = arm-unknown-nto-PosixBasedOS001.5.0eabi-gcc.exe -c $(DEFS) $(INCLUDES) -MM -MP $< > $(@:.o=.d)
77
78 # Archive Options  (Static Library)
79 AR_OFLAG =
80 AR_FLAGS = -r
81 AR_CMD = $(AR) $(AR_FLAGS) $(AR_OFLAG)$(@) $^
82
83 # Linker Options
84 # Executable
85 # Used in the form of $(LD_CMD) -L[Library Paths] -l[libraries] [objects] $(LD_OFLAG) executable_name.$(BIN_EXT)
86 LD_FLAGS = $(TARGET_FLG) $(CC_PROFILING_FLG) $(CC_DEBUG_FLG) $(LD_CPP)
87 LD_OFLAG = -o
88 LD_CMD = $(LD) -L$(LIB_PATH) $(LD_FLAGS) $(MAP_FILE_FLG)
89 EXEC_CMD = $(LD_CMD) $(LD_OFLAG) $(@) $(OBJECTS) $(addprefix -L , $(LIB_PATHS)) \
90                 -Bstatic $(addprefix -l , $(STATIC_LIBS)) -Bdynamic $(addprefix -l , $(DYNAMIC_LIBS))
91
92 # To create shared objects use the linker command but add -shared
93 SO_CMD = $(LD) $(LD_FLAGS) -shared $(MAP_FILE_FLG)
94 SLIB_CMD = $(SO_CMD) $^ $(LD_OFLAG) $(@) $(addprefix -L, $(LIB_PATHS)) \
95                 -Bstatic $(addprefix -l,$(STATIC_LIBS)) -Bdynamic $(addprefix -l,$(DYNAMIC_LIBS))
96