]> sourceware.org Git - automake.git/commitdiff
* automake.in (handle_phony): Sort.
authorAkim Demaille <akim@epita.fr>
Mon, 29 Jan 2001 09:41:41 +0000 (09:41 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 29 Jan 2001 09:41:41 +0000 (09:41 +0000)
(file_contents_with_transform): Catch `.PHONY:'.
(handle_tests): Instead dumping the hard coded target check-TESTS
and registering its .PHONYsm, get them from...
* check.am: here, new file.

12 files changed:
ChangeLog
Makefile.am
Makefile.in
automake.in
check.am [new file with mode: 0644]
lib/am/Makefile.am
lib/am/check.am [new file with mode: 0644]
m4/Makefile.in
tests/ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/check.test [new file with mode: 0755]

index 946cd9ee12f8af50adf263efaacd65ea4f6f610a..41cf6a748ef26483b5d20e945fd23466ee984029 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2001-01-29  Akim Demaille  <akim@epita.fr>
+
+       * automake.in (handle_phony): Sort.
+       (file_contents_with_transform): Catch `.PHONY:'.
+       (handle_tests): Instead dumping the hard coded target check-TESTS
+       and registering its .PHONYsm, get them from...
+       * check.am: here, new file.
+
 2001-01-29  Akim Demaille  <akim@epita.fr>
 
        * automake.in (add_depend2): Use &transform.
index 15e84672051804c9dd29c12c3dc48aa12410bb0c..d57748557e46ef35c8c0bbc30284b205f3709790 100644 (file)
@@ -10,14 +10,14 @@ SUBDIRS = . m4 tests
 bin_SCRIPTS = automake aclocal
 info_TEXINFOS = automake.texi
 
-amfiles = clean-hdr.am clean-kr.am clean.am comp-vars.am compile.am \
-data-clean.am data.am dejagnu.am depend.am depend2.am dist.am \
-dist-vars.am footer.am header-vars.am header.am java-clean.am java.am \
-kr-extra.am library.am libs-clean.am libs.am libtool.am lisp-clean.am \
-lisp.am ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am \
-multilib.am program.am progs-clean.am progs.am python.am \
-python-clean.am remake-hdr.am remake.am scripts.am subdirs.am \
-tags-clean.am tags.am texi-vers.am texinfos.am
+amfiles = check.am clean-hdr.am clean-kr.am clean.am comp-vars.am \
+compile.am data-clean.am data.am dejagnu.am depend.am depend2.am \
+dist.am dist-vars.am footer.am header-vars.am header.am java-clean.am \
+java.am kr-extra.am library.am libs-clean.am libs.am libtool.am \
+lisp-clean.am lisp.am ltlib-clean.am ltlib.am ltlibrary.am \
+mans-vars.am mans.am multilib.am program.am progs-clean.am progs.am \
+python.am python-clean.am remake-hdr.am remake.am scripts.am \
+subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am
 
 dist_pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \
 $(amfiles)
index 9b110d308622a632a7f0b61513d5fef6545f9316..c197541c7699c8e2253381d851fa9794dc6c8d0d 100644 (file)
@@ -77,14 +77,14 @@ SUBDIRS = . m4 tests
 bin_SCRIPTS = automake aclocal
 info_TEXINFOS = automake.texi
 
-amfiles = clean-hdr.am clean-kr.am clean.am comp-vars.am compile.am \
-data-clean.am data.am dejagnu.am depend.am depend2.am dist.am \
-dist-vars.am footer.am header-vars.am header.am java-clean.am java.am \
-kr-extra.am library.am libs-clean.am libs.am libtool.am lisp-clean.am \
-lisp.am ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am \
-multilib.am program.am progs-clean.am progs.am python.am \
-python-clean.am remake-hdr.am remake.am scripts.am subdirs.am \
-tags-clean.am tags.am texi-vers.am texinfos.am
+amfiles = check.am clean-hdr.am clean-kr.am clean.am comp-vars.am \
+compile.am data-clean.am data.am dejagnu.am depend.am depend2.am \
+dist.am dist-vars.am footer.am header-vars.am header.am java-clean.am \
+java.am kr-extra.am library.am libs-clean.am libs.am libtool.am \
+lisp-clean.am lisp.am ltlib-clean.am ltlib.am ltlibrary.am \
+mans-vars.am mans.am multilib.am program.am progs-clean.am progs.am \
+python.am python-clean.am remake-hdr.am remake.am scripts.am \
+subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am
 
 
 dist_pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \
@@ -602,24 +602,25 @@ maintainer-clean-am:  maintainer-clean-vti maintainer-clean-aminfo \
 maintainer-clean: maintainer-clean-recursive
        -rm -f config.status
 
-.PHONY: uninstall-binSCRIPTS install-binSCRIPTS mostlyclean-vti \
-distclean-vti clean-vti maintainer-clean-vti install-info-am \
-uninstall-info mostlyclean-aminfo distclean-aminfo clean-aminfo \
-maintainer-clean-aminfo uninstall-dist_pkgdataDATA \
-install-dist_pkgdataDATA uninstall-dist_scriptDATA \
-install-dist_scriptDATA install-recursive uninstall-recursive \
-install-data-recursive uninstall-data-recursive install-exec-recursive \
-uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
-all-recursive check-recursive installcheck-recursive info-recursive \
-dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
-maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
-dvi-am dvi check check-am installcheck-local installcheck-am \
-installcheck install-exec-am install-exec install-data-am install-data \
-install-am install uninstall-am uninstall all-redirect all-am all \
-install-strip installdirs-am installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+.PHONY: all all-am all-recursive all-redirect check check-am \
+check-recursive clean clean-aminfo clean-generic clean-recursive \
+clean-tags clean-vti distclean distclean-aminfo distclean-generic \
+distclean-recursive distclean-tags distclean-vti distdir dvi dvi-am \
+dvi-recursive info info-am info-recursive install install-am \
+install-binSCRIPTS install-data install-data-am install-data-recursive \
+install-dist_pkgdataDATA install-dist_scriptDATA install-exec \
+install-exec-am install-exec-recursive install-info-am \
+install-recursive install-strip installcheck installcheck-am \
+installcheck-local installcheck-recursive installdirs installdirs-am \
+installdirs-recursive maintainer-clean maintainer-clean-aminfo \
+maintainer-clean-generic maintainer-clean-recursive \
+maintainer-clean-tags maintainer-clean-vti mostlyclean \
+mostlyclean-aminfo mostlyclean-generic mostlyclean-recursive \
+mostlyclean-tags mostlyclean-vti tags tags-recursive uninstall \
+uninstall-am uninstall-binSCRIPTS uninstall-data-recursive \
+uninstall-dist_pkgdataDATA uninstall-dist_scriptDATA \
+uninstall-exec-recursive uninstall-info uninstall-recursive \
+uninstalldirs-recursive
 
 
 install-data-hook:
index 732481e501ab67ef8569ffe915f556401ecf19fe..75b22aca95211d18b232a7d3eccc41fb8c4ed0f0 100755 (executable)
@@ -4057,7 +4057,7 @@ sub do_one_clean_target
 # Handle .PHONY target.
 sub handle_phony
 {
-    &pretty_print_rule ('.PHONY:', "", @phony);
+    &pretty_print_rule ('.PHONY:', "", sort @phony);
     $output_rules .= "\n";
 }
 
@@ -4146,65 +4146,10 @@ sub handle_tests
     if (&variable_defined ('TESTS'))
     {
        push (@check_tests, 'check-TESTS');
-       push (@phony, 'check-TESTS');
 
        # Note: Solaris 2.7 seems to expand TESTS using VPATH.  That's
        # why we also try `dir='
-       $output_rules .= 'check-TESTS: $(TESTS)
-       @failed=0; all=0; xfail=0; xpass=0; \\
-       srcdir=$(srcdir); export srcdir; \\
-       list=' . "'\$(TESTS)'; \\" . '
-       if test -n "$$list"; then \\
-         for tst in $$list; do \\
-           if test -f ./$$tst; then dir=./; \\
-           elif test -f $$tst; then dir=; \\
-           else dir="$(srcdir)/"; fi; \\
-           if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \\
-             all=`expr $$all + 1`; \\
-             case " $(XFAIL_TESTS) " in \\
-             *" $$tst "*) \\
-               xpass=`expr $$xpass + 1`; \\
-               failed=`expr $$failed + 1`; \\
-               echo "XPASS: $$tst"; \\
-             ;; \\
-             *) \\
-               echo "PASS: $$tst"; \\
-             ;; \\
-             esac; \\
-           elif test $$? -ne 77; then \\
-             all=`expr $$all + 1`; \\
-             case " $(XFAIL_TESTS) " in \\
-             *" $$tst "*) \\
-               xfail=`expr $$xfail + 1`; \\
-               echo "XFAIL: $$tst"; \\
-             ;; \\
-             *) \\
-               failed=`expr $$failed + 1`; \\
-               echo "FAIL: $$tst"; \\
-             ;; \\
-             esac; \\
-           fi; \\
-         done; \\
-         if test "$$failed" -eq 0; then \\
-           if test "$$xfail" -eq 0; then \\
-             banner="All $$all tests passed"; \\
-           else \\
-             banner="All $$all tests behaved as expected ($$xfail expected failures)"; \\
-           fi; \\
-         else \\
-           if test "$$xpass" -eq 0; then \\
-             banner="$$failed of $$all tests failed"; \\
-           else \\
-             banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \\
-           fi; \\
-         fi; \\
-         dashes=`echo "$$banner" | sed s/./=/g`; \\
-         echo "$$dashes"; \\
-         echo "$$banner"; \\
-         echo "$$dashes"; \\
-         test "$$failed" -eq 0; \\
-       fi
-';
+       $output_rules .= &file_contents ('check');
     }
 }
 
