Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 1 | LOCAL_CFLAGS := \ |
| 2 | -pedantic \ |
| 3 | -Wcast-qual \ |
| 4 | -Wno-long-long \ |
| 5 | $(LOCAL_CFLAGS) |
| 6 | |
Logan | 9c64df2 | 2011-02-15 06:27:21 +0800 | [diff] [blame] | 7 | LOCAL_CPPFLAGS := \ |
| 8 | -Wno-sign-promo \ |
| 9 | $(LOCAL_CPPFLAGS) |
| 10 | |
David Gross | 16f3483 | 2015-06-12 14:28:01 -0700 | [diff] [blame] | 11 | ifeq ($(FORCE_BUILD_LLVM_DISABLE_NDEBUG),true) |
Pirama Arumuga Nainar | 235e990 | 2015-02-23 09:53:16 -0800 | [diff] [blame] | 12 | LOCAL_CFLAGS := \ |
| 13 | $(LOCAL_CFLAGS) \ |
| 14 | -D_DEBUG \ |
| 15 | -UNDEBUG |
| 16 | endif |
| 17 | |
David Gross | 16f3483 | 2015-06-12 14:28:01 -0700 | [diff] [blame] | 18 | ifeq ($(FORCE_BUILD_LLVM_DEBUG),true) |
| 19 | LOCAL_CFLAGS := \ |
| 20 | $(LOCAL_CFLAGS) \ |
| 21 | -O0 -g |
| 22 | endif |
| 23 | |
Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 24 | # Make sure bionic is first so we can include system headers. |
| 25 | LOCAL_C_INCLUDES := \ |
| 26 | $(CLANG_ROOT_PATH)/include \ |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 27 | $(CLANG_ROOT_PATH)/lib/CodeGen \ |
Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 28 | $(LOCAL_C_INCLUDES) |
| 29 | |
Dan Willemsen | 2d2dc9f | 2015-08-18 17:06:48 -0700 | [diff] [blame] | 30 | LOCAL_MODULE_HOST_OS := darwin linux windows |
| 31 | |
Pirama Arumuga Nainar | 87d948e | 2016-03-03 15:49:35 -0800 | [diff] [blame] | 32 | # This triggers an assertion on cross Windows builds. |
| 33 | LOCAL_CFLAGS_windows := -Wno-error=uninitialized |
| 34 | |
Ying Wang | c69ce36 | 2010-09-09 21:44:22 -0700 | [diff] [blame] | 35 | LLVM_ROOT_PATH := external/llvm |
| 36 | include $(LLVM_ROOT_PATH)/llvm.mk |
| 37 | |
Shih-wei Liao | ea28516 | 2010-06-04 12:34:56 -0700 | [diff] [blame] | 38 | ifneq ($(LLVM_HOST_BUILD_MK),) |
| 39 | include $(LLVM_HOST_BUILD_MK) |
| 40 | endif |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 41 | |
| 42 | ########################################################### |
| 43 | ## Commands for running tblgen to compile a td file |
| 44 | ########################################################### |
| 45 | define transform-host-clang-td-to-out |
| 46 | @mkdir -p $(dir $@) |
Logan Chien | 93e534a | 2011-12-16 17:39:13 +0800 | [diff] [blame] | 47 | @echo "Host Clang TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<" |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 48 | $(hide) $(CLANG_TBLGEN) \ |
| 49 | -I $(dir $<) \ |
| 50 | -I $(LLVM_ROOT_PATH)/include \ |
| 51 | -I $(LLVM_ROOT_PATH)/host/include \ |
| 52 | -I $(LLVM_ROOT_PATH)/lib/Target \ |
| 53 | $(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,) \ |
| 54 | -gen-$(strip $(1)) \ |
Shinichiro Hamaji | d722cb8 | 2016-04-04 16:53:43 +0900 | [diff] [blame] | 55 | -d $@.d -o $@ $< |
Logan Chien | fe6bd6d | 2011-10-21 15:03:07 +0800 | [diff] [blame] | 56 | endef |