common_library: gettid is multiple declaration in cl_error
[staging/basesystem.git] / video_in_hal / nsframework / framework_unified / client / NS_NPServiceIf / src / makefile_PosixBasedOS001
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 #
18 # Standard Module Makefile version 2.0
19 #
20
21 # Name of the componet (team/domain prefix '_' component name)
22 COMPONENT_NAME = NS_NPServiceIf
23
24 ifndef PRJ_ROOT
25 export PRJ_ROOT = $(CURDIR)/../
26 endif
27 include $(PRJ_ROOT)cfg/depends.mk
28
29 # Name of the componet (team/domain prefix '_' component name)
30 #  This must be the same as the RTC Component name and Eclipse Project Name
31 COMPONENT_NAME = NS_NPServiceIf
32
33
34 # Additive Compile Flags (Flags from initiating make process will still apply)
35 DEFS +=
36
37 # Set local includes and then the reference includes (priority order determines search path)
38 # Default pattern are any configuration includes (which would be things like PosixBasedOS001), local (Team) component directories,
39 # dependencies includes (other teams)
40 # Local (current component references should be in the form of
41 #  $(CC_IFLAG)$(TEAM_ROOT)$(COMPONENT_NAME)/directory
42 #  Example your public include directory would be
43 #  $(CC_IFLAG)$(TEAM_ROOT)$(COMPONENT_NAME)/inc
44 # Team references should only be to other's public includes such as
45 #  $(CC_IFLAG)$(TEAM_ROOT)NS_MessageCenter/inc
46 # Global (non-team) references should be only to other's public includes such
47 #  these are found in the depends include file and captured in the (DEPENDS_INCLUDES) variable
48 INCLUDES = \
49         $(CFG_INCS) \
50         $(CC_IFLAG)./ \
51         $(DEPENDS_INCLUDES) \
52         $(CC_IFLAG)$(TEAM_ROOT)NS_MessageCenter/inc \
53         $(CC_IFLAG)$(TEAM_ROOT)$(COMPONENT_NAME)/inc \
54         $(CC_IFLAG)$(TEAM_ROOT)NS_UtilityCenter/inc
55
56
57 # Do the same if you need to include library paths as well
58 #  Do an incremental in case additional library paths are defined
59 #  at the top-level make.  Use similar guidelines as for includes
60 #  for example to include a team component library it would be
61 #  $(TEAM_ROOT)NS_MessageCenter/lib/NS_MessageCenter/
62 LIB_PATHS += \
63   $(DEPENDS_LIB_PATHS) \
64
65
66
67 # Define binary outputs.  These can be libraries or executables.
68 #  Name a variable for each deliverable.  Suffixes should be
69 #  EXEC - For Executables -> output to the bin directory
70 #TIME_EXEC = $(BIN_PATH)time
71 #  LIB - For Static Libraries -> output to lib directory with specific naming
72 #MATH_LIB = $(LIB_PATH)$(LIB_PREFIX)math.$(LIB_EXT)
73 #  SLIB - For Shared Objects
74 #FRMWRK_SLIB = $(SLIB_PATH)frmwrk.$(SO_EXT)
75 #  LIB - Define the static library for Message Queue
76 #
77 #
78 ifdef DYNAMIC
79         COMPONENT_LIB = $(SLIB_PATH)$(LIB_PREFIX)$(COMPONENT_NAME)$(DEBUG_EXT).$(SO_EXT)
80 else
81         COMPONENT_LIB = $(LIB_PATH)$(LIB_PREFIX)$(COMPONENT_NAME)$(DEBUG_EXT).$(LIB_EXT)
82 endif
83
84 ## Sources Section
85
86 # Define Library & Executable Sources (on a per deliverable basis)
87 #  This includes sources located in subdirectories.
88
89 # Define generic line that pulls all c, cc, cpp files
90 # since your in the src folder is pull only files from there
91 COMPONENT_SRCS = \
92         $(wildcard *.c) \
93         $(wildcard *.cpp)
94
95 # Define sources that my not be local to your component
96 # here, you can define indivial files or wildcard from
97 # a different folder.
98 NON_LOCAL_SRCS = \
99
100
101 # List of all sources to be built.  Can be assembled from the other defintitions.
102 #  This only defines sources for the current directory, so if there are subdirectories
103 #  those are not included.  (Those are found in simple subdirectory makefiles that only
104 #  direct the building of sources, but no linking into a binary)
105 SOURCES = \
106         $(COMPONENT_SRCS) \
107         $(NON_LOCAL_SRCS) \
108
109
110
111 #
112 # Convert the source files to object files with correct folder location.
113 #
114 #
115 C_LANG_OBJECTS = $(addprefix $(BLD_PATH),$(addsuffix .$(OBJ_EXT),$(basename $(filter %.c ,$(SOURCES) ) ) ) )
116 CPP_LANG_OBJECTS = $(addprefix $(BLD_PATH),$(addsuffix .$(OBJ_EXT),$(basename $(filter %.cpp %.cc %.cxx,$(SOURCES) ) ) ) )
117
118
119 # List of all sources to be generated.  Can be assembled from the other defintitions.
120 OBJECTS = \
121         $(C_LANG_OBJECTS) \
122         $(CPP_LANG_OBJECTS)
123
124
125
126 # All headers that are dependencies.  Wildcard is easy to pickup local headers.
127 #  This is only to automate the rebuilding, all builds on the servers are cleans
128 #  So this is not a huge deal when building on a component level.
129 HEADERS = \
130         $(wildcard *.h) \
131         $(wildcard $(PRJ_ROOT)../$(COMPONENT_NAME)/inc/*.h) \
132
133
134 LIBRARIES = \
135         $(COMPONENT_LIB) \
136
137 ifdef DYNAMIC
138         DYNAMIC_LIBS += \
139         NS_MessageCenter$(DEBUG_EXT)
140 else
141         STATIC_LIBS +=
142 endif
143
144 # Make targets
145 #  Standard
146 all: banner module_dirs subdirs local library binary
147
148 debug:
149         $(MAKE) TARGET=arm DEBUG=TRUE all
150
151 base: banner module_dirs subdirs local
152
153 # Standard Building of Source Files (Default builds for all objects defined above)
154 $(C_LANG_OBJECTS): $(SOURCES) $(HEADERS)
155         $(CC_CMD)
156
157 $(CPP_LANG_OBJECTS): $(SOURCES) $(HEADERS)
158         $(CPP_CMD)
159
160 local: $(OBJECTS)
161
162 # Defines specific for each deliverable
163
164 $(COMPONENT_LIB): $(OBJECTS)
165 ifdef DYNAMIC
166 # For a dynamic library
167         $(SLIB_CMD)
168         $(HIDE_ECHO_FLAG)$(OBJCPY) --only-keep-debug $(@) $(@).debug
169         $(HIDE_ECHO_FLAG)$(OBJCPY) --strip-all $(@)
170         $(HIDE_ECHO_FLAG)$(OBJCPY) --add-gnu-debuglink=$(@).debug $(@)
171 else
172 # For a static library
173         $(AR_CMD)
174 endif
175
176 # Standard set of derived targets
177 library: base \
178         $(LIBRARIES)
179         @echo "***** `date` Done building library: $(COMPONENT_NAME) ******"
180
181 binary: base \
182         $(BINARIES)
183
184 # Subdirs should be to jump to subdirectories
185 #  standard form is of
186 #  $(MAKE) -C subdirectory_name $(MAKECMDGOALS)
187 subdirs:
188
189 clean:
190         -rm -f $(BINARIES)
191         -rm -f $(LIBRARIES)
192         -rm -f $(OBJECTS)
193         -rm -f $(COMPONENT_LIB).map
194         -rm -f $(COMPONENT_LIB).debug
195
196 -v:
197         @echo "objs: --> $(OBJECTS)"
198         @echo "sources: --> $(SOURCES)"
199         @echo "headers: --> $(HEADERS)"
200         @echo "includes: --> $(INCLUDES)"
201         @echo "lib paths: --> $(LIB_PATHS)"
202         @echo "static libs: --> $(LD_STATIC_LIBS)"
203         @echo "dynamic libs: --> $(LD_DYNAMIC_LIBS)"
204         @echo "lib: --> $(LIBRARIES)"
205         @echo "bin: --> $(BINARIES)"
206
207
208 module_dirs: build_dirs