From e75b9afa35e882e1e0ea99e45c72a615f9611333 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 9 Apr 2001 14:38:31 +0000 Subject: [PATCH] * automake.in (&handle_man_pages): Rely on mans.am to define man%SECTION%dir and MANS. * mans.am: Do it. --- ChangeLog | 6 ++++++ automake.in | 21 ++++++++------------- lib/am/mans-vars.am | 11 +++-------- lib/am/mans.am | 16 ++++++++++++++++ mans-vars.am | 11 +++-------- mans.am | 16 ++++++++++++++++ 6 files changed, 52 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index e554abac..1633c22f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-04-09 Akim Demaille + + * automake.in (&handle_man_pages): Rely on mans.am to define + man%SECTION%dir and MANS. + * mans.am: Do it. + 2001-04-09 Akim Demaille * automake.in (&variable_dump): Use %var_type properly. diff --git a/automake.in b/automake.in index 1d2752fa..5cbfc37b 100755 --- a/automake.in +++ b/automake.in @@ -2741,12 +2741,12 @@ sub handle_man_pages # sections used in man_MANS. my (%sections, %vlist); # Add more sections as needed. - foreach my $sect ('0'..'9', 'n', 'l') + foreach my $section ('0'..'9', 'n', 'l') { - if (&variable_defined ('man' . $sect . '_MANS')) + if (&variable_defined ('man' . $section . '_MANS')) { - $sections{$sect} = 1; - $vlist{'$(man' . $sect . '_MANS)'} = 1; + $sections{$section} = 1; + $vlist{'$(man' . $section . '_MANS)'} = 1; } } @@ -2767,18 +2767,13 @@ sub handle_man_pages # Now for each section, generate an install and unintall rule. # Sort sections so output is deterministic. - foreach my $sect (sort keys %sections) + foreach my $section (sort keys %sections) { - &define_variable ('man' . $sect . 'dir', '$(mandir)/man' . $sect); - $output_rules .= &file_contents ('mans', - ('SECTION', $sect)); + $output_rules .= &file_contents ('mans', ('SECTION', $section)); } - # We don't really need this, but we use it in case we ever want to - # support noinst_MANS. - &define_variable ("MANS", join (' ', sort keys %vlist)); - - $output_vars .= &file_contents ('mans-vars'); + $output_vars .= &file_contents ('mans-vars', + ('MANS' => join (' ', sort keys %vlist))); if (! defined $options{'no-installman'}) { diff --git a/lib/am/mans-vars.am b/lib/am/mans-vars.am index 490e663b..cbffd2a5 100644 --- a/lib/am/mans-vars.am +++ b/lib/am/mans-vars.am @@ -17,11 +17,6 @@ ## 02111-1307, USA. NROFF = nroff - -## FIXME: This is not elegant: there is more than simply variables, -## but we take advantage of the facts that these are factored dependencies, -## and therefore will be output here, in the variable section. - -.PHONY: install-man uninstall-man -?INSTALL-MAN?install-data-am: install-man -?INSTALL-MAN?uninstall-am: uninstall-man +## We don't really need this, but we use it in case we ever want to +## support noinst_MANS. +MANS = %MANS% diff --git a/lib/am/mans.am b/lib/am/mans.am index 970ee09a..2566953e 100644 --- a/lib/am/mans.am +++ b/lib/am/mans.am @@ -16,8 +16,17 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. +man%SECTION%dir = $(mandir)/man%SECTION% + +## ------------ ## +## Installing. ## +## ------------ ## + ## MANS primary are always installed in mandir, hence install-data ## is hard coded. + +.PHONY: install-man +?INSTALL-MAN?install-data-am: install-man ?INSTALL-MAN?_am_installdirs += $(DESTDIR)$(man%SECTION%dir) .PHONY install-man: install-man%SECTION% install-man%SECTION%: $(man%SECTION%_MANS) $(man_MANS) @@ -46,7 +55,14 @@ install-man%SECTION%: $(man%SECTION%_MANS) $(man_MANS) $(INSTALL_DATA) $$file $(DESTDIR)$(man%SECTION%dir)/$$inst; \ done + +## -------------- ## +## Uninstalling. ## +## -------------- ## + ## This is just completely gross. +.PHONY: uninstall-man +?INSTALL-MAN?uninstall-am: uninstall-man .PHONY uninstall-man: uninstall-man%SECTION% uninstall-man%SECTION%: @$(NORMAL_UNINSTALL) diff --git a/mans-vars.am b/mans-vars.am index 490e663b..cbffd2a5 100644 --- a/mans-vars.am +++ b/mans-vars.am @@ -17,11 +17,6 @@ ## 02111-1307, USA. NROFF = nroff - -## FIXME: This is not elegant: there is more than simply variables, -## but we take advantage of the facts that these are factored dependencies, -## and therefore will be output here, in the variable section. - -.PHONY: install-man uninstall-man -?INSTALL-MAN?install-data-am: install-man -?INSTALL-MAN?uninstall-am: uninstall-man +## We don't really need this, but we use it in case we ever want to +## support noinst_MANS. +MANS = %MANS% diff --git a/mans.am b/mans.am index 970ee09a..2566953e 100644 --- a/mans.am +++ b/mans.am @@ -16,8 +16,17 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. +man%SECTION%dir = $(mandir)/man%SECTION% + +## ------------ ## +## Installing. ## +## ------------ ## + ## MANS primary are always installed in mandir, hence install-data ## is hard coded. + +.PHONY: install-man +?INSTALL-MAN?install-data-am: install-man ?INSTALL-MAN?_am_installdirs += $(DESTDIR)$(man%SECTION%dir) .PHONY install-man: install-man%SECTION% install-man%SECTION%: $(man%SECTION%_MANS) $(man_MANS) @@ -46,7 +55,14 @@ install-man%SECTION%: $(man%SECTION%_MANS) $(man_MANS) $(INSTALL_DATA) $$file $(DESTDIR)$(man%SECTION%dir)/$$inst; \ done + +## -------------- ## +## Uninstalling. ## +## -------------- ## + ## This is just completely gross. +.PHONY: uninstall-man +?INSTALL-MAN?uninstall-am: uninstall-man .PHONY uninstall-man: uninstall-man%SECTION% uninstall-man%SECTION%: @$(NORMAL_UNINSTALL) -- 2.43.5