diff options
author | Stephen Hines <srhines@google.com> | 2014-07-24 02:15:21 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-07-23 18:56:15 +0000 |
commit | c4c1f81ae1b07138df50e0459631abf3082bda9c (patch) | |
tree | 2d2db5ebcf79d429d4a7a5584edf71ae3a57659f /tools | |
parent | e0dc531c0d840f6f3118a71f6e53ebb82a3be22c (diff) | |
parent | e4c8388e2bc283d5dd0b185317307f0d31782e56 (diff) | |
download | external_llvm-c4c1f81ae1b07138df50e0459631abf3082bda9c.zip external_llvm-c4c1f81ae1b07138df50e0459631abf3082bda9c.tar.gz external_llvm-c4c1f81ae1b07138df50e0459631abf3082bda9c.tar.bz2 |
Merge "Fix build rules for BuildVariables.inc in llvm-config."
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-config/Android.mk | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/tools/llvm-config/Android.mk b/tools/llvm-config/Android.mk index bdc409d..ac97e0b 100644 --- a/tools/llvm-config/Android.mk +++ b/tools/llvm-config/Android.mk @@ -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) |