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-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
- 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:
@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
-@set UPDATED 25 July 2004
+@set UPDATED 22 July 2004
@set UPDATED-MONTH July 2004
@set EDITION 1.8e
@set VERSION 1.8e
-@set UPDATED 25 July 2004
+@set UPDATED 22 July 2004
@set UPDATED-MONTH July 2004
@set EDITION 1.8e
@set VERSION 1.8e
?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%.
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
?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%.
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
--- /dev/null
+#! /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