blob: b8f38c762db4c5880c1a9337c14bd03d82192994 [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 \
Shih-wei Liaoe4454322010-04-07 12:21:42 -07005 -O2 \
6 -fomit-frame-pointer \
Shih-wei Liaoe4454322010-04-07 12:21:42 -07007 -Wall \
8 -W \
9 -Wno-unused-parameter \
10 -Wwrite-strings \
11 $(LOCAL_CFLAGS)
12
Ying Wang5183d482010-08-20 10:59:12 -070013ifneq ($(TARGET_SIMULATOR),true)
14LOCAL_CFLAGS := -DANDROID_TARGET_BUILD $(LOCAL_CFLAGS)
15endif
16
Shih-wei Liao44ce4442010-05-04 03:19:48 -070017ifeq ($(LLVM_ENABLE_ASSERTION),true)
18LOCAL_CFLAGS := \
19 -D_DEBUG \
20 -UNDEBUG \
21 $(LOCAL_CFLAGS)
22endif
23
Shih-wei Liaoe4454322010-04-07 12:21:42 -070024ifneq ($(REQUIRES_EH),1)
25LOCAL_CFLAGS += -fno-exceptions
26else
Shih-wei Liaoc156bc62010-06-07 22:05:52 -070027# No action. The device target should not have exception enabled since bionic
Shih-wei Liaoe4454322010-04-07 12:21:42 -070028# doesn't support it
29REQUIRES_EH := 0
30endif
31
32ifneq ($(REQUIRES_RTTI),1)
Patrick Scottc3648862010-05-07 08:38:22 -040033LOCAL_CPPFLAGS += -fno-rtti
Shih-wei Liaoe4454322010-04-07 12:21:42 -070034else
35REQUIRES_RTTI := 0
36endif
37
Shih-wei Liao7abe37e2010-04-28 01:47:00 -070038LOCAL_CPPFLAGS := \
39 $(LOCAL_CPPFLAGS) \
Shih-wei Liao7abe37e2010-04-28 01:47:00 -070040 -Woverloaded-virtual
Shih-wei Liaoc156bc62010-06-07 22:05:52 -070041
Shih-wei Liaoe4454322010-04-07 12:21:42 -070042# Make sure bionic is first so we can include system headers.
43LOCAL_C_INCLUDES := \
Shih-wei Liaoe4454322010-04-07 12:21:42 -070044 $(LLVM_ROOT_PATH) \
45 $(LLVM_ROOT_PATH)/include \
46 $(LLVM_ROOT_PATH)/device/include \
47 $(LOCAL_C_INCLUDES)
48
Ying Wang5183d482010-08-20 10:59:12 -070049ifneq ($(TARGET_SIMULATOR),true)
50LOCAL_C_INCLUDES := \
51 bionic \
52 external/stlport/stlport \
53 $(LOCAL_C_INCLUDES)
54endif
55
Shih-wei Liaoe4454322010-04-07 12:21:42 -070056###########################################################
57## Commands for running tblgen to compile a td file
58###########################################################
59define transform-device-td-to-out
60@mkdir -p $(dir $@)
61@echo "Device TableGen (gen-$(1)): $(LOCAL_MODULE) <= $<"
62$(hide) $(TBLGEN) \
63 -I $(dir $<) \
64 -I $(LLVM_ROOT_PATH)/include \
65 -I $(LLVM_ROOT_PATH)/device/include \
66 -I $(LLVM_ROOT_PATH)/lib/Target \
67 -gen-$(strip $(1)) \
68 -o $@ $<
69endef