summaryrefslogtreecommitdiff
path: root/lib/am/lex.am
diff options
context:
space:
mode:
authorAlexandre Duret-Lutz <adl@gnu.org>2004-08-01 17:31:22 +0000
committerAlexandre Duret-Lutz <adl@gnu.org>2004-08-01 17:31:22 +0000
commit16e08014a193dd5fadf043bcbdfa9f7735115af6 (patch)
treedd5b289a401e0df505bf35f408326e087c1ce282 /lib/am/lex.am
parent96afbaa48766a2f37cee450f5e665cc368c80ea3 (diff)
downloadautomake-16e08014a193dd5fadf043bcbdfa9f7735115af6.tar.gz
Disable Lex and Yacc rules whenever possible if AM_MAINTAINER_MODE
is used and maintainer-mode disabled. * automake.in (Automake::struct): Define nodist_specific. Set it in languages yacc, yaccxx, lex, and lexxx. (register_language): Default nodist_specific to 0. (handle_single_transform): Honor nodist_specific. * lib/am/yacc.am (am__skipyacc): Define this in maintainer mode. (%EXT%%DERIVED-EXT%, %OBJ%): Use $(am__skipyacc) to disable these rules when needed. * lib/am/lex.am (am__skiplex): Define this in maintainer mode. (%EXT%%DERIVED-EXT%, %OBJ%): Use $(am__skiplex) to disable these rules when needed. * tests/mmodely.test: New file. * tests/pr204.test: Augment to check AM_MAINTAINER_MODE and nodist_ parsers. * tests/Makefile.am (TESTS): ADd mmodely.test. * doc/automake.texi (Yacc and Lex): Note dependence on maintainer mode.
Diffstat (limited to 'lib/am/lex.am')
-rw-r--r--lib/am/lex.am21
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/am/lex.am b/lib/am/lex.am
index 9ce16f9d0..645cbe6d1 100644
--- a/lib/am/lex.am
+++ b/lib/am/lex.am
@@ -1,5 +1,5 @@
## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+## Copyright (C) 2001, 2002, 2003, 2004 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
@@ -16,17 +16,28 @@
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
## 02111-1307, USA.
+## See the comment about am__skipyacc in yacc.am.
+if %?MAINTAINER-MODE%
+if %?FIRST%
+@MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ ||
+endif %?FIRST%
+endif %?MAINTAINER-MODE%
+
?GENERIC?%EXT%%DERIVED-EXT%:
?!GENERIC?%OBJ%: %SOURCE%
if %?MORE-THAN-ONE%
-?GENERIC? $(SHELL) $(YLWRAP) %SOURCE% $(LEX_OUTPUT_ROOT).c %OBJ% -- %COMPILE%
+?GENERIC? $(am__skiplex) $(SHELL) $(YLWRAP) %SOURCE% $(LEX_OUTPUT_ROOT).c %OBJ% -- %COMPILE%
+?!GENERIC??DIST_SOURCE? $(am__skiplex) \
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? $(SHELL) $(YLWRAP) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% $(LEX_OUTPUT_ROOT).c %OBJ% -- %COMPILE%
else !%?MORE-THAN-ONE%
-?GENERIC? %COMPILE% %SOURCE%
+?GENERIC? $(am__skiplex) %COMPILE% %SOURCE%
+?!GENERIC??DIST_SOURCE? $(am__skiplex) \
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? %COMPILE% `test -f %SOURCE% || echo '$(srcdir)/'`%SOURCE%
## Edit out `#line' or `#' directives.
- sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|%OBJ%|' $(LEX_OUTPUT_ROOT).c >%OBJ%
- rm -f $(LEX_OUTPUT_ROOT).c
+?GENERIC? $(am__skiplex) \
+?!GENERIC??DIST_SOURCE? $(am__skiplex)\
+ { sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|%OBJ%|' $(LEX_OUTPUT_ROOT).c >%OBJ% && \
+ rm -f $(LEX_OUTPUT_ROOT).c; }
endif !%?MORE-THAN-ONE%