blob: ec31228445564d72a16c099e6740e16864694b56 [file] [log] [blame]
Bertrand SIMONNET2ec68922015-07-07 16:30:58 -07001# Google Android makefile for curl and libcurl
2#
3# This file is an updated version of Dan Fandrich's Android.mk, meant to build
4# curl for ToT android with the android build system.
5
6LOCAL_PATH:= $(call my-dir)
7
8# Curl needs a version string.
9# As this will be compiled on multiple platforms, generate a version string from
10# the build environment variables.
11version_string := "Android $(PLATFORM_VERSION) $(TARGET_ARCH_VARIANT)"
12
13curl_CFLAGS := -Wpointer-arith -Wwrite-strings -Wunused -Winline \
14 -Wnested-externs -Wmissing-declarations -Wmissing-prototypes -Wno-long-long \
15 -Wfloat-equal -Wno-multichar -Wsign-compare -Wno-format-nonliteral \
16 -Wendif-labels -Wstrict-prototypes -Wdeclaration-after-statement \
17 -Wno-system-headers -DHAVE_CONFIG_H -DOS='$(version_string)'
18
19curl_includes := \
20 $(LOCAL_PATH)/include/ \
21 $(LOCAL_PATH)/lib \
22 external/boringssl/include \
23 external/zlib/src
24
25#########################
26# Build the libcurl static library
27
28include $(CLEAR_VARS)
29include $(LOCAL_PATH)/lib/Makefile.inc
30
31LOCAL_SRC_FILES := $(addprefix lib/,$(CSOURCES))
32LOCAL_C_INCLUDES := $(curl_includes)
33LOCAL_CFLAGS := $(curl_CFLAGS)
34
35LOCAL_MODULE:= libcurl
36LOCAL_MODULE_TAGS := optional
37
38include $(BUILD_STATIC_LIBRARY)
39
40#########################
41# Build the libcurl shared library
42
43include $(CLEAR_VARS)
44include $(LOCAL_PATH)/lib/Makefile.inc
45
46LOCAL_SRC_FILES := $(addprefix lib/,$(CSOURCES))
47LOCAL_C_INCLUDES := $(curl_includes)
48LOCAL_CFLAGS := $(curl_CFLAGS)
49
50LOCAL_MODULE:= libcurl
51LOCAL_MODULE_TAGS := optional
52LOCAL_SHARED_LIBRARIES := libcrypto libssl libz
53
54include $(BUILD_SHARED_LIBRARY)
55
56#########################
57# Build the curl binary
58
59include $(CLEAR_VARS)
60include $(LOCAL_PATH)/src/Makefile.inc
61LOCAL_SRC_FILES := $(addprefix src/,$(CURL_CFILES))
62
63LOCAL_MODULE := curl
64LOCAL_MODULE_TAGS := optional
65LOCAL_STATIC_LIBRARIES := libcurl
66LOCAL_SHARED_LIBRARIES := libcrypto libssl libz
67
68
69LOCAL_C_INCLUDES := $(curl_includes)
70
71# This may also need to include $(CURLX_CFILES) in order to correctly link
72# if libcurl is changed to be built as a dynamic library
73LOCAL_CFLAGS := $(curl_CFLAGS)
74
75include $(BUILD_EXECUTABLE)