Tizen 2.0 Release
[external/tizen-coreutils.git] / tests / tac / 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 = tac
23 explicit =
24 maint_gen = basic-0.I basic-0.X basic-a.I basic-a.X basic-b.I basic-b.X \
25 basic-c.I basic-c.X basic-d.I basic-d.X basic-e.I basic-e.X basic-f.I \
26 basic-f.X basic-g.I basic-g.X basic-h.I basic-h.X basic-i.I basic-i.X \
27 basic-j.I basic-j.X basic-k.I basic-k.X b2-e.I b2-e.X b2-f.I b2-f.X b2-g.I \
28 b2-g.X b2-h.I b2-h.X b2-i.I b2-i.X b2-j.I b2-j.X b2-k.I b2-k.X opt-b.I \
29 opt-b.X opt-s.I opt-s.X opt-sb.I opt-sb.X opt-r.I opt-r.X opt-r2.I opt-r2.X \
30 opt-br.I opt-br.X opt-br2.I opt-br2.X
31 run_gen = basic-0.O basic-0.E basic-a.O basic-a.E basic-b.O basic-b.E \
32 basic-c.O basic-c.E basic-d.O basic-d.E basic-e.O basic-e.E basic-f.O \
33 basic-f.E basic-g.O basic-g.E basic-h.O basic-h.E basic-i.O basic-i.E \
34 basic-j.O basic-j.E basic-k.O basic-k.E b2-e.O b2-e.E b2-f.O b2-f.E b2-g.O \
35 b2-g.E b2-h.O b2-h.E b2-i.O b2-i.E b2-j.O b2-j.E b2-k.O b2-k.E opt-b.O \
36 opt-b.E opt-s.O opt-s.E opt-sb.O opt-sb.E opt-r.O opt-r.E opt-r2.O opt-r2.E \
37 opt-br.O opt-br.E opt-br2.O opt-br2.E
38 ##test-files-end
39
40 EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
41 noinst_SCRIPTS = $x-tests
42 TESTS_ENVIRONMENT = \
43   CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
44   PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
45
46 editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g'
47
48 TESTS = $x-tests
49
50 mk_script = $(srcdir)/../mk-script
51 $(srcdir)/$x-tests: $(mk_script) Test.pm Makefile.am
52         test '$x' = test && prog=../../src/$x || prog=$x; \
53         $(PERL) -I$(srcdir) -w -- $(mk_script) $(srcdir) $$prog > $@.n
54         mv $@.n $@
55         chmod 755 $@
56
57 MAINTAINERCLEANFILES = $x-tests $(maint_gen)
58 CLEANFILES = $(run_gen)
59
60 check: $(maint_gen)
61
62 $(srcdir)/Makefile.am: ../Makefile.am.in Test.pm $(mk_script)
63         rm -f $@ $@t
64         sed -n '1,/^##test-files-begin/p' $(srcdir)/../Makefile.am.in > $@t
65         tool=`echo $(subdir)|sed 's/^tests.//;s/-test//'`; \
66           echo "x = $$tool" >> $@t
67         $(PERL) -I$(srcdir) -w -- $(mk_script) $(srcdir) --list >> $@t
68         sed -n '/^##test-files-end/,$$p' $(srcdir)/../Makefile.am.in >> $@t
69         chmod -w $@t
70         mv $@t $@