Shih-wei Liao | e445432 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 1 | LOCAL_CFLAGS := \ |
Shih-wei Liao | e445432 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 2 | -D_GNU_SOURCE \ |
| 3 | -D__STDC_LIMIT_MACROS \ |
| 4 | -D__STDC_CONSTANT_MACROS \ |
Stephen Hines | f2a027e | 2011-11-10 19:01:51 -0800 | [diff] [blame] | 5 | -D__STDC_FORMAT_MACROS \ |
Shih-wei Liao | e445432 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 6 | -O2 \ |
| 7 | -fomit-frame-pointer \ |
Shih-wei Liao | e445432 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 8 | -Wall \ |
| 9 | -W \ |
| 10 | -Wno-unused-parameter \ |
| 11 | -Wwrite-strings \ |
| 12 | $(LOCAL_CFLAGS) |
| 13 | |
Shih-wei Liao | 44ce444 | 2010-05-04 03:19:48 -0700 | [diff] [blame] | 14 | ifeq ($(LLVM_ENABLE_ASSERTION),true) |
| 15 | LOCAL_CFLAGS := \ |
| 16 | -D_DEBUG \ |
| 17 | -UNDEBUG \ |
| 18 | $(LOCAL_CFLAGS) |
| 19 | endif |
| 20 | |
Shih-wei Liao | e445432 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 21 | ifneq ($(REQUIRES_EH),1) |
Shih-wei Liao | 7abe37e | 2010-04-28 01:47:00 -0700 | [diff] [blame] | 22 | LOCAL_CFLAGS += -fno-exceptions |
Shih-wei Liao | e445432 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 23 | else |
| 24 | REQUIRES_EH := 0 |
| 25 | LOCAL_CFLAGS += -fexceptions |
| 26 | endif |
| 27 | |
| 28 | ifneq ($(REQUIRES_RTTI),1) |
Patrick Scott | c364886 | 2010-05-07 08:38:22 -0400 | [diff] [blame] | 29 | LOCAL_CPPFLAGS += -fno-rtti |
Shih-wei Liao | e445432 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 30 | else |
| 31 | REQUIRES_RTTI := 0 |
| 32 | endif |
| 33 | |
Shih-wei Liao | 7abe37e | 2010-04-28 01:47:00 -0700 | [diff] [blame] | 34 | LOCAL_CPPFLAGS := \ |
| 35 | $(LOCAL_CPPFLAGS) \ |
jush | 4671b17 | 2011-02-28 17:18:20 +0800 | [diff] [blame] | 36 | -Woverloaded-virtual \ |
| 37 | -Wno-sign-promo |
Shih-wei Liao | c156bc6 | 2010-06-07 22:05:52 -0700 | [diff] [blame] | 38 | |
Shih-wei Liao | e445432 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 39 | # Make sure bionic is first so we can include system headers. |
| 40 | LOCAL_C_INCLUDES := \ |
| 41 | $(LLVM_ROOT_PATH) \ |
| 42 | $(LLVM_ROOT_PATH)/include \ |
| 43 | $(LLVM_ROOT_PATH)/host/include \ |
| 44 | $(LOCAL_C_INCLUDES) |
| 45 | |
| 46 | LOCAL_IS_HOST_MODULE := true |
| 47 | |
| 48 | ########################################################### |
| 49 | ## Commands for running tblgen to compile a td file |
| 50 | ########################################################### |
| 51 | define transform-host-td-to-out |
| 52 | @mkdir -p $(dir $@) |
Logan Chien | 5683786 | 2011-12-16 17:38:39 +0800 | [diff] [blame] | 53 | @echo "Host TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<" |
Shih-wei Liao | e445432 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 54 | $(hide) $(TBLGEN) \ |
| 55 | -I $(dir $<) \ |
| 56 | -I $(LLVM_ROOT_PATH)/include \ |
| 57 | -I $(LLVM_ROOT_PATH)/host/include \ |
| 58 | -I $(LLVM_ROOT_PATH)/lib/Target \ |
Zonr Chang | 037754c | 2010-10-08 20:12:54 +0800 | [diff] [blame] | 59 | $(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,) \ |
| 60 | -gen-$(strip $(1)) \ |
Ying Wang | ca65f4e | 2011-05-24 11:20:36 -0700 | [diff] [blame] | 61 | -o $@ $< |
Shih-wei Liao | e445432 | 2010-04-07 12:21:42 -0700 | [diff] [blame] | 62 | endef |