• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2#  (C) Copyright IBM Corp. 2001, 2003
3#
4#  This program is free software;  you can redistribute it and/or modify
5#  it under the terms of the GNU General Public License as published by
6#  the Free Software Foundation; either version 2 of the License, or
7#  (at your option) any later version.
8#
9#  This program is distributed in the hope that it will be useful,
10#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
11#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
12#  the GNU General Public License for more details.
13#
14#  You should have received a copy of the GNU General Public License
15#  along with this program;  if not, write to the Free Software
16#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17#
18
19###########################################################################
20# name of file	: Makefile						  #
21###########################################################################
22
23top_srcdir	?= ../../..
24
25include $(top_srcdir)/include/mk/testcases.mk
26
27CPPFLAGS	+= -I$(abs_srcdir)/../include -I$(abs_srcdir)/../testlib -DLTP
28
29LDFLAGS		+= $(addprefix -L$(abs_builddir)/../,lib testlib)
30
31LDLIBS		+= -lsctputil -lsctp -lpthread
32
33V4_TARGETS	:= $(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/*.c))
34
35V6_TARGETS	:= test_basic_v6 test_fragments_v6 test_getname_v6 \
36		   test_inaddr_any_v6 test_peeloff_v6 \
37		   test_sctp_sendrecvmsg_v6 test_sockopt_v6 \
38		   test_tcp_style_v6 test_timetolive_v6
39
40$(V6_TARGETS): CPPFLAGS += -DTEST_V6=1
41
42%_v6.o: %.c
43	$(COMPILE.c) $(OUTPUT_OPTION) $<
44
45MAKE_TARGETS	:= $(V4_TARGETS) $(V6_TARGETS)
46
47v4test: $(V4_TARGETS)
48	@for a in $^;                           \
49	do                                      \
50		echo "./$$a";                   \
51		if ./$$a; then                  \
52			echo "$$a - passed";    \
53			echo "";                \
54		else                            \
55			echo "$$a - failed";    \
56			exit 1;                 \
57		fi;                             \
58	done
59
60v6test: $(V6_TARGETS)
61	@for a in $^;                           \
62	do                                      \
63		echo "./$$a";                   \
64		if ./$$a; then                  \
65			echo "$$a - passed";    \
66			echo "";                \
67		else                            \
68			echo "$$a - failed";    \
69			exit 1;                 \
70		fi;                             \
71	done
72
73include $(top_srcdir)/include/mk/generic_leaf_target.mk
74