1LOCAL_PATH:= $(call my-dir)
2
3# We need to build this for both the device (as a shared library)
4# and the host (as a static library for tools to use).
5
6common_SRC_FILES := \
7	lib/xmlparse.c \
8	lib/xmlrole.c \
9	lib/xmltok.c
10
11common_CFLAGS := \
12    -Wall \
13    -Wmissing-prototypes -Wstrict-prototypes \
14    -Wno-unused-parameter -Wno-missing-field-initializers \
15    -fexceptions \
16    -DHAVE_EXPAT_CONFIG_H
17
18common_C_INCLUDES += \
19	$(LOCAL_PATH)/lib
20
21common_COPY_HEADERS_TO := libexpat
22common_COPY_HEADERS := \
23	lib/expat.h \
24	lib/expat_external.h
25
26# For the host
27# =====================================================
28
29include $(CLEAR_VARS)
30
31LOCAL_SRC_FILES := $(common_SRC_FILES)
32LOCAL_CFLAGS += $(common_CFLAGS)
33LOCAL_C_INCLUDES += $(common_C_INCLUDES)
34
35ifeq ($(HOST_OS),darwin)
36	LOCAL_CFLAGS += -fno-common
37endif
38
39LOCAL_MODULE:= libexpat
40LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
41LOCAL_MODULE_TAGS := optional
42
43LOCAL_MULTILIB := both
44
45include $(BUILD_HOST_STATIC_LIBRARY)
46
47
48include $(CLEAR_VARS)
49
50LOCAL_SRC_FILES := $(common_SRC_FILES)
51LOCAL_CFLAGS += $(common_CFLAGS)
52LOCAL_C_INCLUDES += $(common_C_INCLUDES)
53
54ifeq ($(HOST_OS),darwin)
55	LOCAL_CFLAGS += -fno-common
56endif
57
58LOCAL_MODULE:= libexpat-host
59LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
60LOCAL_MODULE_TAGS := optional
61LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO)
62LOCAL_COPY_HEADERS := $(common_COPY_HEADERS)
63LOCAL_MULTILIB := both
64
65include $(BUILD_HOST_SHARED_LIBRARY)
66
67
68# For the device
69# =====================================================
70
71# Device static library
72include $(CLEAR_VARS)
73
74ifeq ($(TARGET_ARCH),arm)
75    LOCAL_SDK_VERSION := 8
76else
77    LOCAL_SDK_VERSION := 9
78endif
79
80LOCAL_SRC_FILES := $(common_SRC_FILES)
81LOCAL_CFLAGS += $(common_CFLAGS)
82LOCAL_C_INCLUDES += $(common_C_INCLUDES)
83
84LOCAL_MODULE:= libexpat_static
85LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
86LOCAL_MODULE_TAGS := optional
87
88include $(BUILD_STATIC_LIBRARY)
89
90# Device shared library
91include $(CLEAR_VARS)
92
93ifeq ($(TARGET_ARCH),arm)
94    LOCAL_SDK_VERSION := 8
95else
96    LOCAL_SDK_VERSION := 9
97endif
98
99LOCAL_SYSTEM_SHARED_LIBRARIES := libc
100LOCAL_SRC_FILES := $(common_SRC_FILES)
101LOCAL_CFLAGS += $(common_CFLAGS)
102LOCAL_C_INCLUDES += $(common_C_INCLUDES)
103
104LOCAL_MODULE:= libexpat
105LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
106LOCAL_MODULE_TAGS := optional
107LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO)
108LOCAL_COPY_HEADERS := $(common_COPY_HEADERS)
109
110include $(BUILD_SHARED_LIBRARY)
111