From 7d0c58935c1435af2e820653d93d41ce73d4e164 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 9 Apr 2001 10:00:49 +0000 Subject: [PATCH] * automake.in (&output_lex_build_rule): Output this... * lex.am: New file. --- ChangeLog | 5 +++++ Makefile.am | 8 ++++---- Makefile.in | 8 ++++---- automake.in | 27 +++++++-------------------- lex.am | 28 ++++++++++++++++++++++++++++ lib/am/Makefile.am | 8 ++++---- lib/am/lex.am | 28 ++++++++++++++++++++++++++++ 7 files changed, 80 insertions(+), 32 deletions(-) create mode 100644 lex.am create mode 100644 lib/am/lex.am diff --git a/ChangeLog b/ChangeLog index c4eb82e5..765523a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-04-09 Akim Demaille + + * automake.in (&output_lex_build_rule): Output this... + * lex.am: New file. + 2001-04-09 Akim Demaille * automake.in (&condition_negate): New. diff --git a/Makefile.am b/Makefile.am index ba257991..6a244e76 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,11 +11,11 @@ bin_SCRIPTS = automake aclocal info_TEXINFOS = automake.texi amfiles = check.am clean-hdr.am clean-kr.am clean.am comp-vars.am \ -compile.am configure.am data.am dejagnu.am depend.am depend2.am \ -distdir.am footer.am header-vars.am header.am install.am java.am \ -kr-extra.am library.am libs.am libtool.am lisp.am ltlib.am \ +compile.am configure.am data.am dejagnu.am depend.am depend2.am \ +distdir.am footer.am header-vars.am header.am install.am java.am \ +kr-extra.am lex.am library.am libs.am libtool.am lisp.am ltlib.am \ ltlibrary.am mans-vars.am mans.am multilib.am program.am progs.am \ -python.am remake-hdr.am remake.am scripts.am subdirs.am tags.am \ +python.am remake-hdr.am remake.am scripts.am subdirs.am tags.am \ texi-vers.am texibuild.am texinfos.am yacc.am dist_pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \ diff --git a/Makefile.in b/Makefile.in index 5352795f..c92d216c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -84,11 +84,11 @@ bin_SCRIPTS = automake aclocal info_TEXINFOS = automake.texi amfiles = check.am clean-hdr.am clean-kr.am clean.am comp-vars.am \ -compile.am configure.am data.am dejagnu.am depend.am depend2.am \ -distdir.am footer.am header-vars.am header.am install.am java.am \ -kr-extra.am library.am libs.am libtool.am lisp.am ltlib.am \ +compile.am configure.am data.am dejagnu.am depend.am depend2.am \ +distdir.am footer.am header-vars.am header.am install.am java.am \ +kr-extra.am lex.am library.am libs.am libtool.am lisp.am ltlib.am \ ltlibrary.am mans-vars.am mans.am multilib.am program.am progs.am \ -python.am remake-hdr.am remake.am scripts.am subdirs.am tags.am \ +python.am remake-hdr.am remake.am scripts.am subdirs.am tags.am \ texi-vers.am texibuild.am texinfos.am yacc.am diff --git a/automake.in b/automake.in index ec6a0726..0454bdeb 100755 --- a/automake.in +++ b/automake.in @@ -1499,9 +1499,9 @@ sub output_yacc_build_rule # Generate rule for c/c++. $output_rules .= &file_contents ('yacc', - ('YACC_SUFFIX' => $yacc_suffix, - 'C_SUFFIX' => $c_suffix, - 'YLWRAP' => $use_ylwrap)); + ('YLWRAP' => $use_ylwrap, + 'YACC_SUFFIX' => $yacc_suffix, + 'C_SUFFIX' => $c_suffix)); } sub output_lex_build_rule @@ -1510,23 +1510,10 @@ sub output_lex_build_rule (my $c_suffix = $lex_suffix) =~ tr/l/c/; - push (@suffixes, $lex_suffix); - &define_configure_variable ('LEX_OUTPUT_ROOT'); - &define_configure_variable ('LEXLIB'); - $output_rules .= "$lex_suffix$c_suffix:\n\t"; - - if ($use_ylwrap) - { - # Is the $@ correct here? If so, why not use it in the ylwrap - # build rule for yacc above? - $output_rules .= '$(SHELL) $(YLWRAP)' - . ' "$(LEX)" $< $(LEX_OUTPUT_ROOT).c $@ -- $(AM_LFLAGS) $(LFLAGS)'; - } - else - { - $output_rules .= '$(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@'; - } - $output_rules .= "\n"; + $output_rules .= &file_contents ('lex', + ('YLWRAP' => $use_ylwrap, + 'LEX_SUFFIX' => $lex_suffix, + 'C_SUFFIX' => $c_suffix)); } diff --git a/lex.am b/lex.am new file mode 100644 index 00000000..006e0bed --- /dev/null +++ b/lex.am @@ -0,0 +1,28 @@ +## automake - create Makefile.in from Makefile.am +## Copyright 2001 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 +## the Free Software Foundation; either version 2, or (at your option) +## any later version. + +## This program 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 this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. + +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LEXLIB = @LEXLIB@ + +## Generate rule for c/c++. +%LEX_SUFFIX%%C_SUFFIX%: +if %?YLWRAP% + $(SHELL) $(YLWRAP) $(LEX) $< $(LEX_OUTPUT_ROOT).c $@ -- $(AM_LFLAGS) $(LFLAGS) +else + $(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@ +endif %?YLWRAP% diff --git a/lib/am/Makefile.am b/lib/am/Makefile.am index ba257991..6a244e76 100644 --- a/lib/am/Makefile.am +++ b/lib/am/Makefile.am @@ -11,11 +11,11 @@ bin_SCRIPTS = automake aclocal info_TEXINFOS = automake.texi amfiles = check.am clean-hdr.am clean-kr.am clean.am comp-vars.am \ -compile.am configure.am data.am dejagnu.am depend.am depend2.am \ -distdir.am footer.am header-vars.am header.am install.am java.am \ -kr-extra.am library.am libs.am libtool.am lisp.am ltlib.am \ +compile.am configure.am data.am dejagnu.am depend.am depend2.am \ +distdir.am footer.am header-vars.am header.am install.am java.am \ +kr-extra.am lex.am library.am libs.am libtool.am lisp.am ltlib.am \ ltlibrary.am mans-vars.am mans.am multilib.am program.am progs.am \ -python.am remake-hdr.am remake.am scripts.am subdirs.am tags.am \ +python.am remake-hdr.am remake.am scripts.am subdirs.am tags.am \ texi-vers.am texibuild.am texinfos.am yacc.am dist_pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \ diff --git a/lib/am/lex.am b/lib/am/lex.am new file mode 100644 index 00000000..006e0bed --- /dev/null +++ b/lib/am/lex.am @@ -0,0 +1,28 @@ +## automake - create Makefile.in from Makefile.am +## Copyright 2001 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 +## the Free Software Foundation; either version 2, or (at your option) +## any later version. + +## This program 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 this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +## 02111-1307, USA. + +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LEXLIB = @LEXLIB@ + +## Generate rule for c/c++. +%LEX_SUFFIX%%C_SUFFIX%: +if %?YLWRAP% + $(SHELL) $(YLWRAP) $(LEX) $< $(LEX_OUTPUT_ROOT).c $@ -- $(AM_LFLAGS) $(LFLAGS) +else + $(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@ +endif %?YLWRAP% -- 2.43.5