blob: 67c38081d126df81ca3821484fa0f9cecb12741f [file] [log] [blame]
Shih-wei Liaoe4454322010-04-07 12:21:42 -07001LOCAL_CFLAGS := \
Shih-wei Liaoe4454322010-04-07 12:21:42 -07002 -D_GNU_SOURCE \
3 -D__STDC_LIMIT_MACROS \
4 -D__STDC_CONSTANT_MACROS \
Stephen Hinesf2a027e2011-11-10 19:01:51 -08005 -D__STDC_FORMAT_MACROS \
Shih-wei Liaoe4454322010-04-07 12:21:42 -07006 -O2 \
7 -fomit-frame-pointer \
Shih-wei Liaoe4454322010-04-07 12:21:42 -07008 -Wall \
9 -W \
10 -Wno-unused-parameter \
11 -Wwrite-strings \
12 $(LOCAL_CFLAGS)
13
Shih-wei Liao44ce4442010-05-04 03:19:48 -070014ifeq ($(LLVM_ENABLE_ASSERTION),true)
15LOCAL_CFLAGS := \
16 -D_DEBUG \
17 -UNDEBUG \
18 $(LOCAL_CFLAGS)
19endif
20
Shih-wei Liaoe4454322010-04-07 12:21:42 -070021ifneq ($(REQUIRES_EH),1)
Shih-wei Liao7abe37e2010-04-28 01:47:00 -070022LOCAL_CFLAGS += -fno-exceptions
Shih-wei Liaoe4454322010-04-07 12:21:42 -070023else
24REQUIRES_EH := 0
25LOCAL_CFLAGS += -fexceptions
26endif
27
28ifneq ($(REQUIRES_RTTI),1)
Patrick Scottc3648862010-05-07 08:38:22 -040029LOCAL_CPPFLAGS += -fno-rtti
Shih-wei Liaoe4454322010-04-07 12:21:42 -070030else
31REQUIRES_RTTI := 0
32endif
33
Shih-wei Liao7abe37e2010-04-28 01:47:00 -070034LOCAL_CPPFLAGS := \
35 $(LOCAL_CPPFLAGS) \
jush4671b172011-02-28 17:18:20 +080036 -Woverloaded-virtual \
37 -Wno-sign-promo
Shih-wei Liaoc156bc62010-06-07 22:05:52 -070038
Shih-wei Liaoe4454322010-04-07 12:21:42 -070039# Make sure bionic is first so we can include system headers.
40LOCAL_C_INCLUDES := \
41 $(LLVM_ROOT_PATH) \
42 $(LLVM_ROOT_PATH)/include \
43 $(LLVM_ROOT_PATH)/host/include \
44 $(LOCAL_C_INCLUDES)
45
46LOCAL_IS_HOST_MODULE := true
47
48###########################################################
49## Commands for running tblgen to compile a td file
50###########################################################
51define transform-host-td-to-out
52@mkdir -p $(dir $@)
Logan Chien56837862011-12-16 17:38:39 +080053@echo "Host TableGen: $(TBLGEN_LOCAL_MODULE) (gen-$(1)) <= $<"
Shih-wei Liaoe4454322010-04-07 12:21:42 -070054$(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 Chang037754c2010-10-08 20:12:54 +080059 $(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,) \
60 -gen-$(strip $(1)) \
Ying Wangca65f4e2011-05-24 11:20:36 -070061 -o $@ $<
Shih-wei Liaoe4454322010-04-07 12:21:42 -070062endef