From: Derek R. Price Date: Tue, 27 Jul 2004 12:50:56 +0000 (+0000) Subject: * lib/am/yacc.am, lib/am/lex.am: Only compile these targets in X-Git-Tag: Release-1-9~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3783fca9e66dfeedde1a1d3bdfc2273c2b7d281;p=thirdparty%2Fautomake.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 479bb0adc..3b05b7d1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-07-26 Derek R. Price + + * 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 * m4/mkdirp.m4 (AM_PROG_MKDIR_P): Remove `.' from the mkdir_p diff --git a/NEWS b/NEWS index 59230857f..1537a3381 100644 --- 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. Bugs fixed in 1.8.5: diff --git a/doc/automake.texi b/doc/automake.texi index a01c6821b..2b3692869 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -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 diff --git a/doc/stamp-vti b/doc/stamp-vti index cbd3d3131..1868b47c6 100644 --- a/doc/stamp-vti +++ b/doc/stamp-vti @@ -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 diff --git a/doc/version.texi b/doc/version.texi index cbd3d3131..1868b47c6 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -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 diff --git a/lib/am/lex.am b/lib/am/lex.am index 9ce16f9d0..c84b2c0a6 100644 --- a/lib/am/lex.am +++ b/lib/am/lex.am @@ -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 diff --git a/lib/am/yacc.am b/lib/am/yacc.am index cc799c49a..585a039e8 100644 --- a/lib/am/yacc.am +++ b/lib/am/yacc.am @@ -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 index 000000000..f6924288e --- /dev/null +++ b/tests/mmode-lexyacc.test @@ -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 + +# 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 < zardoz.c < joe.l +: > zardoz.y + +$ACLOCAL || exit 1 +$AUTOCONF || exit 1 +$AUTOMAKE || exit 1 + +./configure +$MAKE YACC=false LEX=false