]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* lib/am/yacc.am, lib/am/lex.am: Only compile these targets in
authorDerek R. Price <derek@ximbiot.com>
Tue, 27 Jul 2004 12:50:56 +0000 (12:50 +0000)
committerDerek R. Price <derek@ximbiot.com>
Tue, 27 Jul 2004 12:50:56 +0000 (12:50 +0000)
maintainer mode.
* doc/automake.texi (Yacc and Lex): Note dependence on maintainer mode.
* NEWS: Note same dependency.
* tests/mmode-lexyacc.test: New file.

ChangeLog
NEWS
doc/automake.texi
doc/stamp-vti
doc/version.texi
lib/am/lex.am
lib/am/yacc.am
tests/mmode-lexyacc.test [new file with mode: 0755]

index 479bb0adc628202fc7a0eb4eccbc6d2db5ddca15..3b05b7d1b3db6d1240463638fe0e92d3c59df3e0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-07-26  Derek R. Price  <derek@ximbiot.com>
+
+       * lib/am/yacc.am, lib/am/lex.am: Only compile these targets in
+       maintainer mode.
+       * doc/automake.texi (Yacc and Lex): Note dependence on maintainer mode.
+       * NEWS: Note same dependency.
+       * tests/mmode-lexyacc.test: New file.
+
 2004-07-25  Alexandre Duret-Lutz  <adl@gnu.org>
 
        * m4/mkdirp.m4 (AM_PROG_MKDIR_P): Remove `.' from the mkdir_p
diff --git a/NEWS b/NEWS
index 59230857f0390a2cc9bd688e032c8775dc04004d..1537a33819f26f4cc078945c34a41bea31643adf 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -93,6 +93,9 @@ New in 1.8e:
 
   - The manual tells more about SUBDIRS vs. DIST_SUBDIRS.
     It also gives an example of nested packages using AC_CONFIG_SUBDIRS.
+
+  - Yacc and Lex intermediate files are now only built when in maintainer mode
+    once AM_MAINTAINER_MODE has been invoked.
 \f
 Bugs fixed in 1.8.5:
 
index a01c6821b9e9e3ec2e3c2c1ec88fb7ec7d30c56b..2b3692869c5927c0888ede24ba15b8e22b998892 100644 (file)
@@ -3765,6 +3765,10 @@ When @code{lex} is invoked, it is passed @samp{LFLAGS} and
 @samp{AM_LFLAGS}.  The former is a user variable and the latter is
 intended for the @file{Makefile.am} author.
 
+Automake only rebuilds intermediate files for Yacc and Lex sources in
+maintainer mode once AM_MAINTAINER_MODE has been invoked
+(@pxref{maintainer-mode}).
+
 
 
 @cindex ylwrap
index cbd3d31314e4e955dbfc793c306a00178e6a5f97..1868b47c66d1edb9f864c6c3aff1c66c50697de3 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 25 July 2004
+@set UPDATED 22 July 2004
 @set UPDATED-MONTH July 2004
 @set EDITION 1.8e
 @set VERSION 1.8e
index cbd3d31314e4e955dbfc793c306a00178e6a5f97..1868b47c66d1edb9f864c6c3aff1c66c50697de3 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 25 July 2004
+@set UPDATED 22 July 2004
 @set UPDATED-MONTH July 2004
 @set EDITION 1.8e
 @set VERSION 1.8e
index 9ce16f9d0de8628143097f113832d33f689e5cb2..c84b2c0a62fdbb76dc47d93c0e037ea138ddea93 100644 (file)
@@ -18,6 +18,7 @@
 
 ?GENERIC?%EXT%%DERIVED-EXT%:
 ?!GENERIC?%OBJ%: %SOURCE%
+?MAINTAINER-MODE?if MAINTAINER_MODE
 if %?MORE-THAN-ONE%
 ?GENERIC?      $(SHELL) $(YLWRAP) %SOURCE% $(LEX_OUTPUT_ROOT).c %OBJ% -- %COMPILE%
 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
@@ -30,3 +31,10 @@ else !%?MORE-THAN-ONE%
        sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|%OBJ%|' $(LEX_OUTPUT_ROOT).c >%OBJ%
        rm -f $(LEX_OUTPUT_ROOT).c
 endif !%?MORE-THAN-ONE%
+?MAINTAINER-MODE?else !MAINTAINER_MODE
+?MAINTAINER-MODE?      @# Skip this target when not in maintainer mode (see the help on the
+?MAINTAINER-MODE?      @# `--enable-maintainer-mode' option to the `configure' script).
+?MAINTAINER-MODE?      @# Otherwise, the implicit build rules for .l.c built into make could
+?MAINTAINER-MODE?      @# be executed for this target.
+?MAINTAINER-MODE?      @:
+?MAINTAINER-MODE?endif !MAINTAINER_MODE
index cc799c49ad9bcc0929284dc45890d7a1a0a0694d..585a039e82cee56ae3026a1ed658a8a17da3c999 100644 (file)
@@ -18,6 +18,7 @@
 
 ?GENERIC?%EXT%%DERIVED-EXT%:
 ?!GENERIC?%OBJ%: %SOURCE%
