summaryrefslogtreecommitdiffstats
path: root/llvm-device-build.mk
diff options
context:
space:
mode:
authorShih-wei Liao <sliao@google.com>2010-04-07 12:21:42 -0700
committerShih-wei Liao <sliao@google.com>2010-04-07 12:21:42 -0700
commite4454320b3cfffe926a487c33fbeb454366de2f8 (patch)
tree133c05da684edf4a3b2529bcacfa996298c455f6 /llvm-device-build.mk
parent20570085304f0a4ab4f112a01d77958bbd2827a1 (diff)
downloadexternal_llvm-e4454320b3cfffe926a487c33fbeb454366de2f8.zip
external_llvm-e4454320b3cfffe926a487c33fbeb454366de2f8.tar.gz
external_llvm-e4454320b3cfffe926a487c33fbeb454366de2f8.tar.bz2
libbcc
Change-Id: Ieaa3ebd5a38f370752495549f8870b534eeedfc5
Diffstat (limited to 'llvm-device-build.mk')
-rw-r--r--llvm-device-build.mk52
1 files changed, 52 insertions, 0 deletions
diff --git a/llvm-device-build.mk b/llvm-device-build.mk
new file mode 100644
index 0000000..d7c7e3d
--- /dev/null
+++ b/llvm-device-build.mk
@@ -0,0 +1,52 @@
+LOCAL_CFLAGS := \
+ -D_DEBUG \
+ -D_GNU_SOURCE \
+ -D__STDC_LIMIT_MACROS \
+ -D__STDC_CONSTANT_MACROS \
+ -DANDROID_TARGET_BUILD \
+ -O2 \
+ -fomit-frame-pointer \
+ -Woverloaded-virtual \
+ -Wall \
+ -W \
+ -Wno-unused-parameter \
+ -Wwrite-strings \
+ $(LOCAL_CFLAGS)
+
+ifneq ($(REQUIRES_EH),1)
+LOCAL_CFLAGS += -fno-exceptions
+else
+# No action. The device target should not have exception enabled since bionic
+# doesn't support it
+REQUIRES_EH := 0
+endif
+
+ifneq ($(REQUIRES_RTTI),1)
+LOCAL_CFLAGS += -fno-rtti
+else
+REQUIRES_RTTI := 0
+endif
+
+# Make sure bionic is first so we can include system headers.
+LOCAL_C_INCLUDES := \
+ bionic \
+ external/stlport/stlport \
+ $(LLVM_ROOT_PATH) \
+ $(LLVM_ROOT_PATH)/include \
+ $(LLVM_ROOT_PATH)/device/include \
+ $(LOCAL_C_INCLUDES)
+
+###########################################################
+## Commands for running tblgen to compile a td file
+###########################################################
+define transform-device-td-to-out
+@mkdir -p $(dir $@)
+@echo "Device TableGen (gen-$(1)): $(LOCAL_MODULE) <= $<"
+$(hide) $(TBLGEN) \
+ -I $(dir $<) \
+ -I $(LLVM_ROOT_PATH)/include \
+ -I $(LLVM_ROOT_PATH)/device/include \
+ -I $(LLVM_ROOT_PATH)/lib/Target \
+ -gen-$(strip $(1)) \
+ -o $@ $<
+endef