@@ -6968,6 +6913,10 @@ sub initialize_per_input
 
 ################################################################
 
+
+# $CONTENTS
+# &file_contents_with_transform ($COMMAND, $BASENAME)
+# ---------------------------------------------------
 # Return contents of a file from $am_dir, automatically skipping
 # macros or rules which are already known.  Runs command on each line
 # as it is read; this command can modify $_.
@@ -7038,6 +6987,12 @@ sub file_contents_with_transform
            }
            $saw_bk = /\\$/;
        }
+       elsif (/^.PHONY: (.*)$/)
+       {
+           # Having a special case for PHONY upstream seems much easier than
+           # trying to have it fit in RULE_PATTERN and extract it later.
+           push (@phony, split (/\s+/, $1));
+       }
        elsif (/$RULE_PATTERN/o)
        {
            # Found a rule.
diff --git a/check.am b/check.am
new file mode 100644 (file)
index 0000000..efe6054
--- /dev/null
+++ b/check.am
@@ -0,0 +1,76 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright 2001 Free Software Foundation, Inc.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+## 02111-1307, USA.
+
+.PHONY: check-TESTS
+
+check-TESTS: $(TESTS)
+       @failed=0; all=0; xfail=0; xpass=0; \
+       srcdir=$(srcdir); export srcdir; \
+       list='$(TESTS)'; \
+       if test -n "$$list"; then \
+         for tst in $$list; do \
+           if test -f ./$$tst; then dir=./; \
+## Note: Solaris 2.7 seems to expand TESTS using VPATH.  That's
+## why we also try `dir='
+           elif test -f $$tst; then dir=; \
+           else dir="$(srcdir)/"; fi; \
+           if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+             all=`expr $$all + 1`; \
+             case " $(XFAIL_TESTS) " in \
+             *" $$tst "*) \
+               xpass=`expr $$xpass + 1`; \
+               failed=`expr $$failed + 1`; \
+               echo "XPASS: $$tst"; \
+             ;; \
+             *) \
+               echo "PASS: $$tst"; \
+             ;; \
+             esac; \
+           elif test $$? -ne 77; then \
+             all=`expr $$all + 1`; \
+             case " $(XFAIL_TESTS) " in \
+             *" $$tst "*) \
+               xfail=`expr $$xfail + 1`; \
+               echo "XFAIL: $$tst"; \
+             ;; \
+             *) \
+               failed=`expr $$failed + 1`; \
+               echo "FAIL: $$tst"; \
+             ;; \
+             esac; \
+           fi; \
+         done; \
+         if test "$$failed" -eq 0; then \
+           if test "$$xfail" -eq 0; then \
+             banner="All $$all tests passed"; \
+           else \
+             banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+           fi; \
+         else \
+           if test "$$xpass" -eq 0; then \
+             banner="$$failed of $$all tests failed"; \
+           else \
+             banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+           fi; \
+         fi; \
+         dashes=`echo "$$banner" | sed s/./=/g`; \
+         echo "$$dashes"; \
+         echo "$$banner"; \
+         echo "$$dashes"; \
+         test "$$failed" -eq 0; \
+       fi
index 15e84672051804c9dd29c12c3dc48aa12410bb0c..d57748557e46ef35c8c0bbc30284b205f3709790 100644 (file)
@@ -10,14 +10,14 @@ SUBDIRS = . m4 tests
 bin_SCRIPTS = automake aclocal
 info_TEXINFOS = automake.texi
 
