coreutils/tests/Makefile.am.in
Jim Meyering b6220a928f (TESTS_ENVIRONMENT): Define PATH to include
the build src/ directory -- at the front.
($(srcdir)/$x-tests): Depend on Makefile.am.
Use $x as the program name, except when it would be `test' (test is
the sole program tested via mk-script that is also a shell built-in).
In that case, use the old ../../src/$x.
2004-05-31 12:16:47 +00:00

35 lines
1.0 KiB
Makefile

## Process this file with automake to produce Makefile.in -*-Makefile-*-.
##test-files-begin
##test-files-end
EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
noinst_SCRIPTS = $x-tests
TESTS_ENVIRONMENT = \
PATH="`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g'
TESTS = $x-tests
mk_script = $(srcdir)/../mk-script
$(srcdir)/$x-tests: $(mk_script) Test.pm Makefile.am
test '$x' = test && prog=../../src/$x || prog=$x; \
$(PERL) -I$(srcdir) -w -- $(mk_script) $(srcdir) $$prog > $@.n
mv $@.n $@
chmod 755 $@
MAINTAINERCLEANFILES = $x-tests $(maint_gen)
CLEANFILES = $(run_gen)
check: $(maint_gen)
$(srcdir)/Makefile.am: ../Makefile.am.in Test.pm $(mk_script)
rm -f $@ $@t
sed -n '1,/^##test-files-begin/p' $(srcdir)/../Makefile.am.in > $@t
tool=`echo $(subdir)|sed 's/^tests.//;s/-test//'`; \
echo "x = $$tool" >> $@t
$(PERL) -I$(srcdir) -w -- $(mk_script) $(srcdir) --list >> $@t
sed -n '/^##test-files-end/,$$p' $(srcdir)/../Makefile.am.in >> $@t
mv $@t $@