Add/fix copyright notices and adjust to latest GNU FDL.
[platform/upstream/coreutils.git] / tests / Makefile.am.in
1 # Make coreutils tests.                                 -*-Makefile-*-
2
3 # Copyright (C) 1997, 1998, 2000, 2003, 2004 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 ##test-files-end
23
24 EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
25 noinst_SCRIPTS = $x-tests
26 TESTS_ENVIRONMENT = \
27   PATH="`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
28
29 editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g'
30
31 TESTS = $x-tests
32
33 mk_script = $(srcdir)/../mk-script
34 $(srcdir)/$x-tests: $(mk_script) Test.pm Makefile.am
35         test '$x' = test && prog=../../src/$x || prog=$x; \
36         $(PERL) -I$(srcdir) -w -- $(mk_script) $(srcdir) $$prog > $@.n
37         mv $@.n $@
38         chmod 755 $@
39
40 MAINTAINERCLEANFILES = $x-tests $(maint_gen)
41 CLEANFILES = $(run_gen)
42
43 check: $(maint_gen)
44
45 $(srcdir)/Makefile.am: ../Makefile.am.in Test.pm $(mk_script)
46         rm -f $@ $@t
47         sed -n '1,/^##test-files-begin/p' $(srcdir)/../Makefile.am.in > $@t
48         tool=`echo $(subdir)|sed 's/^tests.//;s/-test//'`; \
49           echo "x = $$tool" >> $@t
50         $(PERL) -I$(srcdir) -w -- $(mk_script) $(srcdir) --list >> $@t
51         sed -n '/^##test-files-end/,$$p' $(srcdir)/../Makefile.am.in >> $@t
52         mv $@t $@