blob: 12a3b06138daa043438a715e5033bff0c4cac8ad [file] [log] [blame]
The Android Open Source Project88b60792009-03-03 19:28:42 -08001###########################################################
2## Standard rules for building binary object files from
3## asm/c/cpp/yacc/lex source files.
4##
5## The list of object files is exported in $(all_objects).
6###########################################################
7
Ying Wang1a081002010-07-13 14:55:47 -07008my_ndk_version_root :=
Ying Wang848020f2012-08-14 10:13:16 -07009ifdef LOCAL_SDK_VERSION
Ying Wangfe1bfe72012-08-14 11:08:03 -070010 ifdef LOCAL_NDK_VERSION
11 $(error $(LOCAL_PATH): LOCAL_NDK_VERSION is now retired.)
12 endif
Ying Wang1a081002010-07-13 14:55:47 -070013 ifdef LOCAL_IS_HOST_MODULE
Ian Rogers76a6dc32012-10-01 16:36:23 -070014 $(error $(LOCAL_PATH): LOCAL_SDK_VERSION cannot be used in host module)
Ying Wang1a081002010-07-13 14:55:47 -070015 endif
Ying Wang848020f2012-08-14 10:13:16 -070016 my_ndk_source_root := $(HISTORICAL_NDK_VERSIONS_ROOT)/current/sources
17 my_ndk_version_root := $(HISTORICAL_NDK_VERSIONS_ROOT)/current/platforms/android-$(LOCAL_SDK_VERSION)/arch-$(TARGET_ARCH)
Ying Wangcce4c972011-03-03 18:53:53 -080018
19 # Set up the NDK stl variant. Starting from NDK-r5 the c++ stl resides in a separate location.
20 # See ndk/docs/CPLUSPLUS-SUPPORT.html
21 my_ndk_stl_include_path :=
22 my_ndk_stl_shared_lib_fullpath :=
23 my_ndk_stl_shared_lib :=
24 my_ndk_stl_static_lib :=
25 ifeq (,$(LOCAL_NDK_STL_VARIANT))
26 LOCAL_NDK_STL_VARIANT := system
27 endif
28 ifneq (1,$(words $(filter system stlport_static stlport_shared gnustl_static, $(LOCAL_NDK_STL_VARIANT))))
Ying Wang848020f2012-08-14 10:13:16 -070029 $(error $(LOCAL_PATH): Unknown LOCAL_NDK_STL_VARIANT $(LOCAL_NDK_STL_VARIANT))
Ying Wangcce4c972011-03-03 18:53:53 -080030 endif
31 ifeq (system,$(LOCAL_NDK_STL_VARIANT))
32 my_ndk_stl_include_path := $(my_ndk_source_root)/cxx-stl/system/include
33 # for "system" variant, the shared library exists in the system library and -lstdc++ is added by default.
34 else # LOCAL_NDK_STL_VARIANT is not system
35 ifneq (,$(filter stlport_%, $(LOCAL_NDK_STL_VARIANT)))
36 my_ndk_stl_include_path := $(my_ndk_source_root)/cxx-stl/stlport/stlport
37 ifeq (stlport_static,$(LOCAL_NDK_STL_VARIANT))
38 my_ndk_stl_static_lib := $(my_ndk_source_root)/cxx-stl/stlport/libs/$(TARGET_CPU_ABI)/libstlport_static.a
39 else
40 my_ndk_stl_shared_lib_fullpath := $(my_ndk_source_root)/cxx-stl/stlport/libs/$(TARGET_CPU_ABI)/libstlport_shared.so
41 my_ndk_stl_shared_lib := -lstlport_shared
42 endif
43 else
44 # LOCAL_NDK_STL_VARIANT is gnustl_static
Ying Wangd9020c22011-09-07 14:31:47 -070045 my_ndk_stl_include_path := $(my_ndk_source_root)/cxx-stl/gnu-libstdc++/libs/$(TARGET_CPU_ABI)/include \
46 $(my_ndk_source_root)/cxx-stl/gnu-libstdc++/include
Ying Wang848020f2012-08-14 10:13:16 -070047 my_ndk_stl_static_lib := $(my_ndk_source_root)/cxx-stl/gnu-libstdc++/libs/$(TARGET_CPU_ABI)/libgnustl_static.a
Ying Wangcce4c972011-03-03 18:53:53 -080048 endif
49 endif
Ying Wang1a081002010-07-13 14:55:47 -070050endif
51
Ying Wang704c0c92011-09-15 13:50:52 -070052##################################################
53# Compute the dependency of the shared libraries
54##################################################
55# On the target, we compile with -nostdlib, so we must add in the
56# default system shared libraries, unless they have requested not
57# to by supplying a LOCAL_SYSTEM_SHARED_LIBRARIES value. One would
58# supply that, for example, when building libc itself.
59ifdef LOCAL_IS_HOST_MODULE
60 ifeq ($(LOCAL_SYSTEM_SHARED_LIBRARIES),none)
61 LOCAL_SYSTEM_SHARED_LIBRARIES :=
62 endif
63else
64 ifeq ($(LOCAL_SYSTEM_SHARED_LIBRARIES),none)
65 LOCAL_SYSTEM_SHARED_LIBRARIES := $(TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES)
66 endif
67endif
68
69# Logging used to be part of libcutils (target) and libutils (sim);
70# hack modules that use those other libs to also include liblog.
71# All of this complexity is to make sure that liblog only appears
72# once, and appears just before libcutils or libutils on the link
73# line.
74# TODO: remove this hack and change all modules to use liblog
75# when necessary.
76define insert-liblog
77 $(if $(filter liblog,$(1)),$(1), \
78 $(if $(filter libcutils,$(1)), \
79 $(patsubst libcutils,liblog libcutils,$(1)) \
80 , \
81 $(patsubst libutils,liblog libutils,$(1)) \
82 ) \
83 )
84endef
85ifneq (,$(filter libcutils libutils,$(LOCAL_SHARED_LIBRARIES)))
86 LOCAL_SHARED_LIBRARIES := $(call insert-liblog,$(LOCAL_SHARED_LIBRARIES))
87endif
88ifneq (,$(filter libcutils libutils,$(LOCAL_STATIC_LIBRARIES)))
89 LOCAL_STATIC_LIBRARIES := $(call insert-liblog,$(LOCAL_STATIC_LIBRARIES))
90endif
91ifneq (,$(filter libcutils libutils,$(LOCAL_WHOLE_STATIC_LIBRARIES)))
92 LOCAL_WHOLE_STATIC_LIBRARIES := $(call insert-liblog,$(LOCAL_WHOLE_STATIC_LIBRARIES))
93endif
94
Ying Wang848020f2012-08-14 10:13:16 -070095ifdef LOCAL_SDK_VERSION
Ying Wang704c0c92011-09-15 13:50:52 -070096 # Get the list of INSTALLED libraries as module names.
Ian Rogers76a6dc32012-10-01 16:36:23 -070097 # We cannot compute the full path of the LOCAL_SHARED_LIBRARIES for
Ying Wang704c0c92011-09-15 13:50:52 -070098 # they may cusomize their install path with LOCAL_MODULE_PATH
99 installed_shared_library_module_names := \
100 $(LOCAL_SHARED_LIBRARIES)
101else
102 installed_shared_library_module_names := \
103 $(LOCAL_SYSTEM_SHARED_LIBRARIES) $(LOCAL_SHARED_LIBRARIES)
104endif
105# The real dependency will be added after all Android.mks are loaded and the install paths
106# of the shared libraries are determined.
107LOCAL_REQUIRED_MODULES += $(installed_shared_library_module_names)
108
The Android Open Source Project88b60792009-03-03 19:28:42 -0800109#######################################
110include $(BUILD_SYSTEM)/base_rules.mk
111#######################################
Evgeniy Stepanov6cc9c062012-03-30 12:15:12 +0400112
113ifeq ($(strip $(LOCAL_ADDRESS_SANITIZER)),true)
114 LOCAL_CLANG := true
115 LOCAL_CFLAGS += $(ADDRESS_SANITIZER_CONFIG_EXTRA_CFLAGS)
116 LOCAL_LDFLAGS += $(ADDRESS_SANITIZER_CONFIG_EXTRA_LDFLAGS)
117 LOCAL_SHARED_LIBRARIES += $(ADDRESS_SANITIZER_CONFIG_EXTRA_SHARED_LIBRARIES)
118 LOCAL_STATIC_LIBRARIES += $(ADDRESS_SANITIZER_CONFIG_EXTRA_STATIC_LIBRARIES)
119endif
120
Stephen Hinesbec4a4b2012-06-26 16:38:21 -0700121# Add in libcompiler-rt for all regular device builds
Mike Lockwooddaf5e222012-10-18 10:17:47 -0700122ifeq (,$(LOCAL_SDK_VERSION)$(LOCAL_IS_HOST_MODULE)$(WITHOUT_LIBCOMPILER_RT))
Stephen Hinesc72f3962012-06-11 14:53:34 -0700123 LOCAL_STATIC_LIBRARIES += $(COMPILER_RT_CONFIG_EXTRA_STATIC_LIBRARIES)
124endif
125
Ying Wangdfbe79b2012-03-22 11:26:22 -0700126my_compiler_dependencies :=
Evgeniy Stepanovb71e2df2012-03-20 18:00:16 +0400127ifeq ($(strip $(LOCAL_CLANG)),true)
128 LOCAL_CFLAGS += $(CLANG_CONFIG_EXTRA_CFLAGS)
Ying Wang65d78522012-08-10 16:30:42 -0700129 LOCAL_ASFLAGS += $(CLANG_CONFIG_EXTRA_ASFLAGS)
Evgeniy Stepanovb71e2df2012-03-20 18:00:16 +0400130 LOCAL_LDFLAGS += $(CLANG_CONFIG_EXTRA_LDFLAGS)
Ying Wangdfbe79b2012-03-22 11:26:22 -0700131 my_compiler_dependencies := $(CLANG) $(CLANG_CXX)
Evgeniy Stepanovb71e2df2012-03-20 18:00:16 +0400132endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800133
Jing Yu2dcc8062009-09-21 16:31:50 -0700134####################################################
135## Add FDO flags if FDO is turned on and supported
136####################################################
137ifeq ($(strip $(LOCAL_NO_FDO_SUPPORT)),)
138 LOCAL_CFLAGS += $(TARGET_FDO_CFLAGS)
139 LOCAL_CPPFLAGS += $(TARGET_FDO_CFLAGS)
140 LOCAL_LDFLAGS += $(TARGET_FDO_CFLAGS)
141endif
142
Kito Cheng70dc3e12012-06-15 15:15:50 +0800143####################################################
144## Add profiling flags if aprof is turned on
145####################################################
146ifeq ($(strip $(LOCAL_ENABLE_APROF)),true)
147 # -ffunction-sections and -fomit-frame-pointer are conflict with -pg
148 LOCAL_CFLAGS += -fno-omit-frame-pointer -fno-function-sections -pg
149 LOCAL_CPPFLAGS += -fno-omit-frame-pointer -fno-function-sections -pg
150endif
151
The Android Open Source Project88b60792009-03-03 19:28:42 -0800152###########################################################
Jim Huang20d1ba62010-10-14 16:15:56 +0800153## Explicitly declare assembly-only __ASSEMBLY__ macro for
154## assembly source
155###########################################################
156LOCAL_ASFLAGS += -D__ASSEMBLY__
157
158###########################################################
Ying Wang1a081002010-07-13 14:55:47 -0700159## Define PRIVATE_ variables from global vars
160###########################################################
Ying Wang848020f2012-08-14 10:13:16 -0700161ifdef LOCAL_SDK_VERSION
Ying Wang1a081002010-07-13 14:55:47 -0700162my_target_project_includes :=
Evgeniy Stepanova7095e92012-03-30 12:18:52 +0400163my_target_c_includes := $(my_ndk_stl_include_path) $(my_ndk_version_root)/usr/include
Ying Wangda4bf422012-08-16 16:45:01 -0700164
165# filter out including of AndroidConfig.h in system/core.
166TARGET_GLOBAL_CFLAGS_NO_ANDCONF ?= $(subst $(TARGET_ANDROID_CONFIG_CFLAGS),,\
167 $(TARGET_GLOBAL_CFLAGS))
168my_target_global_cflags := $(TARGET_GLOBAL_CFLAGS_NO_ANDCONF)
Ying Wang1a081002010-07-13 14:55:47 -0700169else
170my_target_project_includes := $(TARGET_PROJECT_INCLUDES)
Evgeniy Stepanova7095e92012-03-30 12:18:52 +0400171my_target_c_includes := $(TARGET_C_INCLUDES)
Evgeniy Stepanova7095e92012-03-30 12:18:52 +0400172ifeq ($(strip $(LOCAL_CLANG)),true)
Ying Wangda4bf422012-08-16 16:45:01 -0700173my_target_c_includes += $(CLANG_CONFIG_EXTRA_TARGET_C_INCLUDES)
174my_target_global_cflags := $(TARGET_GLOBAL_CLANG_FLAGS)
175else
176my_target_global_cflags := $(TARGET_GLOBAL_CFLAGS)
177endif # LOCAL_CLANG
178endif # LOCAL_SDK_VERSION
179
Ying Wang1a081002010-07-13 14:55:47 -0700180$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_PROJECT_INCLUDES := $(my_target_project_includes)
Evgeniy Stepanova7095e92012-03-30 12:18:52 +0400181$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_C_INCLUDES := $(my_target_c_includes)
Ying Wang1a081002010-07-13 14:55:47 -0700182$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CFLAGS := $(my_target_global_cflags)
Ying Wangda4bf422012-08-16 16:45:01 -0700183$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CPPFLAGS := $(TARGET_GLOBAL_CPPFLAGS)
Ying Wang1a081002010-07-13 14:55:47 -0700184
185###########################################################
The Android Open Source Project88b60792009-03-03 19:28:42 -0800186## Define PRIVATE_ variables used by multiple module types
187###########################################################
188$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_NO_DEFAULT_COMPILER_FLAGS := \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700189 $(strip $(LOCAL_NO_DEFAULT_COMPILER_FLAGS))
The Android Open Source Project88b60792009-03-03 19:28:42 -0800190
191ifeq ($(strip $(LOCAL_CC)),)
Evgeniy Stepanovb71e2df2012-03-20 18:00:16 +0400192 ifeq ($(strip $(LOCAL_CLANG)),true)
193 LOCAL_CC := $(CLANG)
194 else
195 LOCAL_CC := $($(my_prefix)CC)
196 endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800197endif
198$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CC := $(LOCAL_CC)
199
200ifeq ($(strip $(LOCAL_CXX)),)
Evgeniy Stepanovb71e2df2012-03-20 18:00:16 +0400201 ifeq ($(strip $(LOCAL_CLANG)),true)
202 LOCAL_CXX := $(CLANG_CXX)
203 else
204 LOCAL_CXX := $($(my_prefix)CXX)
205 endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800206endif
207$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CXX := $(LOCAL_CXX)
208
209# TODO: support a mix of standard extensions so that this isn't necessary
210LOCAL_CPP_EXTENSION := $(strip $(LOCAL_CPP_EXTENSION))
211ifeq ($(LOCAL_CPP_EXTENSION),)
212 LOCAL_CPP_EXTENSION := .cpp
213endif
214$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CPP_EXTENSION := $(LOCAL_CPP_EXTENSION)
215
216# Certain modules like libdl have to have symbols resolved at runtime and blow
217# up if --no-undefined is passed to the linker.
218ifeq ($(strip $(LOCAL_NO_DEFAULT_COMPILER_FLAGS)),)
219ifeq ($(strip $(LOCAL_ALLOW_UNDEFINED_SYMBOLS)),)
220 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS) $($(my_prefix)NO_UNDEFINED_LDFLAGS)
221endif
222endif
223
Ying Wangfcdabd42011-04-25 14:22:41 -0700224ifeq (true,$(LOCAL_GROUP_STATIC_LIBRARIES))
225$(LOCAL_BUILT_MODULE): PRIVATE_GROUP_STATIC_LIBRARIES := true
226else
227$(LOCAL_BUILT_MODULE): PRIVATE_GROUP_STATIC_LIBRARIES :=
228endif
229
The Android Open Source Project88b60792009-03-03 19:28:42 -0800230###########################################################
231## Define arm-vs-thumb-mode flags.
232###########################################################
233LOCAL_ARM_MODE := $(strip $(LOCAL_ARM_MODE))
Chih-Wei Huang0d09e582010-07-09 10:07:52 +0800234ifeq ($(TARGET_ARCH),arm)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800235arm_objects_mode := $(if $(LOCAL_ARM_MODE),$(LOCAL_ARM_MODE),arm)
236normal_objects_mode := $(if $(LOCAL_ARM_MODE),$(LOCAL_ARM_MODE),thumb)
237
Dave Bort95282482009-04-23 18:44:55 -0700238# Read the values from something like TARGET_arm_CFLAGS or
239# TARGET_thumb_CFLAGS. HOST_(arm|thumb)_CFLAGS values aren't
240# actually used (although they are usually empty).
Evgeniy Stepanovf50f4c52012-04-05 11:44:37 +0400241ifeq ($(strip $(LOCAL_CLANG)),true)
242arm_objects_cflags := $($(my_prefix)$(arm_objects_mode)_CLANG_CFLAGS)
243normal_objects_cflags := $($(my_prefix)$(normal_objects_mode)_CLANG_CFLAGS)
244else
Dave Bort95282482009-04-23 18:44:55 -0700245arm_objects_cflags := $($(my_prefix)$(arm_objects_mode)_CFLAGS)
246normal_objects_cflags := $($(my_prefix)$(normal_objects_mode)_CFLAGS)
Evgeniy Stepanovf50f4c52012-04-05 11:44:37 +0400247endif
248
Chih-Wei Huang0d09e582010-07-09 10:07:52 +0800249else
250arm_objects_mode :=
251normal_objects_mode :=
252arm_objects_cflags :=
253normal_objects_cflags :=
254endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800255
256###########################################################
257## Define per-module debugging flags. Users can turn on
258## debugging for a particular module by setting DEBUG_MODULE_ModuleName
259## to a non-empty value in their environment or buildspec.mk,
260## and setting HOST_/TARGET_CUSTOM_DEBUG_CFLAGS to the
261## debug flags that they want to use.
262###########################################################
263ifdef DEBUG_MODULE_$(strip $(LOCAL_MODULE))
264 debug_cflags := $($(my_prefix)CUSTOM_DEBUG_CFLAGS)
265else
266 debug_cflags :=
267endif
268
269###########################################################
270## Stuff source generated from one-off tools
271###########################################################
272$(LOCAL_GENERATED_SOURCES): PRIVATE_MODULE := $(LOCAL_MODULE)
273
274ALL_GENERATED_SOURCES += $(LOCAL_GENERATED_SOURCES)
275
276
277###########################################################
Ying Wanga5fc87a2010-11-02 18:43:16 -0700278## Compile the .proto files to .cc and then to .o
279###########################################################
280proto_sources := $(filter %.proto,$(LOCAL_SRC_FILES))
281proto_generated_objects :=
282proto_generated_headers :=
283ifneq ($(proto_sources),)
284proto_sources_fullpath := $(addprefix $(LOCAL_PATH)/, $(proto_sources))
285proto_generated_cc_sources_dir := $(intermediates)/proto
286proto_generated_cc_sources := $(addprefix $(proto_generated_cc_sources_dir)/, \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700287 $(patsubst %.proto,%.pb.cc,$(proto_sources_fullpath)))
Ying Wanga5fc87a2010-11-02 18:43:16 -0700288proto_generated_objects := $(patsubst %.cc,%.o, $(proto_generated_cc_sources))
289
290$(proto_generated_cc_sources): PRIVATE_PROTO_INCLUDES := $(TOP)
291$(proto_generated_cc_sources): PRIVATE_PROTO_CC_OUTPUT_DIR := $(proto_generated_cc_sources_dir)
Ying Wang33c0d952010-11-05 11:30:58 -0700292$(proto_generated_cc_sources): PRIVATE_PROTOC_FLAGS := $(LOCAL_PROTOC_FLAGS)
Ying Wanga5fc87a2010-11-02 18:43:16 -0700293$(proto_generated_cc_sources): $(proto_generated_cc_sources_dir)/%.pb.cc: %.proto $(PROTOC)
294 $(transform-proto-to-cc)
295
296proto_generated_headers := $(patsubst %.pb.cc,%.pb.h, $(proto_generated_cc_sources))
297$(proto_generated_headers): $(proto_generated_cc_sources_dir)/%.pb.h: $(proto_generated_cc_sources_dir)/%.pb.cc
298
Ying Wang022a7b32012-06-13 11:38:10 -0700299$(proto_generated_objects): PRIVATE_ARM_MODE := $(normal_objects_mode)
300$(proto_generated_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags)
Narayan Kamath21094872012-04-02 18:19:31 +0100301$(proto_generated_objects): $(proto_generated_cc_sources_dir)/%.o: $(proto_generated_cc_sources_dir)/%.cc $(proto_generated_headers)
Ying Wanga5fc87a2010-11-02 18:43:16 -0700302 $(transform-$(PRIVATE_HOST)cpp-to-o)
303-include $(proto_generated_objects:%.o=%.P)
304
305LOCAL_C_INCLUDES += external/protobuf/src $(proto_generated_cc_sources_dir)
306LOCAL_CFLAGS += -DGOOGLE_PROTOBUF_NO_RTTI
307ifeq ($(LOCAL_PROTOC_OPTIMIZE_TYPE),full)
308LOCAL_STATIC_LIBRARIES += libprotobuf-cpp-2.3.0-full
309else
310LOCAL_STATIC_LIBRARIES += libprotobuf-cpp-2.3.0-lite
311endif
312endif
313
314
315###########################################################
The Android Open Source Project88b60792009-03-03 19:28:42 -0800316## YACC: Compile .y files to .cpp and the to .o.
317###########################################################
318
319yacc_sources := $(filter %.y,$(LOCAL_SRC_FILES))
320yacc_cpps := $(addprefix \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700321 $(intermediates)/,$(yacc_sources:.y=$(LOCAL_CPP_EXTENSION)))
The Android Open Source Project88b60792009-03-03 19:28:42 -0800322yacc_headers := $(yacc_cpps:$(LOCAL_CPP_EXTENSION)=.h)
323yacc_objects := $(yacc_cpps:$(LOCAL_CPP_EXTENSION)=.o)
324
325ifneq ($(strip $(yacc_cpps)),)
326$(yacc_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700327 $(TOPDIR)$(LOCAL_PATH)/%.y \
328 $(lex_cpps) $(LOCAL_ADDITIONAL_DEPENDENCIES)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800329 $(call transform-y-to-cpp,$(PRIVATE_CPP_EXTENSION))
330$(yacc_headers): $(intermediates)/%.h: $(intermediates)/%$(LOCAL_CPP_EXTENSION)
331
332$(yacc_objects): PRIVATE_ARM_MODE := $(normal_objects_mode)
333$(yacc_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags)
334$(yacc_objects): $(intermediates)/%.o: $(intermediates)/%$(LOCAL_CPP_EXTENSION)
335 $(transform-$(PRIVATE_HOST)cpp-to-o)
336endif
337
338###########################################################
339## LEX: Compile .l files to .cpp and then to .o.
340###########################################################
341
342lex_sources := $(filter %.l,$(LOCAL_SRC_FILES))
343lex_cpps := $(addprefix \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700344 $(intermediates)/,$(lex_sources:.l=$(LOCAL_CPP_EXTENSION)))
The Android Open Source Project88b60792009-03-03 19:28:42 -0800345lex_objects := $(lex_cpps:$(LOCAL_CPP_EXTENSION)=.o)
346
347ifneq ($(strip $(lex_cpps)),)
348$(lex_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700349 $(TOPDIR)$(LOCAL_PATH)/%.l
The Android Open Source Project88b60792009-03-03 19:28:42 -0800350 $(transform-l-to-cpp)
351
352$(lex_objects): PRIVATE_ARM_MODE := $(normal_objects_mode)
353$(lex_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags)
354$(lex_objects): $(intermediates)/%.o: \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700355 $(intermediates)/%$(LOCAL_CPP_EXTENSION) \
356 $(LOCAL_ADDITIONAL_DEPENDENCIES) \
357 $(yacc_headers)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800358 $(transform-$(PRIVATE_HOST)cpp-to-o)
359endif
360
361###########################################################
362## C++: Compile .cpp files to .o.
363###########################################################
364
Jeff Browne33ba4c2011-07-11 22:11:46 -0700365# we also do this on host modules, even though
The Android Open Source Project88b60792009-03-03 19:28:42 -0800366# it's not really arm, because there are files that are shared.
367cpp_arm_sources := $(patsubst %$(LOCAL_CPP_EXTENSION).arm,%$(LOCAL_CPP_EXTENSION),$(filter %$(LOCAL_CPP_EXTENSION).arm,$(LOCAL_SRC_FILES)))
368cpp_arm_objects := $(addprefix $(intermediates)/,$(cpp_arm_sources:$(LOCAL_CPP_EXTENSION)=.o))
369
370cpp_normal_sources := $(filter %$(LOCAL_CPP_EXTENSION),$(LOCAL_SRC_FILES))
371cpp_normal_objects := $(addprefix $(intermediates)/,$(cpp_normal_sources:$(LOCAL_CPP_EXTENSION)=.o))
372
373$(cpp_arm_objects): PRIVATE_ARM_MODE := $(arm_objects_mode)
374$(cpp_arm_objects): PRIVATE_ARM_CFLAGS := $(arm_objects_cflags)
375$(cpp_normal_objects): PRIVATE_ARM_MODE := $(normal_objects_mode)
376$(cpp_normal_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags)
377
378cpp_objects := $(cpp_arm_objects) $(cpp_normal_objects)
379
380ifneq ($(strip $(cpp_objects)),)
381$(cpp_objects): $(intermediates)/%.o: \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700382 $(TOPDIR)$(LOCAL_PATH)/%$(LOCAL_CPP_EXTENSION) \
383 $(yacc_cpps) $(proto_generated_headers) $(my_compiler_dependencies) \
Evgeniy Stepanovb71e2df2012-03-20 18:00:16 +0400384 $(LOCAL_ADDITIONAL_DEPENDENCIES)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800385 $(transform-$(PRIVATE_HOST)cpp-to-o)
386-include $(cpp_objects:%.o=%.P)
387endif
388
389###########################################################
390## C++: Compile generated .cpp files to .o.
391###########################################################
392
393gen_cpp_sources := $(filter %$(LOCAL_CPP_EXTENSION),$(LOCAL_GENERATED_SOURCES))
394gen_cpp_objects := $(gen_cpp_sources:%$(LOCAL_CPP_EXTENSION)=%.o)
395
396ifneq ($(strip $(gen_cpp_objects)),)
397# Compile all generated files as thumb.
398# TODO: support compiling certain generated files as arm.
399$(gen_cpp_objects): PRIVATE_ARM_MODE := $(normal_objects_mode)
400$(gen_cpp_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags)
Evgeniy Stepanovb71e2df2012-03-20 18:00:16 +0400401$(gen_cpp_objects): $(intermediates)/%.o: \
402 $(intermediates)/%$(LOCAL_CPP_EXTENSION) $(yacc_cpps) \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700403 $(proto_generated_headers) $(my_compiler_dependencies) \
Evgeniy Stepanovb71e2df2012-03-20 18:00:16 +0400404 $(LOCAL_ADDITIONAL_DEPENDENCIES)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800405 $(transform-$(PRIVATE_HOST)cpp-to-o)
406-include $(gen_cpp_objects:%.o=%.P)
407endif
408
409###########################################################
410## S: Compile generated .S and .s files to .o.
411###########################################################
412
413gen_S_sources := $(filter %.S,$(LOCAL_GENERATED_SOURCES))
414gen_S_objects := $(gen_S_sources:%.S=%.o)
415
416ifneq ($(strip $(gen_S_sources)),)
Evgeniy Stepanovb71e2df2012-03-20 18:00:16 +0400417$(gen_S_objects): $(intermediates)/%.o: $(intermediates)/%.S \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700418 $(my_compiler_dependencies) $(LOCAL_ADDITIONAL_DEPENDENCIES)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800419 $(transform-$(PRIVATE_HOST)s-to-o)
420-include $(gen_S_objects:%.o=%.P)
421endif
422
423gen_s_sources := $(filter %.s,$(LOCAL_GENERATED_SOURCES))
424gen_s_objects := $(gen_s_sources:%.s=%.o)
425
426ifneq ($(strip $(gen_s_objects)),)
Evgeniy Stepanovb71e2df2012-03-20 18:00:16 +0400427$(gen_s_objects): $(intermediates)/%.o: $(intermediates)/%.s \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700428 $(my_compiler_dependencies) $(LOCAL_ADDITIONAL_DEPENDENCIES)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800429 $(transform-$(PRIVATE_HOST)s-to-o-no-deps)
430-include $(gen_s_objects:%.o=%.P)
431endif
432
433gen_asm_objects := $(gen_S_objects) $(gen_s_objects)
434
435###########################################################
436## C: Compile .c files to .o.
437###########################################################
438
439c_arm_sources := $(patsubst %.c.arm,%.c,$(filter %.c.arm,$(LOCAL_SRC_FILES)))
440c_arm_objects := $(addprefix $(intermediates)/,$(c_arm_sources:.c=.o))
441
442c_normal_sources := $(filter %.c,$(LOCAL_SRC_FILES))
443c_normal_objects := $(addprefix $(intermediates)/,$(c_normal_sources:.c=.o))
444
445$(c_arm_objects): PRIVATE_ARM_MODE := $(arm_objects_mode)
446$(c_arm_objects): PRIVATE_ARM_CFLAGS := $(arm_objects_cflags)
447$(c_normal_objects): PRIVATE_ARM_MODE := $(normal_objects_mode)
448$(c_normal_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags)
449
450c_objects := $(c_arm_objects) $(c_normal_objects)
451
452ifneq ($(strip $(c_objects)),)
Evgeniy Stepanovb71e2df2012-03-20 18:00:16 +0400453$(c_objects): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.c $(yacc_cpps) $(proto_generated_headers) \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700454 $(my_compiler_dependencies) $(LOCAL_ADDITIONAL_DEPENDENCIES)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800455 $(transform-$(PRIVATE_HOST)c-to-o)
456-include $(c_objects:%.o=%.P)
457endif
458
459###########################################################
Jack Paleviche7b3e2c2009-05-04 14:32:44 -0700460## C: Compile generated .c files to .o.
461###########################################################
462
463gen_c_sources := $(filter %.c,$(LOCAL_GENERATED_SOURCES))
464gen_c_objects := $(gen_c_sources:%.c=%.o)
465
466ifneq ($(strip $(gen_c_objects)),)
467# Compile all generated files as thumb.
468# TODO: support compiling certain generated files as arm.
469$(gen_c_objects): PRIVATE_ARM_MODE := $(normal_objects_mode)
470$(gen_c_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags)
Evgeniy Stepanovb71e2df2012-03-20 18:00:16 +0400471$(gen_c_objects): $(intermediates)/%.o: $(intermediates)/%.c $(yacc_cpps) $(proto_generated_headers) \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700472 $(my_compiler_dependencies) $(LOCAL_ADDITIONAL_DEPENDENCIES)
Jack Paleviche7b3e2c2009-05-04 14:32:44 -0700473 $(transform-$(PRIVATE_HOST)c-to-o)
474-include $(gen_c_objects:%.o=%.P)
475endif
476
477###########################################################
David 'Digit' Turner5dbb5292009-05-14 16:00:09 +0200478## ObjC: Compile .m files to .o
479###########################################################
480
481objc_sources := $(filter %.m,$(LOCAL_SRC_FILES))
482objc_objects := $(addprefix $(intermediates)/,$(objc_sources:.m=.o))
483
484ifneq ($(strip $(objc_objects)),)
Evgeniy Stepanovb71e2df2012-03-20 18:00:16 +0400485$(objc_objects): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.m $(yacc_cpps) $(proto_generated_headers) \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700486 $(my_compiler_dependencies) $(LOCAL_ADDITIONAL_DEPENDENCIES)
David 'Digit' Turner5dbb5292009-05-14 16:00:09 +0200487 $(transform-$(PRIVATE_HOST)m-to-o)
488-include $(objc_objects:%.o=%.P)
489endif
490
491###########################################################
The Android Open Source Project88b60792009-03-03 19:28:42 -0800492## AS: Compile .S files to .o.
493###########################################################
494
495asm_sources_S := $(filter %.S,$(LOCAL_SRC_FILES))
496asm_objects_S := $(addprefix $(intermediates)/,$(asm_sources_S:.S=.o))
497
498ifneq ($(strip $(asm_objects_S)),)
Evgeniy Stepanovb71e2df2012-03-20 18:00:16 +0400499$(asm_objects_S): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.S \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700500 $(my_compiler_dependencies) $(LOCAL_ADDITIONAL_DEPENDENCIES)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800501 $(transform-$(PRIVATE_HOST)s-to-o)
502-include $(asm_objects_S:%.o=%.P)
503endif
504
505asm_sources_s := $(filter %.s,$(LOCAL_SRC_FILES))
506asm_objects_s := $(addprefix $(intermediates)/,$(asm_sources_s:.s=.o))
507
508ifneq ($(strip $(asm_objects_s)),)
Evgeniy Stepanovb71e2df2012-03-20 18:00:16 +0400509$(asm_objects_s): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.s \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700510 $(my_compiler_dependencies) $(LOCAL_ADDITIONAL_DEPENDENCIES)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800511 $(transform-$(PRIVATE_HOST)s-to-o-no-deps)
512-include $(asm_objects_s:%.o=%.P)
513endif
514
515asm_objects := $(asm_objects_S) $(asm_objects_s)
516
517
Ying Wang5f074802011-11-08 09:31:21 -0800518####################################################
519## Import includes
520####################################################
521import_includes := $(intermediates)/import_includes
522import_includes_deps := $(strip \
523 $(foreach l, $(installed_shared_library_module_names), \
524 $(call intermediates-dir-for,SHARED_LIBRARIES,$(l),$(LOCAL_IS_HOST_MODULE))/export_includes) \
525 $(foreach l, $(LOCAL_STATIC_LIBRARIES) $(LOCAL_WHOLE_STATIC_LIBRARIES), \
526 $(call intermediates-dir-for,STATIC_LIBRARIES,$(l),$(LOCAL_IS_HOST_MODULE))/export_includes))
527$(import_includes) : $(import_includes_deps)
528 @echo Import includes file: $@
529 $(hide) mkdir -p $(dir $@) && rm -f $@
530ifdef import_includes_deps
531 $(hide) for f in $^; do \
532 cat $$f >> $@; \
533 done
534else
535 $(hide) touch $@
536endif
537
The Android Open Source Project88b60792009-03-03 19:28:42 -0800538###########################################################
539## Common object handling.
540###########################################################
541
542# some rules depend on asm_objects being first. If your code depends on
543# being first, it's reasonable to require it to be assembly
544all_objects := \
Ying Wangdfbe79b2012-03-22 11:26:22 -0700545 $(asm_objects) \
546 $(cpp_objects) \
547 $(gen_cpp_objects) \
548 $(gen_asm_objects) \
549 $(c_objects) \
550 $(gen_c_objects) \
551 $(objc_objects) \
552 $(yacc_objects) \
553 $(lex_objects) \
554 $(proto_generated_objects) \
555 $(addprefix $(TOPDIR)$(LOCAL_PATH)/,$(LOCAL_PREBUILT_OBJ_FILES))
The Android Open Source Project88b60792009-03-03 19:28:42 -0800556
Colin Cross9ad36ef2012-03-30 19:31:00 -0700557LOCAL_C_INCLUDES += $(TOPDIR)$(LOCAL_PATH) $(intermediates)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800558
Ying Wang848020f2012-08-14 10:13:16 -0700559ifndef LOCAL_SDK_VERSION
Ying Wangbce4b752010-07-22 15:51:56 -0700560 LOCAL_C_INCLUDES += $(JNI_H_INCLUDE)
561endif
562
Ying Wang5f074802011-11-08 09:31:21 -0800563$(all_objects) : | $(LOCAL_GENERATED_SOURCES) $(import_includes)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800564ALL_C_CPP_ETC_OBJECTS += $(all_objects)
565
566###########################################################
567## Copy headers to the install tree
568###########################################################
569include $(BUILD_COPY_HEADERS)
570
571###########################################################
572# Standard library handling.
The Android Open Source Project88b60792009-03-03 19:28:42 -0800573###########################################################
The Android Open Source Project88b60792009-03-03 19:28:42 -0800574
575###########################################################
576# The list of libraries that this module will link against are in
577# these variables. Each is a list of bare module names like "libc libm".
578#
579# LOCAL_SHARED_LIBRARIES
580# LOCAL_STATIC_LIBRARIES
581# LOCAL_WHOLE_STATIC_LIBRARIES
582#
583# We need to convert the bare names into the dependencies that
584# we'll use for LOCAL_BUILT_MODULE and LOCAL_INSTALLED_MODULE.
585# LOCAL_BUILT_MODULE should depend on the BUILT versions of the
586# libraries, so that simply building this module doesn't force
587# an install of a library. Similarly, LOCAL_INSTALLED_MODULE
588# should depend on the INSTALLED versions of the libraries so
589# that they get installed when this module does.
590###########################################################
591# NOTE:
592# WHOLE_STATIC_LIBRARIES are libraries that are pulled into the
593# module without leaving anything out, which is useful for turning
594# a collection of .a files into a .so file. Linking against a
595# normal STATIC_LIBRARY will only pull in code/symbols that are
596# referenced by the module. (see gcc/ld's --whole-archive option)
597###########################################################
598
599# Get the list of BUILT libraries, which are under
600# various intermediates directories.
601so_suffix := $($(my_prefix)SHLIB_SUFFIX)
602a_suffix := $($(my_prefix)STATIC_LIB_SUFFIX)
603
Ying Wang848020f2012-08-14 10:13:16 -0700604ifdef LOCAL_SDK_VERSION
The Android Open Source Project88b60792009-03-03 19:28:42 -0800605built_shared_libraries := \
606 $(addprefix $($(my_prefix)OUT_INTERMEDIATE_LIBRARIES)/, \
607 $(addsuffix $(so_suffix), \
608 $(LOCAL_SHARED_LIBRARIES)))
609
Ying Wangcce4c972011-03-03 18:53:53 -0800610my_system_shared_libraries_fullpath := \
611 $(my_ndk_stl_shared_lib_fullpath) \
612 $(addprefix $(my_ndk_version_root)/usr/lib/, \
613 $(addsuffix $(so_suffix), $(LOCAL_SYSTEM_SHARED_LIBRARIES)))
Ying Wang1a081002010-07-13 14:55:47 -0700614
615built_shared_libraries += $(my_system_shared_libraries_fullpath)
616LOCAL_SHARED_LIBRARIES += $(LOCAL_SYSTEM_SHARED_LIBRARIES)
617else
618LOCAL_SHARED_LIBRARIES += $(LOCAL_SYSTEM_SHARED_LIBRARIES)
619built_shared_libraries := \
620 $(addprefix $($(my_prefix)OUT_INTERMEDIATE_LIBRARIES)/, \
621 $(addsuffix $(so_suffix), \
622 $(LOCAL_SHARED_LIBRARIES)))
Ying Wang1a081002010-07-13 14:55:47 -0700623endif
624
The Android Open Source Project88b60792009-03-03 19:28:42 -0800625built_static_libraries := \
626 $(foreach lib,$(LOCAL_STATIC_LIBRARIES), \
627 $(call intermediates-dir-for, \
628 STATIC_LIBRARIES,$(lib),$(LOCAL_IS_HOST_MODULE))/$(lib)$(a_suffix))
629
Ying Wang848020f2012-08-14 10:13:16 -0700630ifdef LOCAL_SDK_VERSION
Ying Wangcce4c972011-03-03 18:53:53 -0800631built_static_libraries += $(my_ndk_stl_static_lib)
632endif
633
The Android Open Source Project88b60792009-03-03 19:28:42 -0800634built_whole_libraries := \
635 $(foreach lib,$(LOCAL_WHOLE_STATIC_LIBRARIES), \
636 $(call intermediates-dir-for, \
637 STATIC_LIBRARIES,$(lib),$(LOCAL_IS_HOST_MODULE))/$(lib)$(a_suffix))
638
The Android Open Source Project88b60792009-03-03 19:28:42 -0800639# We don't care about installed static libraries, since the
640# libraries have already been linked into the module at that point.
641# We do, however, care about the NOTICE files for any static
Steve Blockd14d3b42012-03-01 11:34:41 +0000642# libraries that we use. (see notice_files.mk)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800643
644installed_static_library_notice_file_targets := \
645 $(foreach lib,$(LOCAL_STATIC_LIBRARIES) $(LOCAL_WHOLE_STATIC_LIBRARIES), \
646 NOTICE-$(if $(LOCAL_IS_HOST_MODULE),HOST,TARGET)-STATIC_LIBRARIES-$(lib))
647
Doug Kwan9a8ecf92011-05-10 21:50:58 -0700648# Default is -fno-rtti.
Doug Kwane3c3c6d2011-06-07 10:55:48 -0700649ifeq ($(strip $(LOCAL_RTTI_FLAG)),)
650LOCAL_RTTI_FLAG := -fno-rtti
651endif
Doug Kwan9a8ecf92011-05-10 21:50:58 -0700652
The Android Open Source Project88b60792009-03-03 19:28:42 -0800653###########################################################
654# Rule-specific variable definitions
655###########################################################
656$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_YACCFLAGS := $(LOCAL_YACCFLAGS)
657$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ASFLAGS := $(LOCAL_ASFLAGS)
Ying Wang7429e212012-08-15 10:59:10 -0700658$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CONLYFLAGS := $(LOCAL_CONLYFLAGS)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800659$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CFLAGS := $(LOCAL_CFLAGS)
660$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CPPFLAGS := $(LOCAL_CPPFLAGS)
Doug Kwan9a8ecf92011-05-10 21:50:58 -0700661$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RTTI_FLAG := $(LOCAL_RTTI_FLAG)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800662$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_DEBUG_CFLAGS := $(debug_cflags)
663$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_C_INCLUDES := $(LOCAL_C_INCLUDES)
Ying Wang5f074802011-11-08 09:31:21 -0800664$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_IMPORT_INCLUDES := $(import_includes)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800665$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_LDFLAGS := $(LOCAL_LDFLAGS)
666$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_LDLIBS := $(LOCAL_LDLIBS)
Jeff Brown703e7c62011-02-04 20:15:00 -0800667$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_NO_CRT := $(LOCAL_NO_CRT)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800668
669# this is really the way to get the files onto the command line instead
670# of using $^, because then LOCAL_ADDITIONAL_DEPENDENCIES doesn't work
671$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ALL_SHARED_LIBRARIES := $(built_shared_libraries)
672$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ALL_STATIC_LIBRARIES := $(built_static_libraries)
673$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ALL_WHOLE_STATIC_LIBRARIES := $(built_whole_libraries)
674$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ALL_OBJECTS := $(all_objects)
675
676###########################################################
677# Define library dependencies.
678###########################################################
679# all_libraries is used for the dependencies on LOCAL_BUILT_MODULE.
680all_libraries := \
681 $(built_shared_libraries) \
682 $(built_static_libraries) \
683 $(built_whole_libraries)
684
The Android Open Source Project88b60792009-03-03 19:28:42 -0800685# Also depend on the notice files for any static libraries that
686# are linked into this module. This will force them to be installed
687# when this module is.
688$(LOCAL_INSTALLED_MODULE): | $(installed_static_library_notice_file_targets)
Ying Wang5f074802011-11-08 09:31:21 -0800689
690###########################################################
691# Export includes
692###########################################################
693export_includes := $(intermediates)/export_includes
694$(export_includes): PRIVATE_EXPORT_C_INCLUDE_DIRS := $(LOCAL_EXPORT_C_INCLUDE_DIRS)
Ying Wang68f1c772012-04-23 21:29:18 -0700695$(export_includes) : $(LOCAL_MODULE_MAKEFILE)
Ying Wang5f074802011-11-08 09:31:21 -0800696 @echo Export includes file: $< -- $@
697 $(hide) mkdir -p $(dir $@) && rm -f $@
698ifdef LOCAL_EXPORT_C_INCLUDE_DIRS
699 $(hide) for d in $(PRIVATE_EXPORT_C_INCLUDE_DIRS); do \
700 echo "-I $$d" >> $@; \
701 done
702else
703 $(hide) touch $@
704endif
Ying Wang616e5962012-04-18 17:35:55 -0700705
706# Make sure export_includes gets generated when you are running mm/mmm
707$(LOCAL_BUILT_MODULE) : | $(export_includes)