Init basesystem source codes.
[staging/basesystem.git] / nsframework / framework_unified / client / NativeServices / cfg / PosixBasedOS001_arm.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 vmware
19
20 # Tools and Options
21 LIB_EXT = a
22 SO_EXT = so
23 LIB_PREFIX = lib
24 OBJ_EXT = o
25 BIN_EXT =
26 CC = qcc -c
27 CPP = qcc -c
28 AS = ntoarm-as
29 AR = ntoarm-ar
30 LD = qcc
31 # Add addtion Linker Flags....
32 # If your application contains c++ code you will need
33 # the -lang-c++
34 LD_CPP = -lang-c++
35
36 # Compile options and commands
37 TARGET_FLG = -Vgcc_ntoarmle
38
39 # Set Debug Flag
40 ifdef DEBUG
41 CC_DEBUG_FLG = -g
42 DEBUG_EXT=_g
43 endif
44
45 # Set Profiling Flag
46 ifdef PROFILING
47 CC_PROFILING_FLG = -p
48 endif
49
50 # Set Optimization Flag
51 ifeq ($(OPTIMIZATION),OPTIMIZE)
52 CC_OPT_FLG = -O2
53 else
54 ifeq ($(OPTIMIZATION),FULL_OPTIMIZE)
55 CC_OPT_FLG = -O3
56 else
57 ifeq ($(OPTIMIZATION),NONE)
58 CC_OPT_FLG =
59 endif
60 endif
61 endif
62
63
64 # Compiler Options
65 CC_OFLAG = -o
66 CC_IFLAG = -I
67 CC_FLAGS = $(TARGET_FLG) -w9 -Wc,-Wall -shared  $(CC_OPT_FLG) $(CC_PROFILING_FLG) $(CC_DEBUG_FLG)
68 CC_TARGET = $(@)
69 CC_CMD = $(CC) $(CC_FLAGS) $(DEFS) $(INCLUDES) $(@F:.$(OBJ_EXT)=.c) -o $(@)
70 CPP_CMD = $(CPP) $(CC_FLAGS) $(DEFS) $(INCLUDES) $(@F:.$(OBJ_EXT)=.cpp) -o $(@)
71
72 # Archive Options  (Static Library)
73 AR_OFLAG =
74 AR_FLAGS = -r
75 AR_CMD = $(AR) $(AR_FLAGS) $(AR_OFLAG)$(@) $^
76
77 # Linker Options
78 # Executable
79 # Used in the form of $(LD_CMD) -L[Library Paths] -l[libraries] [objects] $(LD_OFLAG) executable_name.$(BIN_EXT)
80 LD_FLAGS = $(TARGET_FLG) $(CC_PROFILING_FLG) $(CC_DEBUG_FLG) $(LD_CPP)
81 LD_OFLAG = -o
82 LD_CMD = $(LD) -L$(LIB_PATH) $(LD_FLAGS)
83 EXEC_CMD = $(LD_CMD) $(LD_OFLAG) $(@) $(OBJECTS) $(addprefix -L , $(LIB_PATHS)) -Bstatic $(addprefix -l , $(STATIC_LIBS)) -Bdynamic $(addprefix -l , $(DYNAMIC_LIBS))
84
85 # To create shared objects use the linker command but add -shared
86 SO_CMD = $(LD) $(LD_FLAGS) -shared
87 SLIB_CMD = $(SO_CMD) $^ $(LD_OFLAG) $(@) $(addprefix -L, $(LIB_PATHS)) \
88                 -Bstatic $(addprefix -l,$(STATIC_LIBS)) -Bdynamic $(addprefix -l,$(DYNAMIC_LIBS))