-amfiles = clean-hdr.am clean-kr.am clean.am comp-vars.am compile.am \
-data-clean.am data.am dejagnu.am depend.am depend2.am dist.am \
-dist-vars.am footer.am header-vars.am header.am java-clean.am java.am \
-kr-extra.am library.am libs-clean.am libs.am libtool.am lisp-clean.am \
-lisp.am ltlib-clean.am ltlib.am ltlibrary.am mans-vars.am mans.am \
-multilib.am program.am progs-clean.am progs.am python.am \
-python-clean.am remake-hdr.am remake.am scripts.am subdirs.am \
-tags-clean.am tags.am texi-vers.am texinfos.am
+amfiles = check.am clean-hdr.am clean-kr.am clean.am comp-vars.am \
+compile.am data-clean.am data.am dejagnu.am depend.am depend2.am \
+dist.am dist-vars.am footer.am header-vars.am header.am java-clean.am \
+java.am kr-extra.am library.am libs-clean.am libs.am libtool.am \
+lisp-clean.am lisp.am ltlib-clean.am ltlib.am ltlibrary.am \
+mans-vars.am mans.am multilib.am program.am progs-clean.am progs.am \
+python.am python-clean.am remake-hdr.am remake.am scripts.am \
+subdirs.am tags-clean.am tags.am texi-vers.am texinfos.am
 
 dist_pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \
 $(amfiles)
