Init basesystem source codes.
[staging/basesystem.git] / video_in_hal / nsframework / framework_unified / client / NativeServices / cfg / PosixBasedOS001_x86.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 x86 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 = qcc -c
29 AR = qcc -a
30 LD = qcc
31 LD_CPP = -lang-c++ #-lm
32 OBJCPY := ${PosixBasedOS001_HOST}/usr/bin/ntox86-objcopy
33
34 # Compile options and commands
35 TARGET_FLG = -Vgcc_ntox86
36
37 # Set Debug Flag
38 ifdef DEBUG
39 CC_DEBUG_FLG = -g
40 DEBUG_EXT=_g
41 endif
42
43 # Define Map file Option
44 MAP_FILE_FLG=-M
45
46 # Set Profiling Flag
47 ifdef PROFILING
48 CC_PROFILING_FLG = -p
49 endif
50
51 # Set Optimization Flag (precident to force none, force full, force basic, or default remain as defined)
52 ifeq ($(OPTIMIZATION),OPTIMIZE)
53 CC_OPT_FLG = -O2
54 else
55 ifeq ($(OPTIMIZATION),FULL_OPTIMIZE)
56 CC_OPT_FLG = -O3
57 else
58 ifeq ($(OPTIMIZATION),NONE)
59 CC_OPT_FLG =
60 endif
61 endif
62 endif
63
64
65 # Compiler Options
66 CC_OFLAG = -o
67 CC_IFLAG = -I
68 CC_FLAGS = $(TARGET_FLG) -w9 -Wc,-Wall -shared  $(CC_OPT_FLG) $(CC_PROFILING_FLG) $(CC_DEBUG_FLG) $(CC_OPT_FLG)
69 CC_TARGET = $(@)
70 CC_CMD = $(CC) $(CC_FLAGS) $(DEFS) $(INCLUDES) $(@F:.$(OBJ_EXT)=.c*) -o $(@)
71 CPP_CMD = $(CPP) $(CC_FLAGS) $(DEFS) $(INCLUDES) $(@F:.$(OBJ_EXT)=.cpp) -o $(@)
72 CPP_D_CMD = i486-pc-nto-PosixBasedOS001.5.0-gcc.exe $(DEFS) $(INCLUDES) -MM $< > $(@:.o=.d)
73
74 # Archive Options  (Static Library)
75 AR_OFLAG =
76 AR_FLAGS =
77 AR_CMD = $(AR) $(AR_FLAGS) $(AR_OFLAG)$(@) $^
78
79 # Linker Options
80 # Executable
81 # Used in the form of $(LD_CMD) -L[Library Paths] -l[libraries] [objects] $(LD_OFLAG) executable_name.$(BIN_EXT)
82 LD_FLAGS = $(TARGET_FLG) $(CC_PROFILING_FLG) $(CC_DEBUG_FLG) $(LD_CPP)
83 LD_OFLAG = -o
84 LD_CMD = $(LD) -L$(LIB_PATH) $(LD_FLAGS) $(MAP_FILE_FLG)
85
86 # To create shared objects use the linker command but add -shared
87 SO_CMD = $(LD) $(LD_FLAGS) -shared $(MAP_FILE_FLG)
88 SLIB_CMD = $(SO_CMD) $^ $(LD_OFLAG) $(@) $(addprefix -L, $(LIB_PATHS)) \
89                 -Bstatic $(addprefix -l,$(STATIC_LIBS)) -Bdynamic $(addprefix -l,$(DYNAMIC_LIBS))