+?MAINTAINER-MODE?if MAINTAINER_MODE
 if %?MORE-THAN-ONE%
 ?GENERIC?      $(SHELL) $(YLWRAP) %SOURCE% y.tab.c %OBJ% y.tab.h %BASE%.h y.output %BASE%.output -- %COMPILE%
 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
@@ -48,3 +49,10 @@ else !%?MORE-THAN-ONE%
        sed '/^#/ s|y\.tab\.c|%OBJ%|' y.tab.c >%OBJ%t && mv %OBJ%t %OBJ%
        rm -f y.tab.c
 endif !%?MORE-THAN-ONE%
+?MAINTAINER-MODE?else !MAINTAINER_MODE
+?MAINTAINER-MODE?      @# Skip this target when not in maintainer mode (see the help on the
+?MAINTAINER-MODE?      @# `--enable-maintainer-mode' option to the `configure' script).
+?MAINTAINER-MODE?      @# Otherwise, the implicit build rules for .y.c built into make could
+?MAINTAINER-MODE?      @# be executed for this target.
+?MAINTAINER-MODE?      @:
+?MAINTAINER-MODE?endif !MAINTAINER_MODE
diff --git a/tests/mmode-lexyacc.test b/tests/mmode-lexyacc.test
new file mode 100755 (executable)
index 0000000..f692428
--- /dev/null
@@ -0,0 +1,67 @@
+#! /bin/sh
+# Copyright (C) 1996, 2001, 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 Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Contributed by Derek R. Price <derek@ximbiot.com>
+
+# Test to verify that intermediate files are only built from Yacc and Lex
+# sources in maintainer mode.
+
+. ./defs || exit 1
+
+cat >> configure.in << 'END'
+AM_MAINTAINER_MODE
+AC_PROG_CC
+AM_PROG_LEX
+AC_PROG_YACC
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = zardoz
+zardoz_SOURCES = zardoz.y joe.l
+LDADD = @LEXLIB@
+END
+
+# The point of this test is that it is not dependant on a working lex or yacc.
+cat > joe.c <<EOF
+int joe (int arg)
+{
+    return arg * 2;
+}
+EOF
+cat > zardoz.c <<EOF
+int joe (int arg);
+int main (int argc, char **argv)
+{
+    exit (joe (argc));
+}
+EOF
+
+# Ensure a later timestamp for our Lex & Yacc sources.
+sleep 1
+: > joe.l
+: > zardoz.y
+
+$ACLOCAL || exit 1
+$AUTOCONF || exit 1
+$AUTOMAKE || exit 1
+
+./configure
+$MAKE YACC=false LEX=false