Skip to content
Snippets Groups Projects
Commit c4c1f81a authored by Stephen Hines's avatar Stephen Hines Committed by Gerrit Code Review
Browse files

Merge "Fix build rules for BuildVariables.inc in llvm-config."

parents e0dc531c e4c8388e
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,3 @@ tools/lld
tools/polly
# Sphinx build tree, if building in-source dir.
docs/_build
# Ignore the generated BuildVariables.inc.
tools/llvm-config/BuildVariables.inc
......@@ -2,44 +2,47 @@ LOCAL_PATH := $(call my-dir)
LLVM_ROOT_PATH := $(LOCAL_PATH)/../..
#===---------------------------------------------------------------===
# llvm-config command line tool
#===---------------------------------------------------------------===
llvm_config_SRC_FILES := \
llvm-config.cpp \
llvm_config_STATIC_LIBRARIES := \
libLLVMCore \
libLLVMSupport \
llvm_config_LOCAL_INCLUDES := \
BuildVariables.inc \
LibraryDependencies.inc
llvm_config_DEPENDENCIES := \
$(LOCAL_PATH)/BuildVariables.inc.in
include $(CLEAR_VARS)
BUILD_VARIABLES_IN := $(LOCAL_PATH)/BuildVariables.inc.in
BUILD_VARIABLES_OUT := $(LOCAL_PATH)/BuildVariables.inc
llvm_config_SRC_FILES := \
llvm-config.cpp
BuildVariables.inc:
sed -e 's/@ANDROID_BUILD_TOP@/$(subst /,\/,$(ANDROID_BUILD_TOP))/' < $(BUILD_VARIABLES_IN) > $(BUILD_VARIABLES_OUT)
llvm_config_STATIC_LIBRARIES := \
libLLVMCore \
libLLVMSupport
LOCAL_MODULE := llvm-config
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_IS_HOST_MODULE := true
# Create BuildVariables.inc dynamically from BuildVariables.inc.in
generated_sources := $(call local-generated-sources-dir)
GEN := $(addprefix $(generated_sources)/, \
BuildVariables.inc \
)
$(GEN) : PRIVATE_PATH := $(LOCAL_PATH)
$(GEN) : PRIVATE_CUSTOM_TOOL = sed -e 's/@ANDROID_BUILD_TOP@/$(subst /,\/,$(ANDROID_BUILD_TOP))/' < $< > $@
$(GEN) : $(LOCAL_PATH)/BuildVariables.inc.in
$(GEN): $(generated_sources)/%.inc : $(LOCAL_PATH)/%.inc.in
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
LOCAL_C_INCLUDES := $(generated_sources)
LOCAL_SRC_FILES := $(llvm_config_SRC_FILES)
LOCAL_STATIC_LIBRARIES := $(llvm_config_STATIC_LIBRARIES)
LOCAL_INCLUDES := $(llvm_config_LOCAL_INCLUDES)
LOCAL_ADDITIONAL_DEPENDENCIES := $(llvm_config_DEPENDENCIES)
LOCAL_LDLIBS += -lpthread -lm -ldl
LOCAL_ADDITIONAL_DEPENDENCIES := \
$(LOCAL_PATH)/Android.mk \
$(LOCAL_GENERATED_SOURCES)
include $(LLVM_ROOT_PATH)/llvm.mk
include $(LLVM_HOST_BUILD_MK)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment