blob: d296c652a9feb75097a3bb6e6f340436ccc5b2a7 [file] [log] [blame]
uid5281789de9aa2003-10-23 18:42:24 +00001#
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
Wanlong Gao4548c6c2012-10-19 18:03:36 +080016# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
uid5281789de9aa2003-10-23 18:42:24 +000017#
18
19###########################################################################
20# name of file : Makefile #
21###########################################################################
uid5281789de9aa2003-10-23 18:42:24 +000022
Simon Xu6f224942013-12-06 11:51:16 +080023top_srcdir ?= ../../..
uid5281789de9aa2003-10-23 18:42:24 +000024
yaberauneyaef772532009-10-09 17:55:43 +000025include $(top_srcdir)/include/mk/testcases.mk
uid5281789de9aa2003-10-23 18:42:24 +000026
yaberauneyaef772532009-10-09 17:55:43 +000027CPPFLAGS += -I$(abs_srcdir)/../include -I$(abs_srcdir)/../testlib -DLTP
uid5281789de9aa2003-10-23 18:42:24 +000028
yaberauneyabf995b22009-10-10 23:53:29 +000029LDFLAGS += $(addprefix -L$(abs_builddir)/../,lib testlib)
30
yaberauneyaef772532009-10-09 17:55:43 +000031LDLIBS += -lsctputil -lsctp -lpthread
uid5281789de9aa2003-10-23 18:42:24 +000032
yaberauneyaef772532009-10-09 17:55:43 +000033V4_TARGETS := $(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/*.c))
uid5281789de9aa2003-10-23 18:42:24 +000034
yaberauneyaef772532009-10-09 17:55:43 +000035V6_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
uid5281789de9aa2003-10-23 18:42:24 +000039
yaberauneyaef772532009-10-09 17:55:43 +000040$(V6_TARGETS): CPPFLAGS += -DTEST_V6=1
uid5281789de9aa2003-10-23 18:42:24 +000041
yaberauneyaef772532009-10-09 17:55:43 +000042%_v6.o: %.c
43 $(COMPILE.c) $(OUTPUT_OPTION) $<
uid5281789de9aa2003-10-23 18:42:24 +000044
yaberauneyaef772532009-10-09 17:55:43 +000045MAKE_TARGETS := $(V4_TARGETS) $(V6_TARGETS)
uid5281789de9aa2003-10-23 18:42:24 +000046
yaberauneyaef772532009-10-09 17:55:43 +000047v4test: $(V4_TARGETS)
uid5281789de9aa2003-10-23 18:42:24 +000048 @for a in $^; \
49 do \
50 echo "./$$a"; \
yaberauneyaef772532009-10-09 17:55:43 +000051 if ./$$a; then \
52 echo "$$a - passed"; \
uid5281789de9aa2003-10-23 18:42:24 +000053 echo ""; \
54 else \
yaberauneyaef772532009-10-09 17:55:43 +000055 echo "$$a - failed"; \
uid5281789de9aa2003-10-23 18:42:24 +000056 exit 1; \
57 fi; \
58 done
59
yaberauneyaef772532009-10-09 17:55:43 +000060v6test: $(V6_TARGETS)
uid5281789de9aa2003-10-23 18:42:24 +000061 @for a in $^; \
62 do \
63 echo "./$$a"; \
yaberauneyaef772532009-10-09 17:55:43 +000064 if ./$$a; then \
65 echo "$$a - passed"; \
uid5281789de9aa2003-10-23 18:42:24 +000066 echo ""; \
67 else \
yaberauneyaef772532009-10-09 17:55:43 +000068 echo "$$a - failed"; \
uid5281789de9aa2003-10-23 18:42:24 +000069 exit 1; \
70 fi; \
71 done
72
yaberauneyaef772532009-10-09 17:55:43 +000073include $(top_srcdir)/include/mk/generic_leaf_target.mk