1LOCAL_PATH := $(call my-dir)
2
3LLVM_ROOT_PATH := $(LOCAL_PATH)/../..
4
5#===---------------------------------------------------------------===
6# llvm-config command line tool
7#===---------------------------------------------------------------===
8
9include $(CLEAR_VARS)
10
11llvm_config_SRC_FILES := \
12  llvm-config.cpp
13
14llvm_config_STATIC_LIBRARIES := \
15  libLLVMCore \
16  libLLVMSupport
17
18LOCAL_MODULE := llvm-config
19LOCAL_MODULE_TAGS := optional
20LOCAL_MODULE_CLASS := EXECUTABLES
21LOCAL_IS_HOST_MODULE := true
22
23# Create BuildVariables.inc dynamically from BuildVariables.inc.in
24generated_sources := $(call local-generated-sources-dir)
25GEN := $(addprefix $(generated_sources)/, \
26            BuildVariables.inc \
27        )
28
29$(GEN) : PRIVATE_PATH := $(LOCAL_PATH)
30$(GEN) : PRIVATE_CUSTOM_TOOL = sed -e 's/@ANDROID_BUILD_TOP@/$(subst /,\/,$(ANDROID_BUILD_TOP))/' < $< > $@
31$(GEN) : $(LOCAL_PATH)/BuildVariables.inc.in
32$(GEN): $(generated_sources)/%.inc : $(LOCAL_PATH)/%.inc.in
33	$(transform-generated-source)
34
35LOCAL_GENERATED_SOURCES += $(GEN)
36
37LOCAL_C_INCLUDES := $(generated_sources)
38
39LOCAL_SRC_FILES := $(llvm_config_SRC_FILES)
40LOCAL_STATIC_LIBRARIES := $(llvm_config_STATIC_LIBRARIES)
41
42LOCAL_LDLIBS += -lpthread -lm -ldl
43LOCAL_ADDITIONAL_DEPENDENCIES := \
44  $(LOCAL_PATH)/Android.mk \
45  $(LOCAL_GENERATED_SOURCES)
46
47include $(LLVM_ROOT_PATH)/llvm.mk
48include $(LLVM_HOST_BUILD_MK)
49include $(BUILD_HOST_EXECUTABLE)
50