diff --git a/lib/am/check.am b/lib/am/check.am
new file mode 100644 (file)
index 0000000..efe6054
--- /dev/null
@@ -0,0 +1,76 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright 2001 Free Software Foundation, Inc.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+## 02111-1307, USA.
+
+.PHONY: check-TESTS
+
+check-TESTS: $(TESTS)
+       @failed=0; all=0; xfail=0; xpass=0; \
+       srcdir=$(srcdir); export srcdir; \
+       list='$(TESTS)'; \
+       if test -n "$$list"; then \
+         for tst in $$list; do \
+           if test -f ./$$tst; then dir=./; \
+## Note: Solaris 2.7 seems to expand TESTS using VPATH.  That's
+## why we also try `dir='
+           elif test -f $$tst; then dir=; \
+           else dir="$(srcdir)/"; fi; \
+           if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+             all=`expr $$all + 1`; \
+             case " $(XFAIL_TESTS) " in \
+             *" $$tst "*) \
+               xpass=`expr $$xpass + 1`; \
+               failed=`expr $$failed + 1`; \
+               echo "XPASS: $$tst"; \
+             ;; \
+             *) \
+               echo "PASS: $$tst"; \
+             ;; \
+             esac; \
+           elif test $$? -ne 77; then \
+             all=`expr $$all + 1`; \
+             case " $(XFAIL_TESTS) " in \
+             *" $$tst "*) \
+               xfail=`expr $$xfail + 1`; \
+               echo "XFAIL: $$tst"; \
+             ;; \
+             *) \
+               failed=`expr $$failed + 1`; \
+               echo "FAIL: $$tst"; \
+             ;; \
+             esac; \
+           fi; \
+         done; \
+         if test "$$failed" -eq 0; then \
+           if test "$$xfail" -eq 0; then \
+             banner="All $$all tests passed"; \
+           else \
+             banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+           fi; \
+         else \
+           if test "$$xpass" -eq 0; then \
+             banner="$$failed of $$all tests failed"; \
+           else \
+             banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+           fi; \
+         fi; \
+         dashes=`echo "$$banner" | sed s/./=/g`; \
+         echo "$$dashes"; \
+         echo "$$banner"; \
+         echo "$$dashes"; \
+         test "$$failed" -eq 0; \
+       fi
index 22efe7c0d280d5a518ee1bb604f1a8621be2eb36..b85960fa15ff9685438add4f2a22b3c76ca2c7d2 100644 (file)
@@ -192,12 +192,12 @@ maintainer-clean-am:  maintainer-clean-generic distclean-am
 
 maintainer-clean: maintainer-clean-am
 
