From: Dan Miner (dminer@cs.umr.edu)
Date: 10/20/92


From: dminer@cs.umr.edu (Dan Miner)
Subject: Making formatted man pages (script)
Date: Wed, 21 Oct 1992 01:05:41 GMT


        Here is a Makefile for making formatted man pages. It is
just a quick hack. I hope some find use of it. (I hate to wait
for groff to format it for me each time.)

Send comments to dminer@cs.umr.edu

Dan,
Hackers' Guide Coordinator
======================= Makefile ==================================
# Written by: Dan Miner (dminer@cs.umr.edu)
# Makefile for generating formatted man pages.
#
# Usage:
# make
# makes any man page not formatted in the entire tree
# (sames 'all')
#
# BUGS:
# This can't tell if you replace a man page with a "new" man
# page that is still old that the formatted version.
############ User configurable section ######################

MAN =/usr/man
MANEXTS =1 2 3 4 5 6 7 8 9 n x
MAKE =make
GROFF =groff
GRARGS =-man -Tascii

############ Non-user configurable section ##################
CURRENT =$(MAN)/man$(MANEXT)
CATCUR =$(MAN)/cat$(MANEXT)
NOP =(exit 0)
SRC =$(CURRENT)
DEP =$(CATCUR)

##################### Mind play here, travel not alone.
all:
        @for dir in $(MANEXTS); do $(MAKE) MANEXT=$$dir others; done

others: Ext
        @if [ -d $(CURRENT) ]; then $(NOP); else mkdir $(CURRENT); fi
        @(cd $(CURRENT); ls ) | \
                (while read AN; \
                do \
                        MKARGS=`echo SRC=$(CURRENT)/$${AN} \
                                DEP=$(CATCUR)/$${AN} \
                                MANPAGE=$${AN} \
                                $(CATCUR)/$${AN}`; \
                                $(MAKE) $$MKARGS; \
                done; \
                exit 0)

Ext:
        @echo 'Formatting pages in man'$(MANEXT)

$(DEP): $(SRC)
        @if [ -d $(DEP) ]; then $(NOP); \
        else \
                echo ' Formatting page '$(MANPAGE); \
                $(GROFF) $(GRARGS) $(SRC) > $(DEP); \
        fi

-- 
 Dan Miner
                                         email: dminer@cs.umr.edu
Computer Science          
University of Missouri-Rolla             "It all begins with a glimmer."