From 68d94dca0a3ca1623d68c9386610778f31932562 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 9 Apr 2001 10:31:03 +0000 Subject: [PATCH] * automake.in (&get_object_extension): Use ansi2knr.am. * clean-kr.am, kr-extra.am: Remove, merged into... * ansi2knr.am: this new file. --- ChangeLog | 6 ++++ Makefile.am | 6 ++-- Makefile.in | 6 ++-- kr-extra.am => ansi2knr.am | 38 +++++++++++++++++++++ automake.in | 32 ++++-------------- clean-kr.am | 23 ------------- lib/am/Makefile.am | 6 ++-- lib/am/ansi2knr.am | 67 ++++++++++++++++++++++++++++++++++++++ 8 files changed, 126 insertions(+), 58 deletions(-) rename kr-extra.am => ansi2knr.am (66%) delete mode 100644 clean-kr.am create mode 100644 lib/am/ansi2knr.am diff --git a/ChangeLog b/ChangeLog index 3b588677..9b14344f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-04-09 Akim Demaille + + * automake.in (&get_object_extension): Use ansi2knr.am. + * clean-kr.am, kr-extra.am: Remove, merged into... + * ansi2knr.am: this new file. + 2001-04-09 Akim Demaille * automake.in (&transform): Fix an incredible bug which was diff --git a/Makefile.am b/Makefile.am index 162e8e4d..33c4abfb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,10 +10,10 @@ SUBDIRS = . m4 tests bin_SCRIPTS = automake aclocal info_TEXINFOS = automake.texi -amfiles = check.am clean-hdr.am clean-kr.am clean.am compile.am \ +amfiles = ansi2knr.am check.am clean-hdr.am clean.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 \ +footer.am header-vars.am header.am install.am java.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 scripts.am subdirs.am tags.am texi-vers.am texibuild.am \ texinfos.am yacc.am diff --git a/Makefile.in b/Makefile.in index cf15ecd5..4a939b41 100644 --- a/Makefile.in +++ b/Makefile.in @@ -83,10 +83,10 @@ SUBDIRS = . m4 tests bin_SCRIPTS = automake aclocal info_TEXINFOS = automake.texi -amfiles = check.am clean-hdr.am clean-kr.am clean.am compile.am \ +amfiles = ansi2knr.am check.am clean-hdr.am clean.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 \ +footer.am header-vars.am header.am install.am java.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 scripts.am subdirs.am tags.am texi-vers.am texibuild.am \ texinfos.am yacc.am diff --git a/kr-extra.am b/ansi2knr.am similarity index 66% rename from kr-extra.am rename to ansi2knr.am index 40db02e7..3550e14f 100644 --- a/kr-extra.am +++ b/ansi2knr.am @@ -16,6 +16,31 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. + +## ---------- ## +## ansi2knr. ## +## ---------- ## + +if %!ANSI2KNR-DIR% + +ansi2knr: ansi2knr.$(OBJEXT) + $(LINK) ansi2knr.$(OBJEXT) $(LIBS) +ansi2knr.$(OBJEXT): $(CONFIG_HEADER) + +else %!ANSI2KNR-DIR% + +%ANSI2KNR-DIR%/ansi2knr: + cd %ANSI2KNR-DIR% && $(MAKE) $(AM_MAKEFLAGS) ansi2knr + +endif %!ANSI2KNR-DIR% + + +## ------------------- ## +## Cleaning ansi2knr. ## +## ------------------- ## + + +if %!ANSI2KNR-DIR% .PHONY: clean-krextra clean-am: clean-krextra @@ -27,3 +52,16 @@ clean-krextra: ## should remove it (and if the maintainer built it, then ## maintainer-clean should remove it). -rm -f ansi2knr +endif %!ANSI2KNR-DIR% + + + +## --------------------------------- ## +## Cleaning the output of ansi2knr. ## +## --------------------------------- ## + +.PHONY: mostlyclean-kr + +mostlyclean-am: mostlyclean-kr +mostlyclean-kr: + -rm -f *_.c diff --git a/automake.in b/automake.in index 12b502bc..82e7967a 100755 --- a/automake.in +++ b/automake.in @@ -1328,31 +1328,6 @@ sub get_object_extension { &require_file_with_line ('AUTOMAKE_OPTIONS', $FOREIGN, 'ansi2knr.c', 'ansi2knr.1'); - $output_rules .= &file_contents ('kr-extra'); - } - - # Generate rules to build ansi2knr. If it is in some - # other directory, then generate dependencies but have the - # rule just run elsewhere. - $output_rules .= ($options{'ansi2knr'} . ': ' - . $options{'ansi2knr'} . '.$(OBJEXT)' . "\n"); - if ($options{'ansi2knr'} eq 'ansi2knr') - { - $output_rules .= ("\t\$(LINK) ansi2knr.\$(OBJEXT)" - . " \$(LIBS)\n" - . 'ansi2knr.$(OBJEXT)' - . ": \$(CONFIG_HEADER)\n\n"); - } - else - { - $output_rules .= ("\tcd " . dirname ($options{'ansi2knr'}) - . ' && $(MAKE) $(AM_MAKEFLAGS) ' - . "ansi2knr\n\n"); - # This is required for non-GNU makes. - $output_rules .= ($options{'ansi2knr'} . '.$(OBJEXT)' . ":\n"); - $output_rules .= ("\tcd " . dirname ($options{'ansi2knr'}) - . ' && $(MAKE) $(AM_MAKEFLAGS)' - . ' ansi2knr.$(OBJEXT)' . "\n\n"); } # Make sure ansi2knr can be found: if no path specified, @@ -1371,7 +1346,12 @@ sub get_object_extension &define_variable ("ANSI2KNR", $options{'ansi2knr'}); } - $output_rules .= &file_contents ('clean-kr'); + my $ansi2knr_dir = ''; + $ansi2knr_dir = dirname ($options{'ansi2knr'}) + if $options{'ansi2knr'} ne 'ansi2knr'; + + $output_rules .= &file_contents ('ansi2knr', + ('ANSI2KNR-DIR' => $ansi2knr_dir)); $included_knr_compile = 1; } diff --git a/clean-kr.am b/clean-kr.am deleted file mode 100644 index 50c04ae5..00000000 --- a/clean-kr.am +++ /dev/null @@ -1,23 +0,0 @@ -## automake - create Makefile.in from Makefile.am -## Copyright 1994, 1995, 1996, 1997, 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. - -.PHONY: mostlyclean-kr - -mostlyclean-am: mostlyclean-kr -mostlyclean-kr: - -rm -f *_.c diff --git a/lib/am/Makefile.am b/lib/am/Makefile.am index 162e8e4d..33c4abfb 100644 --- a/lib/am/Makefile.am +++ b/lib/am/Makefile.am @@ -10,10 +10,10 @@ SUBDIRS = . m4 tests bin_SCRIPTS = automake aclocal info_TEXINFOS = automake.texi -amfiles = check.am clean-hdr.am clean-kr.am clean.am compile.am \ +amfiles = ansi2knr.am check.am clean-hdr.am clean.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 \ +footer.am header-vars.am header.am install.am java.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 scripts.am subdirs.am tags.am texi-vers.am texibuild.am \ texinfos.am yacc.am diff --git a/lib/am/ansi2knr.am b/lib/am/ansi2knr.am new file mode 100644 index 00000000..3550e14f --- /dev/null +++ b/lib/am/ansi2knr.am @@ -0,0 +1,67 @@ +## automake - create Makefile.in from Makefile.am +## Copyright 1994, 1995, 1996, 1997, 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. + + +## ---------- ## +## ansi2knr. ## +## ---------- ## + +if %!ANSI2KNR-DIR% + +ansi2knr: ansi2knr.$(OBJEXT) + $(LINK) ansi2knr.$(OBJEXT) $(LIBS) +ansi2knr.$(OBJEXT): $(CONFIG_HEADER) + +else %!ANSI2KNR-DIR% + +%ANSI2KNR-DIR%/ansi2knr: + cd %ANSI2KNR-DIR% && $(MAKE) $(AM_MAKEFLAGS) ansi2knr + +endif %!ANSI2KNR-DIR% + + +## ------------------- ## +## Cleaning ansi2knr. ## +## ------------------- ## + + +if %!ANSI2KNR-DIR% +.PHONY: clean-krextra + +clean-am: clean-krextra +clean-krextra: +## Why `clean' and not somewhere else? Not `mostlyclean' because +## people usually don't want to recompile this file. And not +## `distclean' because of our informal rule: if `make' built it, then +## `clean' should delete it; if `configure' built it, then `distclean' +## should remove it (and if the maintainer built it, then +## maintainer-clean should remove it). + -rm -f ansi2knr +endif %!ANSI2KNR-DIR% + + + +## --------------------------------- ## +## Cleaning the output of ansi2knr. ## +## --------------------------------- ## + +.PHONY: mostlyclean-kr + +mostlyclean-am: mostlyclean-kr +mostlyclean-kr: + -rm -f *_.c -- 2.43.5