Bertrand SIMONNET | 2ec6892 | 2015-07-07 16:30:58 -0700 | [diff] [blame] | 1 | # 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 | |
| 6 | LOCAL_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. |
| 11 | version_string := "Android $(PLATFORM_VERSION) $(TARGET_ARCH_VARIANT)" |
| 12 | |
| 13 | curl_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 | |
| 19 | curl_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 | |
| 28 | include $(CLEAR_VARS) |
| 29 | include $(LOCAL_PATH)/lib/Makefile.inc |
| 30 | |
| 31 | LOCAL_SRC_FILES := $(addprefix lib/,$(CSOURCES)) |
| 32 | LOCAL_C_INCLUDES := $(curl_includes) |
| 33 | LOCAL_CFLAGS := $(curl_CFLAGS) |
| 34 | |
| 35 | LOCAL_MODULE:= libcurl |
| 36 | LOCAL_MODULE_TAGS := optional |
| 37 | |
| 38 | include $(BUILD_STATIC_LIBRARY) |
| 39 | |
| 40 | ######################### |
| 41 | # Build the libcurl shared library |
| 42 | |
| 43 | include $(CLEAR_VARS) |
| 44 | include $(LOCAL_PATH)/lib/Makefile.inc |
| 45 | |
| 46 | LOCAL_SRC_FILES := $(addprefix lib/,$(CSOURCES)) |
| 47 | LOCAL_C_INCLUDES := $(curl_includes) |
| 48 | LOCAL_CFLAGS := $(curl_CFLAGS) |
| 49 | |
| 50 | LOCAL_MODULE:= libcurl |
| 51 | LOCAL_MODULE_TAGS := optional |
| 52 | LOCAL_SHARED_LIBRARIES := libcrypto libssl libz |
| 53 | |
| 54 | include $(BUILD_SHARED_LIBRARY) |
| 55 | |
| 56 | ######################### |
| 57 | # Build the curl binary |
| 58 | |
| 59 | include $(CLEAR_VARS) |
| 60 | include $(LOCAL_PATH)/src/Makefile.inc |
| 61 | LOCAL_SRC_FILES := $(addprefix src/,$(CURL_CFILES)) |
| 62 | |
| 63 | LOCAL_MODULE := curl |
| 64 | LOCAL_MODULE_TAGS := optional |
| 65 | LOCAL_STATIC_LIBRARIES := libcurl |
| 66 | LOCAL_SHARED_LIBRARIES := libcrypto libssl libz |
| 67 | |
| 68 | |
| 69 | LOCAL_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 |
| 73 | LOCAL_CFLAGS := $(curl_CFLAGS) |
| 74 | |
| 75 | include $(BUILD_EXECUTABLE) |