Remove unused directories and files in video_in_hal
[staging/basesystem.git] / service / native / framework_unified / client / NS_FrameworkCore / 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_FrameworkCore
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_FrameworkCore
32
33
34 # Additive Compile Flags (Flags from initiating make process will still apply)
35 DEFS += -D DISPATCHER_PROFILER
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         $(CC_IFLAG)$(TEAM_ROOT)NS_MessageQueue/inc \
52         $(CC_IFLAG)$(TEAM_ROOT)NS_MessageCenter/inc \
53         $(CC_IFLAG)$(TEAM_ROOT)NS_UtilityCenter/inc \
54         $(CC_IFLAG)$(TEAM_ROOT)$(COMPONENT_NAME)/inc \
55         $(CC_IFLAG)$(TEAM_ROOT)$(COMPONENT_NAME)/inc/statemachine \
56         $(DEPENDS_INCLUDES) \
57
58 # Libraries should be exported to the Domain Root.  However if there is a
59 # local static library (3rd Party) go ahead and add it here.
60 LIB_PATHS += \
61   $(DEPENDS_LIB_PATHS) \
62
63
64
65 # Define binary outputs.  These can be libraries or executables.
66 #  Name a variable for each deliverable.  Suffixes should be
67 #  EXEC - For Executables -> output to the bin directory
68 #TIME_EXEC = $(BIN_PATH)time
69 #  LIB - For Static Libraries -> output to lib directory with specific naming
70 #MATH_LIB = $(LIB_PATH)$(LIB_PREFIX)math.$(LIB_EXT)
71 #  SLIB - For Shared Objects
72 #FRMWRK_SLIB = $(SLIB_PATH)frmwrk.$(SO_EXT)
73 #  LIB - Define the static library for Message Queue
74 #
75 #
76 ifdef DYNAMIC
77         COMPONENT_LIB = $(SLIB_PATH)$(LIB_PREFIX)$(COMPONENT_NAME)$(DEBUG_EXT).$(SO_EXT)
78 else
79         COMPONENT_LIB = $(LIB_PATH)$(LIB_PREFIX)$(COMPONENT_NAME)$(DEBUG_EXT).$(LIB_EXT)
80 endif
81
82
83 ## Sources Section
84
85 # Define Library & Executable Sources (on a per deliverable basis)
86 #  This includes sources located in subdirectories.
87
88 # Define generic line that pulls all c, cc, cpp files
89 # since your in the src folder is pull only files from there
90 COMPONENT_SRCS = \
91         $(wildcard *.c) \
92         $(wildcard *.cpp)
93
94 # Define sources that my not be local to your component
95 # here, you can define indivial files or wildcard from
96 # a different folder.
97 NON_LOCAL_SRCS = \
98         $(wildcard statemachine/*.cpp)
99
100 # List of all sources to be built.  Can be assembled from the other defintitions.
101 #  This only defines sources for the current directory, so if there are subdirectories
102 #  those are not included.  (Those are found in simple subdirectory makefiles that only
103 #  direct the building of sources, but no linking into a binary)
104 SOURCES = \
105         $(COMPONENT_SRCS) \
106
107
108 #
109 # Convert the source files to object files with correct folder location.
110 #
111 #
112 C_LANG_OBJECTS = $(addprefix $(BLD_PATH),$(addsuffix .$(OBJ_EXT),$(basename $(filter %.c ,$(SOURCES) ) ) ) )
113 CPP_LANG_OBJECTS = $(addprefix $(BLD_PATH),$(addsuffix .$(OBJ_EXT),$(basename $(filter %.cpp %.cc %.cxx,$(SOURCES) ) ) ) )
114
115
116 # List of all sources to be generated.  Can be assembled from the other defintitions.
117 OBJECTS = \
118         $(C_LANG_OBJECTS) \
119         $(CPP_LANG_OBJECTS)
120
121 # assuming all objects should be included in the library.
122 ALL_OBJECTS = $(addprefix $(BLD_PATH),$(addsuffix .$(OBJ_EXT),$(notdir $(basename $(NON_LOCAL_SRCS) )) ) ) \
123                                 $(OBJECTS)
124
125 # All headers that are dependencies.  Wildcard is easy to pickup local headers.
126 #  This is only to automate the rebuilding, all builds on the servers are cleans
127 #  So this is not a huge deal when building on a component level.
128 HEADERS = \
129         $(wildcard *.h) \
130         $(wildcard $(TEAM_ROOT)$(COMPONENT_NAME)/inc/*.h) \
131         $(wildcard $(TEAM_ROOT)NativeServices/inc/*.h) \
132         $(wildcard $(TEAM_ROOT)NativeServices/inc/native/*.h) \
133         $(wildcard $(TEAM_ROOT)NativeServices/inc/framework/*.h) \
134
135 LIBRARIES = \
136         $(COMPONENT_LIB) \
137
138 ifdef DYNAMIC
139         DYNAMIC_LIBS += \
140         NS_MessageCenter$(DEBUG_EXT) \
141         NS_ConfigParser$(DEBUG_EXT) \
142         NS_NPServiceIf$(DEBUG_EXT) \
143         NS_Timer$(DEBUG_EXT)
144 else
145         STATIC_LIBS +=
146 endif
147
148 # Make targets
149 #  Standard
150 all: banner module_dirs subdirs local library binary
151
152 debug:
153         $(MAKE) TARGET=arm DEBUG=TRUE all
154
155 base: banner module_dirs subdirs local
156
157 # Standard Building of Source Files (Default builds for all objects defined above)
158 $(C_LANG_OBJECTS): $(SOURCES) $(HEADERS)
159         $(CC_CMD)
160
161 $(CPP_LANG_OBJECTS): $(SOURCES) $(HEADERS)
162         $(CPP_CMD)
163
164 local: $(OBJECTS)
165
166 # Defines specific for each deliverable
167
168 # For a static library
169 $(COMPONENT_LIB): $(OBJECTS) $(ALL_OBJECTS)
170 ifdef DYNAMIC
171 # For a dynamic library
172         $(SLIB_CMD)
173         $(HIDE_ECHO_FLAG)$(OBJCPY) --only-keep-debug $(@) $(@).debug
174         $(HIDE_ECHO_FLAG)$(OBJCPY) --strip-all $(@)
175         $(HIDE_ECHO_FLAG)$(OBJCPY) --add-gnu-debuglink=$(@).debug $(@)
176 else
177 # For a static library
178         $(AR_CMD)
179 endif
180
181 # Standard set of derived targets
182 library: base \
183         $(LIBRARIES)
184         @echo "***** `date` Done building library: $(COMPONENT_NAME) ******"
185
186 binary: base \
187         $(BINARIES)
188
189 # Subdirs should be to jump to subdirectories
190 #  standard form is of
191 #  $(MAKE) -C subdirectory_name $(MAKECMDGOALS)
192 subdirs:
193         $(MAKE) -C statemachine $(MAKECMDGOALS)
194 clean:
195         -rm -f $(BINARIES)
196         -rm -f $(LIBRARIES)
197         -rm -f $(OBJECTS)
198         -rm -f $(ALL_OBJECTS)
199         -rm -f $(COMPONENT_LIB).map
200         -rm -f $(COMPONENT_LIB).debug
201
202 -v:
203         @echo "objs: --> $(OBJECTS)"
204         @echo "sources: --> $(SOURCES)"
205         @echo "headers: --> $(HEADERS)"
206         @echo "includes: --> $(INCLUDES)"
207         @echo "lib paths: --> $(LIB_PATHS)"
208         @echo "static libs: --> $(LD_STATIC_LIBS)"
209         @echo "dynamic libs: --> $(LD_DYNAMIC_LIBS)"
210         @echo "lib: --> $(LIBRARIES)"
211         @echo "bin: --> $(BINARIES)"
212
213
214 module_dirs: build_dirs