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