Tizen 2.0 Release
[external/tizen-coreutils.git] / tests / wc / Makefile.am
1 # Make coreutils tests.                                 -*-Makefile-*-
2
3 # Copyright (C) 1997, 1998, 2000, 2003, 2004, 2006 Free Software
4 # Foundation, Inc.
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 # 02110-1301, USA.
20
21 ##test-files-begin
22 x = wc
23 explicit =
24 maint_gen = a0.I a0.X a1.I a1.X a2.I a2.X a3.I a3.X a4.I a4.X a5.I a5.X a6.I \
25 a6.X a7.I a7.X a8.I a8.X a9.I a9.X b0.I b0.X b1.I b1.X c0.I c0.X c1.I c1.X \
26 c2.I c2.X
27 run_gen = a0.O a0.E a1.O a1.E a2.O a2.E a3.O a3.E a4.O a4.E a5.O a5.E a6.O \
28 a6.E a7.O a7.E a8.O a8.E a9.O a9.E b0.O b0.E b1.O b1.E c0.O c0.E c1.O c1.E \
29 c2.O c2.E
30 ##test-files-end
31
32 EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
33 noinst_SCRIPTS = $x-tests
34 TESTS_ENVIRONMENT = \
35   CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
36   PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
37
38 editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g'
39
40 TESTS = $x-tests
41
42 mk_script = $(srcdir)/../mk-script
43 $(srcdir)/$x-tests: $(mk_script) Test.pm Makefile.am
44         test '$x' = test && prog=../../src/$x || prog=$x; \
45         $(PERL) -I$(srcdir) -w -- $(mk_script) $(srcdir) $$prog > $@.n
46         mv $@.n $@
47         chmod 755 $@
48
49 MAINTAINERCLEANFILES = $x-tests $(maint_gen)
50 CLEANFILES = $(run_gen)
51
52 check: $(maint_gen)
53
54 $(srcdir)/Makefile.am: ../Makefile.am.in Test.pm $(mk_script)
55         rm -f $@ $@t
56         sed -n '1,/^##test-files-begin/p' $(srcdir)/../Makefile.am.in > $@t
57         tool=`echo $(subdir)|sed 's/^tests.//;s/-test//'`; \
58           echo "x = $$tool" >> $@t
59         $(PERL) -I$(srcdir) -w -- $(mk_script) $(srcdir) --list >> $@t
60         sed -n '/^##test-files-end/,$$p' $(srcdir)/../Makefile.am.in >> $@t
61         chmod -w $@t
62         mv $@t $@