1# SPDX-License-Identifier: GPL-2.0 2TEST_BOTH_AF := bench-lookups 3TEST_BOTH_AF += connect 4TEST_BOTH_AF += connect-deny 5TEST_BOTH_AF += icmps-accept icmps-discard 6TEST_BOTH_AF += key-management 7TEST_BOTH_AF += restore 8TEST_BOTH_AF += rst 9TEST_BOTH_AF += self-connect 10TEST_BOTH_AF += seq-ext 11TEST_BOTH_AF += setsockopt-closed 12TEST_BOTH_AF += unsigned-md5 13 14TEST_IPV4_PROGS := $(TEST_BOTH_AF:%=%_ipv4) 15TEST_IPV6_PROGS := $(TEST_BOTH_AF:%=%_ipv6) 16 17TEST_GEN_PROGS := $(TEST_IPV4_PROGS) $(TEST_IPV6_PROGS) 18 19top_srcdir := ../../../../.. 20include ../../lib.mk 21 22HOSTAR ?= ar 23 24LIBDIR := $(OUTPUT)/lib 25LIB := $(LIBDIR)/libaotst.a 26LDLIBS += $(LIB) -pthread 27LIBDEPS := lib/aolib.h Makefile 28 29CFLAGS += -Wall -O2 -g -fno-strict-aliasing 30CFLAGS += $(KHDR_INCLUDES) 31CFLAGS += -iquote ./lib/ -I ../../../../include/ 32 33# Library 34LIBSRC := kconfig.c netlink.c proc.c repair.c setup.c sock.c utils.c 35LIBOBJ := $(LIBSRC:%.c=$(LIBDIR)/%.o) 36EXTRA_CLEAN += $(LIBOBJ) $(LIB) 37 38$(LIB): $(LIBOBJ) 39 $(HOSTAR) rcs $@ $^ 40 41$(LIBDIR)/%.o: ./lib/%.c $(LIBDEPS) 42 mkdir -p $(LIBDIR) 43 $(CC) $< $(CFLAGS) $(CPPFLAGS) -o $@ -c 44 45$(TEST_GEN_PROGS): $(LIB) 46 47$(OUTPUT)/%_ipv4: %.c 48 $(LINK.c) $^ $(LDLIBS) -o $@ 49 50$(OUTPUT)/%_ipv6: %.c 51 $(LINK.c) -DIPV6_TEST $^ $(LDLIBS) -o $@ 52 53$(OUTPUT)/icmps-accept_ipv4: CFLAGS+= -DTEST_ICMPS_ACCEPT 54$(OUTPUT)/icmps-accept_ipv6: CFLAGS+= -DTEST_ICMPS_ACCEPT 55$(OUTPUT)/bench-lookups_ipv4: LDLIBS+= -lm 56$(OUTPUT)/bench-lookups_ipv6: LDLIBS+= -lm 57