1LOCAL_PATH:= $(call my-dir) 2 3libpcap_cflags := \ 4 -Wno-unused-parameter \ 5 -D_U_="__attribute__((unused))" \ 6 7include $(CLEAR_VARS) 8 9LOCAL_SRC_FILES := \ 10 pcap-linux.c pcap-usb-linux.c pcap-can-linux.c pcap-netfilter-linux.c pcap-netfilter-linux-android.c \ 11 fad-gifc.c \ 12 pcap.c inet.c gencode.c optimize.c nametoaddr.c etherent.c \ 13 savefile.c sf-pcap.c sf-pcap-ng.c pcap-common.c \ 14 bpf/net/bpf_filter.c bpf_image.c bpf_dump.c \ 15 version.c \ 16 17# Generated on the host with `configure && make` and copied across. 18LOCAL_SRC_FILES += grammar.c 19LOCAL_SRC_FILES += scanner.c 20 21LOCAL_CFLAGS += $(libpcap_cflags) 22LOCAL_CFLAGS += -Wno-sign-compare 23LOCAL_CFLAGS += -DHAVE_CONFIG_H 24LOCAL_CFLAGS += -include strings.h # For ffs(3). 25 26LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 27 28LOCAL_MODULE:= libpcap 29 30include $(BUILD_STATIC_LIBRARY) 31 32libpcap_tests := \ 33 tests/capturetest.c \ 34 tests/filtertest.c \ 35 tests/findalldevstest.c \ 36 tests/opentest.c \ 37 tests/reactivatetest.c \ 38 tests/selpolltest.c \ 39 tests/valgrindtest.c \ 40 41$(foreach test,$(libpcap_tests), \ 42 $(eval include $(CLEAR_VARS)) \ 43 $(eval LOCAL_MODULE := libpcap_$(basename $(notdir $(test)))) \ 44 $(eval LOCAL_SRC_FILES := $(test)) \ 45 $(eval LOCAL_CFLAGS := $(libpcap_cflags)) \ 46 $(eval LOCAL_STATIC_LIBRARIES := libpcap) \ 47 $(eval include $(BUILD_NATIVE_TEST)) \ 48) 49