1 LOCAL_PATH:= $(call my-dir) 2 3 libpcap_cflags := \ 4 -Wno-macro-redefined \ 5 -Wno-pointer-arith \ 6 -Wno-sign-compare \ 7 -Wno-unused-parameter \ 8 -D_BSD_SOURCE \ 9 -D_U_="__attribute__((unused))" \ 10 -Werror \ 11 12 include $(CLEAR_VARS) 13 14 # (Matches order in libpcap's Makefile.) 15 LOCAL_SRC_FILES := \ 16 pcap-linux.c pcap-usb-linux.c pcap-netfilter-linux-android.c \ 17 fad-getad.c \ 18 pcap.c inet.c fad-helpers.c gencode.c optimize.c nametoaddr.c \ 19 etherent.c savefile.c sf-pcap.c sf-pcap-ng.c pcap-common.c \ 20 bpf_image.c bpf_dump.c \ 21 scanner.c grammar.c bpf_filter.c version.c \ 22 23 LOCAL_CFLAGS += $(libpcap_cflags) 24 LOCAL_CFLAGS += -DHAVE_CONFIG_H 25 26 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 27 28 LOCAL_MODULE:= libpcap 29 30 include $(BUILD_STATIC_LIBRARY) 31 32 include $(CLEAR_VARS) 33 34 LOCAL_WHOLE_STATIC_LIBRARIES := libpcap 35 LOCAL_MODULE := libpcap 36 37 include $(BUILD_SHARED_LIBRARY) 38 39 # (Matches order in libpcap's Makefile.) 40 libpcap_tests := \ 41 tests/valgrindtest.c \ 42 tests/capturetest.c \ 43 tests/can_set_rfmon_test.c \ 44 tests/filtertest.c \ 45 tests/findalldevstest.c \ 46 tests/opentest.c \ 47 tests/reactivatetest.c \ 48 tests/selpolltest.c \ 49 50 $(foreach test,$(libpcap_tests), \ 51 $(eval include $(CLEAR_VARS)) \ 52 $(eval LOCAL_MODULE := libpcap_$(basename $(notdir $(test)))) \ 53 $(eval LOCAL_SRC_FILES := $(test)) \ 54 $(eval LOCAL_CFLAGS := $(libpcap_cflags)) \ 55 $(eval LOCAL_STATIC_LIBRARIES := libpcap) \ 56 $(eval include $(BUILD_NATIVE_TEST)) \ 57 ) 58