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