2 # @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 ####################################################################
18 # DO NOT EDIT THIS FILE
19 # Common Project Makefile definitions shared by all types of makefiles
22 # Please use project.mk in your build folder to customize your build
23 #######################################################################
25 include $(PRJ_ROOT)cfg/depends.mk
28 export COMPONENT_ROOT=$(COMPONENT_NAME)
31 # Additive Compile Flags (Flags from initiating make process will still apply)
32 DEFS += $(PROJECT_FLAGS)
34 # Set local includes and then the reference includes (priority order determines search path)
37 $(CC_IFLAG)$(TEAM_ROOT)$(COMPONENT_ROOT)/inc \
38 $(addprefix $(CC_IFLAG),$(PROJECT_INCLUDE_PATHS)) \
42 # Do the same if you need to include library paths as well
44 $(PROJECT_LIB_PATHS) \
45 $(DEPENDS_LIB_PATHS) \
49 $(PROJECT_STATIC_LIBS)
52 $(PROJECT_DYNAMIC_LIBS)
56 # Define Library & Executable Sources (on a per deliverable basis)
57 # This includes sources located in subdirectories.
59 # Define generic line that pulls all c, cc, cpp files
60 # since your in the src folder is pull only files from there
64 # Define sources that my not be local to your component
65 # here, you can define indivial files or wildcard from
70 # List of all sources to be built. Can be assembled from the other defintitions.
71 # This only defines sources for the current directory, so if there are subdirectories
72 # those are not included. (Those are found in simple subdirectory makefiles that only
73 # direct the building of sources, but no linking into a binary)
79 # Convert the source files to object files with correct folder location.
80 C_LANG_OBJECTS = $(addprefix $(BLD_PATH),$(addsuffix .$(OBJ_EXT),$(basename $(filter %.c ,$(SOURCES) ) ) ) )
81 CPP_LANG_OBJECTS = $(addprefix $(BLD_PATH),$(addsuffix .$(OBJ_EXT),$(basename $(filter %.cpp %.cc %.cxx,$(SOURCES) ) ) ) )
84 # List of all sources to be generated. Can be assembled from the other defintitions.
89 D_FILES = $(OBJECTS:.o=.d)
91 # pull in dependency info for existing .o files
95 ifeq ($(BUILDTYPE),APP)
96 COMPONENT_EXEC = $(BIN_PATH)$(COMPONENT_NAME)$(DEBUG_EXT)
100 $(COMPONENT_EXEC): $(OBJECTS)
101 $(LD_CMD) $(LD_OFLAG) $(@) $(OBJECTS) $(addprefix -L , $(LIB_PATHS)) -Bstatic $(addprefix -l , $(LD_STATIC_LIBS)) -Bdynamic $(addprefix -l , $(LD_DYNAMIC_LIBS))
105 ifeq ($(BUILDTYPE),DLL)
106 COMPONENT_SOLIB = $(SLIB_PATH)$(LIB_PREFIX)$(COMPONENT_NAME)$(DEBUG_EXT).$(SO_EXT)
110 $(COMPONENT_SOLIB): $(OBJECTS)
111 $(SO_CMD) $(OBJECTS) $(LD_OFLAG) $(@) $(addprefix -L, $(LIB_PATHS)) \
112 -Bstatic $(addprefix -l,$(STATIC_LIBS)) -Bdynamic $(addprefix -l,$(DYNAMIC_LIBS))
116 ifeq ($(BUILDTYPE),LIB)
117 COMPONENT_LIB = $(LIB_PATH)$(LIB_PREFIX)$(COMPONENT_NAME)$(DEBUG_EXT).$(LIB_EXT)
121 $(COMPONENT_LIB): $(OBJECTS)
130 all: banner module_dirs subdirs local library binary
132 base: banner module_dirs subdirs local
135 $(BLD_PATH)/%.o: %.cpp
138 @mv -f $(@:.o=.d) $(@:.o=.d).tmp
139 @sed -e 's|.*: |$@: |' < $(@:.o=.d).tmp > $(@:.o=.d)
140 @rm -f $(@:.o=.d).tmp
144 # Standard set of derived targets
147 @echo "***** `date` Done building library: $(COMPONENT_NAME) ******"
152 # Subdirs should be to jump to subdirectories
153 # standard form is of
154 # $(MAKE) -C subdirectory_name $(MAKECMDGOALS)
164 @echo "objs: --> $(OBJECTS)"
165 @echo "sources: --> $(SOURCES)"
166 @echo "headers: --> $(HEADERS)"
167 @echo "includes: --> $(INCLUDES)"
168 @echo "lib paths: --> $(LIB_PATHS)"
169 @echo "static libs: --> $(LD_STATIC_LIBS)"
170 @echo "dynamic libs: --> $(LD_DYNAMIC_LIBS)"
171 @echo "lib: --> $(LIBRARIES)"
172 @echo "bin: --> $(BINARIES)"
175 module_dirs: build_dirs