-.PHONY: uninstall-m4dataDATA install-m4dataDATA tags distdir info-am \
-info dvi-am dvi check check-am installcheck-am installcheck \
-install-exec-am install-exec install-data-am install-data install-am \
-install uninstall-am uninstall all-redirect all-am all install-strip \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+.PHONY: all all-am all-redirect check check-am clean clean-generic \
+distclean distclean-generic distdir dvi dvi-am info info-am install \
+install-am install-data install-data-am install-exec install-exec-am \
+install-m4dataDATA install-strip installcheck installcheck-am \
+installdirs maintainer-clean maintainer-clean-generic mostlyclean \
+mostlyclean-generic tags uninstall uninstall-am uninstall-m4dataDATA
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
index 58f3b32d2bb3f88e8fd3be8b5c4eef08b5daa077..fb5f672d808f872f0527b325640b830425c4df7d 100644 (file)
@@ -1,3 +1,7 @@
+2001-01-29  Akim Demaille  <akim@epita.fr>
+
+       * check.test: New.
+
 2001-01-28  Tom Tromey  <tromey@redhat.com>
 
        * listval.test: New file.
index 5d2d975f50df3cf995b82ff1e3868a1f899fa2b7..c23c3f6d18460a6204cd49bd0571b31103a548f8 100644 (file)
@@ -33,6 +33,7 @@ canon2.test \
 canon3.test \
 canon4.test \
 canon5.test \
+check.test \
 checkall.test \
 clean.test \
 colneq.test \
index bd7d1cb7a2698d9af9d50d1d24414b0e8e1c5359..9d7b3bd4170ebfade36af9535ff7d51a860694d6 100644 (file)
@@ -102,6 +102,7 @@ canon2.test \
 canon3.test \
 canon4.test \
 canon5.test \
+check.test \
 checkall.test \
 clean.test \
 colneq.test \
@@ -361,6 +362,7 @@ Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
 tags: TAGS
 TAGS:
 
+
 check-TESTS: $(TESTS)
        @failed=0; all=0; xfail=0; xpass=0; \
        srcdir=$(srcdir); export srcdir; \
@@ -485,12 +487,12 @@ maintainer-clean-am:  maintainer-clean-generic distclean-am
 
 maintainer-clean: maintainer-clean-am
 
-.PHONY: tags check-TESTS distdir info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all install-strip installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+.PHONY: all all-am all-redirect check check-TESTS check-am clean \
+clean-generic distclean distclean-generic distdir dvi dvi-am info \
+info-am install install-am install-data install-data-am install-exec \
+install-exec-am install-strip installcheck installcheck-am installdirs \
+maintainer-clean maintainer-clean-generic mostlyclean \
+mostlyclean-generic tags uninstall uninstall-am
 
 
 distclean-local:
diff --git a/tests/check.test b/tests/check.test
new file mode 100755 (executable)
index 0000000..2cf7508
--- /dev/null
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+# Test Automake style tests.
+
+. $srcdir/defs || exit 1
+
+cat > Makefile.am << 'END'
+TESTS = frob.test
+END
+
+: > frob.test
+
+$AUTOMAKE || exit 1
+
+grep '^check-TESTS:' Makefile.in || exit 1
+grep '^check-DEJAGNU' Makefile.in && exit 1
+
+# check-TESTS is phony.
+sed -n '/^\.PHONY:/,/^$/p' Makefile.in | grep check-TESTS || exit 1
+
+exit 0
This page took 0.049613 seconds and 5 git commands to generate.