## -*-Makefile-*-
##
-## $Id: Makefile.am,v 1.33 2002/01/13 13:26:59 mdw Exp $
+## $Id: Makefile.am,v 1.34 2003/04/23 12:51:03 mdw Exp $
##
## Building the distribution
##
##----- Revision history ----------------------------------------------------
##
## $Log: Makefile.am,v $
+## Revision 1.34 2003/04/23 12:51:03 mdw
+## New manpage installer.
+##
## Revision 1.33 2002/01/13 13:26:59 mdw
## New hex encoding stuff. Rename test programs.
##
install-man:
(cd man && $(MAKE) install-man)
+uninstall-man:
+ (cd man && $(MAKE) uninstall-man)
CLEANFILES = $(TEST_CLEAN) crc32-tab.c
DISTCLEANFILES = libtool
dnl -*-fundamental-*-
dnl
-dnl $Id: configure.in,v 1.29 2001/06/22 19:34:07 mdw Exp $
+dnl $Id: configure.in,v 1.30 2003/04/23 12:50:30 mdw Exp $
dnl
dnl Configuration script for mLib
dnl
dnl ----- Revision history --------------------------------------------------
dnl
dnl $Log: configure.in,v $
+dnl Revision 1.30 2003/04/23 12:50:30 mdw
+dnl New manpage installer.
+dnl
dnl Revision 1.29 2001/06/22 19:34:07 mdw
dnl Find out whether @<float.h>@ exists (hack for uC-Linux).
dnl
AC_PROG_CC
AM_PROG_LIBTOOL
mdw_GCC_FLAGS
+mdw_MANEXT
AC_CHECK_HEADERS(float.h)
## -*-makefile-*-
##
-## $Id: Makefile.m4,v 1.2 1999/07/06 19:36:05 mdw Exp $
+## $Id: Makefile.am,v 1.1 2003/04/23 12:48:19 mdw Exp $
##
## Makefile for mLib's manual pages
##
##----- Revision history ----------------------------------------------------
##
-## $Log: Makefile.m4,v $
+## $Log: Makefile.am,v $
+## Revision 1.1 2003/04/23 12:48:19 mdw
+## New manpage installer.
+##
## Revision 1.2 1999/07/06 19:36:05 mdw
## Various minor bugfixes.
##
## Makefile for manual page installation. Subtle and complicated.
##
-AUTOMAKE_OPTIONS = foreign no-installman
-
-dnl --- Read in the various lists of things ---
+AUTOMAKE_OPTIONS = foreign
-define(`nl', `
-')
-define(`joinlines', `patsubst(patsubst(`$1', nl$, `'), nl, `$2')')
-define(`filenonl', `\nl $2`'joinlines(include(`$1'), ` \\'nl` $2')')
-define(`TOPLEVEL', filenonl(`toplevel'))
-define(`LINKS', filenonl(`links'))
-define(`SRC_TOPLEVEL', filenonl(`toplevel', `$(srcdir)/'))
-define(`SRC_LINKS', filenonl(`links', `$(srcdir)/'))
+manext = @manext@
## --- Manual pages ---
-man_MANS = TOPLEVEL LINKS
-
-EXTRA_DIST = Makefile.m4 $(man_MANS) mksofiles links toplevel stamp-so.in
-
-## --- Various maintenance rules ---
+MANPAGES = \
+ alloc.3 arena.3 assoc.3 atom.3 base64.3 bits.3 bres.3 conn.3 \
+ crc32.3 darray.3 dspool.3 dstr.3 env.3 exc.3 fdflags.3 fwatch.3 \
+ hash.3 ident.3 lbuf.3 lock.3 mLib.3 mdwopt.3 pkbuf.3 pool.3 \
+ quis.3 report.3 sel.3 selbuf.3 selpk.3 sig.3 str.3 sub.3 sym.3 \
+ testrig.3 trace.3 tv.3 url.3
-MAINTAINERCLEANFILES = SRC_LINKS $(srcdir)/Makefile.am $(srcdir)/stamp-so.in
+install-man: $(MANPAGES)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(mandir)
+ $(top_srcdir)/maninst \
+ -d $(DESTDIR)$(mandir) -s $(srcdir) \
+ -i "$(INSTALL)" -e $(manext) \
+ install $(MANPAGES)
-$(srcdir)/links $(srcdir)/toplevel: stamp-so.in
+uninstall-man: $(MANPAGS)
+ @$(NORMAL_UNINSTALL)
+ $(top_srcdir)/maninst \
+ -d $(DESTDIR)$(mandir) -s $(srcdir) -e $(manext) \
+ uninstall $(MANPAGES)
-$(srcdir)/stamp-so.in: TOPLEVEL
- cd $(srcdir); ./mksofiles *.[1-9]
- touch $(srcdir)/stamp-so.in
+install-data-local: install-man
+uninstall-local: uninstall-man
-$(srcdir)/Makefile.am: \
- $(srcdir)/Makefile.m4 $(srcdir)/links $(srcdir)/toplevel
- cd $(srcdir); m4 Makefile.m4 >Makefile.am
+EXTRA_DIST = Makefile.m4 $(MANPAGES) maninst
##----- That's all, folks ---------------------------------------------------
+++ /dev/null
-#! /bin/sh
-# -*-perl-*-
-
-exec perl -x $0 "$@";
-
-#! perl
-
-# --- The idea ---
-#
-# Each manual page contains lines of the form
-#
-# .\" @function
-#
-# for each function and macro documented in it. This program sifts through
-# all of the `toplevel' manual pages and creates little manpages which
-# include the main text for each of the functions.
-#
-# The file `links' contains a generated list of little link manpages. This
-# list is used for tidying (on a `make clean'), installing (for `make
-# install') and for pruning out old links when they're not needed any more.
-
-%top = ();
-%so = ();
-if (open SO, "links") { while (<SO>) { chomp; $so{$_} = -1; } }
-if (open TOP, "toplevel") { while (<TOP>) { chomp; $top{$_} = -1; } }
-
-foreach $f (@ARGV) {
- ($ext = $f) =~ s/^[^.]*\.//;
- next unless $ext =~ /^\d/;
- $sec = $&;
- open FILE, $f or die "open($f): $!";
- $top = 0;
- while (<FILE>) {
- chomp;
- next unless /^\.\\\"\s+\@/;
- $top = 1;
- $link = $';
- $full = "$link.$ext";
- next if $full eq $f;
- open OUT, ">$full" or die "open(>$full): $!";
- print OUT ".so man$sec/$f\n";
- close OUT;
- $so{$full}++;
- }
- $top{$f}++ if $top;
- close FILE;
-}
-
-$write = 0;
-foreach $i (keys(%so)) {
- next if $so{$i} == 0;
- unlink $i if $so{$i} < 0;
- $write = 1;
-}
-if ($write) {
- open LINKS, ">links" or die "open(>links): $!";
- foreach $i (sort(keys(%so))) {
- print LINKS "$i\n" if $so{$i} >= 0;
- }
- close LINKS;
-}
-
-$write = 0;
-foreach $i (keys(%top)) {
- $write = 1 unless $top{$i} == 0;
-}
-if ($write) {
- open TOP, ">toplevel" or die "open(>toplevel): $!";
- foreach $i (sort(keys(%top))) {
- print TOP "$i\n" if $top{$i} >= 0;
- }
- close TOP;
-}