]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* automake.texi (Building ctags and etags): Rename and adjust as ...
authorAlexandre Duret-Lutz <adl@gnu.org>
Fri, 13 Sep 2002 16:37:01 +0000 (16:37 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Fri, 13 Sep 2002 16:37:01 +0000 (16:37 +0000)
(Building true and false): ... this.
* tests/targetclash.test: New file.
* tests/specflags7.test, tests/specflags8.test: Adjust to build
true and false.
* tests/Makefile.am (TESTS): Add targetclash.test.
(XFAIL_TESTS): Remove specflags7.test and specflags8.test.

ChangeLog
automake.texi
stamp-vti
tests/Makefile.am
tests/Makefile.in
tests/specflags7.test
tests/specflags8.test
tests/targetclash.test [new file with mode: 0755]
version.texi

index 2e60f22f8126200257422c361929707cd35780b0..e0500254ee30b77cb779f9bcfea94ac82cd3e6d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2002-09-13  Alexandre Duret-Lutz  <duret_g@epita.fr>
 
+       * automake.texi (Building ctags and etags): Rename and adjust as ...
+       (Building true and false): ... this.
+       * tests/targetclash.test: New file.
+       * tests/specflags7.test, tests/specflags8.test: Adjust to build
+       true and false.
+       * tests/Makefile.am (TESTS): Add targetclash.test.
+       (XFAIL_TESTS): Remove specflags7.test and specflags8.test.
+
        Diagnose target clashes, for PR automake/344:
        * automake.in (%targets): Record conditionals for definitions.
        (%target_conditional): Remove (obsoleted by %targets).
index bdeccba3e01354ad22290afc2908eee450ff7f0c..2d3db524bbdd499b90183bbade0b0ee2a271b1a9 100644 (file)
@@ -611,7 +611,7 @@ directory in parallel.
 @menu
 * Complete::                    A simple example, start to finish
 * Hello::                       A classic program
-* etags::                       Building etags and ctags
+* true::                        Building true and false
 @end menu
 
 
@@ -681,7 +681,7 @@ Now you can run @code{automake --add-missing} to generate your
 you're done!
 
 
-@node Hello, etags, Complete, Examples
+@node Hello, true, Complete, Examples
 @section A classic program
 
 @cindex Example, GNU Hello
@@ -794,54 +794,54 @@ INCLUDES = -I../intl -DLOCALEDIR=\"$(localedir)\"
 @end example
 
 
-@node etags,  , Hello, Examples
-@section Building etags and ctags
+@node true,  , Hello, Examples
+@section Building true and false
 
-@cindex Example, ctags and etags
-@cindex ctags Example
-@cindex etags Example
+@cindex Example, false and true
+@cindex false Example
+@cindex true Example
 
 Here is another, trickier example.  It shows how to generate two
-programs (@code{ctags} and @code{etags}) from the same source file
-(@file{etags.c}).  The difficult part is that each compilation of
-@file{etags.c} requires different @code{cpp} flags.
+programs (@code{true} and @code{false}) from the same source file
+(@file{true.c}).  The difficult part is that each compilation of
+@file{true.c} requires different @code{cpp} flags.
 
 @example
-bin_PROGRAMS = etags ctags
-ctags_SOURCES =
-ctags_LDADD = ctags.o
+bin_PROGRAMS = true false
+false_SOURCES =
+false_LDADD = false.o
 
-etags.o: etags.c
-        $(COMPILE) -DETAGS_REGEXPS -c etags.c
+true.o: true.c
+        $(COMPILE) -DEXIT_CODE=0 -c true.c
 
-ctags.o: etags.c
-        $(COMPILE) -DCTAGS -o ctags.o -c etags.c
+false.o: true.c
+        $(COMPILE) -DEXIT_CODE=1 -o false.o -c true.c
 @end example
 
-Note that there is no @code{etags_SOURCES} definition.  Automake will
-implicitly assume that there is a source file named @file{etags.c}, and
-define rules to compile @file{etags.o} and link @file{etags}.  The
-@code{etags.o: etags.c} rule supplied by the above @file{Makefile.am},
-will override the Automake generated rule to build @file{etags.o}.
+Note that there is no @code{true_SOURCES} definition.  Automake will
+implicitly assume that there is a source file named @file{true.c}, and
+define rules to compile @file{true.o} and link @file{true}.  The
+@code{true.o: true.c} rule supplied by the above @file{Makefile.am},
+will override the Automake generated rule to build @file{true.o}.
 
-@code{ctags_SOURCES} is defined to be empty---that way no implicit value
+@code{false_SOURCES} is defined to be empty---that way no implicit value
 is substituted.  Because we have not listed the source of
-@file{ctags}, we have to tell Automake how to link the program.  This is
-the purpose of the @code{ctags_LDADD} line.  A @code{ctags_DEPENDENCIES}
-variable, holding the dependencies of the @file{ctags} target will be
+@file{false}, we have to tell Automake how to link the program.  This is
+the purpose of the @code{false_LDADD} line.  A @code{false_DEPENDENCIES}
+variable, holding the dependencies of the @file{false} target will be
 automatically generated by Automake from the contant of
-@code{ctags_LDADD}.
+@code{false_LDADD}.
 
 The above rules won't work if your compiler doesn't accept both
 @samp{-c} and @samp{-o}.  The simplest fix for this is to introduce a
 bogus dependency (to avoid problems with a parallel @code{make}):
 
 @example
-etags.o: etags.c ctags.o
-        $(COMPILE) -DETAGS_REGEXPS -c etags.c
+true.o: true.c false.o
+        $(COMPILE) -DEXIT_CODE=0 -c true.c
 
-ctags.o: etags.c
-        $(COMPILE) -DCTAGS -c etags.c && mv etags.o ctags.o
+false.o: true.c
+        $(COMPILE) -DEXIT_CODE=1 -c true.c && mv true.o false.o
 @end example
 
 Also, these explicit rules do not work if the de-ANSI-fication feature
@@ -849,33 +849,33 @@ is used (@pxref{ANSI}).  Supporting de-ANSI-fication requires a little
 more work:
 
 @example
-etags._o: etags._c ctags.o
-        $(COMPILE) -DETAGS_REGEXPS -c etags.c
+true._o: true._c false.o
+        $(COMPILE) -DEXIT_CODE=0 -c true.c
 
-ctags._o: etags._c
-        $(COMPILE) -DCTAGS -c etags.c && mv etags._o ctags.o
+false._o: true._c
+        $(COMPILE) -DEXIT_CODE=1 -c true.c && mv true._o false.o
 @end example
 
 As it turns out, there is also a much easier way to do this same task.
 Some of the above techniques are useful enough that we've kept the
-example in the manual.  However if you were to build @code{etags} and
-@code{ctags} in real life, you would probably use per-program
+example in the manual.  However if you were to build @code{true} and
+@code{false} in real life, you would probably use per-program
 compilation flags, like so:
 
 @example
-bin_PROGRAMS = ctags etags
+bin_PROGRAMS = false true
 
-ctags_SOURCES = etags.c
-ctags_CPPFLAGS = -DCTAGS
+false_SOURCES = true.c
+false_CPPFLAGS = -DEXIT_CODE=1
 
-etags_SOURCES = etags.c
-etags_CPPFLAGS = -DETAGS_REGEXPS
+true_SOURCES = true.c
+true_CPPFLAGS = -DEXIT_CODE=0
 @end example
 
-In this case Automake will cause @file{etags.c} to be compiled twice,
+In this case Automake will cause @file{true.c} to be compiled twice,
 with different flags.  De-ANSI-fication will work automatically.  In
 this instance, the names of the object files would be chosen by
-automake; they would be @file{ctags-etags.o} and @file{etags-etags.o}.
+automake; they would be @file{false-true.o} and @file{true-true.o}.
 (The name of the object files rarely matters.)
 
 
@@ -1097,6 +1097,8 @@ easier.  These macros can automatically be put into your
 * Requirements::                Configuration requirements
 * Optional::                    Other things Automake recognizes
 * Invoking aclocal::            Auto-generating aclocal.m4
+* aclocal options::             aclocal command line arguments
+* Macro search path::           Modifying aclocal's search path
 * Macros::                      Autoconf macros supplied with Automake
 * Extending aclocal::           Writing your own aclocal macros
 @end menu
@@ -1283,7 +1285,7 @@ generated @file{Makefile.in}s. This macro defines the
 @end table
 
 
-@node Invoking aclocal, Macros, Optional, configure
+@node Invoking aclocal, aclocal options, Optional, configure
 @section Auto-generating aclocal.m4
 
 @cindex Invoking aclocal
@@ -1322,7 +1324,7 @@ comment which will be completely ignored by @code{aclocal}, use
 * Macro search path::           How aclocal finds .m4 files
 @end menu
 
-@node aclocal options, Macro search path, Invoking aclocal, Invoking aclocal
+@node aclocal options, Macro search path, Invoking aclocal, configure
 @section aclocal options
 
 @cindex aclocal, Options
@@ -1365,7 +1367,7 @@ Print the names of the files it examines.
 Print the version number of Automake and exit.
 @end table
 
-@node Macro search path, , aclocal options, Invoking aclocal
+@node Macro search path, Macros, aclocal options, configure
 @section Macro search path
 
 @cindex Macro search path
@@ -1507,7 +1509,7 @@ Similarly, @file{dirlist} can be handy if you have installed a local
 copy Automake on your account and want @command{aclocal} to look for
 macros installed at other places on the system.
 
-@node Macros, Extending aclocal, Invoking aclocal, configure
+@node Macros, Extending aclocal, Macro search path, configure
 @section Autoconf macros supplied with Automake
 
 Automake ships with several Autoconf macros that you can use from your
index 5a2ac1ffa1bed06990e6794e6f82631f364e8bd5..a3d36bbdf021afd7d908180662beeb64e880db83 100644 (file)
--- a/stamp-vti
+++ b/stamp-vti
@@ -1,4 +1,4 @@
-@set UPDATED 9 September 2002
+@set UPDATED 13 September 2002
 @set UPDATED-MONTH September 2002
 @set EDITION 1.6c
 @set VERSION 1.6c
index 869b12b3ffebc1a4733dc4d37f1e08b8eb712e10..8d0d46708b05b9ee4f23c92e4700aad4ee9bc0ff 100644 (file)
@@ -380,6 +380,7 @@ tags.test \
 tagsub.test \
 target.test \
 target-cflags.test \
+targetclash.test \
 texinfo.test \
 texinfo2.test \
 texinfo3.test \
index 9d161cb4041c43d4618a2242c87c514d5066f068..7566afee50209b1ec06a0f0bb400b78a9f5fd3c3 100644 (file)
@@ -472,6 +472,7 @@ tags.test \
 tagsub.test \
 target.test \
 target-cflags.test \
+targetclash.test \
 texinfo.test \
 texinfo2.test \
 texinfo3.test \
@@ -523,7 +524,7 @@ subdir = tests
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
 CONFIG_CLEAN_FILES = defs
 DIST_SOURCES =
-DIST_COMMON = Makefile.am Makefile.in configure.in defs.in
+DIST_COMMON = Makefile.am Makefile.in defs.in
 all: all-am
 
 .SUFFIXES:
index 7cd85b2a13e6fdcf4707f59d64891554f7ece2d1..558d65ce2c64061830ca60956f80f633d33bb769 100755 (executable)
@@ -18,7 +18,7 @@
 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 
-# The ctags/etags example from the manual, plus a check for _SHORTNAME.
+# The true/false example from the manual, plus a check for _SHORTNAME.
 
 required=gcc
 . ./defs || exit 1
@@ -31,24 +31,24 @@ AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-bin_PROGRAMS = etags ctags
-ctags_SOURCES = etags.c
-ctags_CFLAGS = -DCTAGS
-ctags_SHORTNAME = c
-# No etags_SOURCES definition.  Use the default source.
-etags_CFLAGS = -DETAGS
-etags_SHORTNAME = e
+bin_PROGRAMS = false true
+true_SOURCES = false.c
+true_CFLAGS = -DTRUE
+true_SHORTNAME = t
+# No false_SOURCES definition.  Use the default source.
+false_CFLAGS = -DFALSE
+false_SHORTNAME = f
 END
 
-cat > etags.c << 'END'
+cat > false.c << 'END'
 #include <stdio.h>
 int
 main (int argc, char *argv[])
 {
-#ifdef CTAGS
-   puts ("ctags");
+#ifdef TRUE
+   puts ("true");
 #else
-   puts ("etags");
+   puts ("false");
 #endif
    return 0;
 }
@@ -60,7 +60,7 @@ $AUTOMAKE -a
 
 ./configure
 $MAKE
-./ctags | grep ctags
-./etags | grep etags
-test -f ./c-etags.o
-test -f ./e-etags.o
+./true | grep true
+./false | grep false
+test -f ./t-false.o
+test -f ./f-false.o
index d2b74bde97f1dbb9cd6a39987f6585d7a3e46608..1d90fff313f42ea885a16508763af4a0abd96f41 100755 (executable)
@@ -18,7 +18,7 @@
 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 
-# Like the ctags/etags example from the manual,
+# Like the true/false example from the manual,
 # with one extra indirection in the sources (PR/315), and
 # use of _CPPFLAGS (PR/337).
 
@@ -37,23 +37,23 @@ END
 # different flags.
 
 cat > Makefile.am << 'END'
-ETAGSSOURCE = etags.c
-bin_PROGRAMS = etags ctags
-ctags_SOURCES = $(ETAGSSOURCE)
-ctags_CPPFLAGS = -DCTAGS
-etags_SOURCES = $(ETAGSSOURCE)
-etags_CPPFLAGS = -DETAGS
+FALSESOURCE = false.c
+bin_PROGRAMS = false true
+true_SOURCES = $(FALSESOURCE)
+true_CPPFLAGS = -DTRUE
+false_SOURCES = $(FALSESOURCE)
+false_CPPFLAGS = -DFALSE
 END
 
-cat > etags.c << 'END'
+cat > false.c << 'END'
 #include <stdio.h>
 int
 main (int argc, char *argv[])
 {
-#ifdef CTAGS
-   puts ("ctags");
+#ifdef TRUE
+   puts ("true");
 #else
-   puts ("etags");
+   puts ("false");
 #endif
    return 0;
 }
@@ -65,5 +65,5 @@ $AUTOMAKE -a
 
 ./configure
 $MAKE
-./ctags | grep ctags
-./etags | grep etags
+./true | grep true
+./false | grep false
diff --git a/tests/targetclash.test b/tests/targetclash.test
new file mode 100755 (executable)
index 0000000..91ca5ef
--- /dev/null
@@ -0,0 +1,40 @@
+#! /bin/sh
+# Copyright (C) 2002  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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.
+#
+# GNU Automake 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 autoconf; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check that target clashes are diagnosed.
+
+required=gcc
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = ctags
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a 2>stderr && exit 1
+cat stderr
+grep 'redefinition.*ctags' stderr
index 5a2ac1ffa1bed06990e6794e6f82631f364e8bd5..a3d36bbdf021afd7d908180662beeb64e880db83 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 9 September 2002
+@set UPDATED 13 September 2002
 @set UPDATED-MONTH September 2002
 @set EDITION 1.6c
 @set VERSION 1.6c