• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# SPDX-License-Identifier: GPL-2.0-or-later
2# (C) Copyright IBM Corp. 2001, 2003
3
4top_srcdir	?= ../../..
5
6include $(top_srcdir)/include/mk/testcases.mk
7
8CPPFLAGS	+= -I$(abs_srcdir)/../include -I$(abs_srcdir)/../testlib -DLTP
9
10LDFLAGS		+= $(addprefix -L$(abs_builddir)/../,lib testlib)
11
12LDLIBS		+= -lsctputil -lsctp -lpthread
13
14V4_TARGETS	:= $(patsubst $(abs_srcdir)/%.c,%,$(sort $(wildcard $(abs_srcdir)/*.c)))
15
16V6_TARGETS	:= test_basic_v6 test_fragments_v6 test_getname_v6 \
17		   test_inaddr_any_v6 test_peeloff_v6 \
18		   test_sctp_sendrecvmsg_v6 test_sockopt_v6 \
19		   test_tcp_style_v6 test_timetolive_v6
20
21$(V6_TARGETS): CPPFLAGS += -DTEST_V6=1
22
23%_v6.o: %.c
24	$(COMPILE.c) $(OUTPUT_OPTION) $<
25
26MAKE_TARGETS	:= $(V4_TARGETS) $(V6_TARGETS)
27
28v4test: $(V4_TARGETS)
29	@for a in $^;                           \
30	do                                      \
31		echo "./$$a";                   \
32		if ./$$a; then                  \
33			echo "$$a - passed";    \
34			echo "";                \
35		else                            \
36			echo "$$a - failed";    \
37			exit 1;                 \
38		fi;                             \
39	done
40
41v6test: $(V6_TARGETS)
42	@for a in $^;                           \
43	do                                      \
44		echo "./$$a";                   \
45		if ./$$a; then                  \
46			echo "$$a - passed";    \
47			echo "";                \
48		else                            \
49			echo "$$a - failed";    \
50			exit 1;                 \
51		fi;                             \
52	done
53
54include $(top_srcdir)/include/mk/generic_leaf_target.mk
55