uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 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 |
Wanlong Gao | 4548c6c | 2012-10-19 18:03:36 +0800 | [diff] [blame] | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 17 | # |
| 18 | |
| 19 | ########################################################################### |
| 20 | # name of file : Makefile # |
| 21 | ########################################################################### |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 22 | |
Simon Xu | 6f22494 | 2013-12-06 11:51:16 +0800 | [diff] [blame] | 23 | top_srcdir ?= ../../.. |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 24 | |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 25 | include $(top_srcdir)/include/mk/testcases.mk |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 26 | |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 27 | CPPFLAGS += -I$(abs_srcdir)/../include -I$(abs_srcdir)/../testlib -DLTP |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 28 | |
yaberauneya | bf995b2 | 2009-10-10 23:53:29 +0000 | [diff] [blame] | 29 | LDFLAGS += $(addprefix -L$(abs_builddir)/../,lib testlib) |
| 30 | |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 31 | LDLIBS += -lsctputil -lsctp -lpthread |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 32 | |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 33 | V4_TARGETS := $(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/*.c)) |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 34 | |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 35 | V6_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 |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 39 | |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 40 | $(V6_TARGETS): CPPFLAGS += -DTEST_V6=1 |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 41 | |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 42 | %_v6.o: %.c |
| 43 | $(COMPILE.c) $(OUTPUT_OPTION) $< |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 44 | |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 45 | MAKE_TARGETS := $(V4_TARGETS) $(V6_TARGETS) |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 46 | |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 47 | v4test: $(V4_TARGETS) |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 48 | @for a in $^; \ |
| 49 | do \ |
| 50 | echo "./$$a"; \ |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 51 | if ./$$a; then \ |
| 52 | echo "$$a - passed"; \ |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 53 | echo ""; \ |
| 54 | else \ |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 55 | echo "$$a - failed"; \ |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 56 | exit 1; \ |
| 57 | fi; \ |
| 58 | done |
| 59 | |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 60 | v6test: $(V6_TARGETS) |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 61 | @for a in $^; \ |
| 62 | do \ |
| 63 | echo "./$$a"; \ |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 64 | if ./$$a; then \ |
| 65 | echo "$$a - passed"; \ |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 66 | echo ""; \ |
| 67 | else \ |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 68 | echo "$$a - failed"; \ |
uid52817 | 89de9aa | 2003-10-23 18:42:24 +0000 | [diff] [blame] | 69 | exit 1; \ |
| 70 | fi; \ |
| 71 | done |
| 72 | |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 73 | include $(top_srcdir)/include/mk/generic_leaf_target.mk |