LOCAL_PATH:= $(call my-dir) arm_cflags := -DOPENSSL_BN_ASM_MONT -DAES_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM arm_src_files := $(wildcard $(LOCAL_PATH)/crypto/*/*.S) rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d)) local_src_files := $(call rwildcard, $(LOCAL_PATH), *.c) local_src_files := $(local_src_files:$(LOCAL_PATH)/%=%) excludes := \ $(wildcard $(LOCAL_PATH)/*/asm/x86*.c) \ $(wildcard $(LOCAL_PATH)/LPdir*) \ $(call rwildcard, $(LOCAL_PATH)/camellia, *.c) \ $(call rwildcard, $(LOCAL_PATH)/cast, *.c) \ $(call rwildcard, $(LOCAL_PATH)/engine, *.c) \ $(call rwildcard, $(LOCAL_PATH)/idea, *.c) \ $(call rwildcard, $(LOCAL_PATH)/jpake, *.c) \ $(call rwildcard, $(LOCAL_PATH)/md2, *.c) \ $(call rwildcard, $(LOCAL_PATH)/mdc2, *.c) \ $(call rwildcard, $(LOCAL_PATH)/rc5, *.c) \ $(call rwildcard, $(LOCAL_PATH)/seed, *.c) \ $(call rwildcard, $(LOCAL_PATH)/store, *.c) \ $(wildcard $(LOCAL_PATH)/*/*test.c) \ $(LOCAL_PATH)/conf/cnf_save.c \ $(LOCAL_PATH)/bio/bss_rtcp.c \ $(LOCAL_PATH)/bn/exp.c \ $(LOCAL_PATH)/ec/ecp_nistz256.c $(LOCAL_PATH)/ec/ecp_nistz256_table.c \ $(LOCAL_PATH)/evp/e_dsa.c \ $(LOCAL_PATH)/pkcs7/pk7_enc.c \ $(LOCAL_PATH)/rc4/rc4.c \ $(LOCAL_PATH)/x509v3/v3prin.c \ $(LOCAL_PATH)/x509v3/v3conf.c \ #$(call rwildcard, $(LOCAL_PATH)/cms, *.c) $(call rwildcard, $(LOCAL_PATH)/dh, *.c) $(call rwildcard, $(LOCAL_PATH)/ec, *.c) \ excludes := $(excludes:$(LOCAL_PATH)/%=%) $(warning $(excludes)) local_src_files := $(filter-out $(excludes), $(local_src_files)) local_c_includes := $(sort $(dir $(call rwildcard, , *))) # local_c_includes := $(local_c_includes:$(NDK_PROJECT_DIR)/%=%) local_c_includes += . $(warning $(local_c_includes)) local_c_flags := -DNO_WINDOWS_BRAINDEATH ####################################### # target include $(CLEAR_VARS) include $(LOCAL_PATH)/../android-config.mk LOCAL_SRC_FILES := $(local_src_files) LOCAL_CFLAGS += $(local_c_flags) LOCAL_C_INCLUDES += $(local_c_includes) LOCAL_LDLIBS += -lz LOCAL_SRC_FILES += $(arm_src_files) LOCAL_CFLAGS += $(arm_cflags) LOCAL_MODULE:= libcrypto include $(BUILD_STATIC_LIBRARY) ####################################### # host STATIC library ifeq ($(WITH_HOST_DALVIK),true) include $(CLEAR_VARS) include $(LOCAL_PATH)/../android-config.mk $(warning $(LOCAL_PATH)) LOCAL_SRC_FILES := $(local_src_files) LOCAL_CFLAGS += $(local_c_flags) -DPURIFY LOCAL_C_INCLUDES += $(local_c_includes) LOCAL_SRC_FILES += $(non_arm_src_files) LOCAL_LDLIBS += -ldl LOCAL_MODULE:= libcrypto include $(BUILD_STATIC_LIBRARY) endif