###########################################################################
# LPRng - An Extended Print Spooler System
#
# Copyright 1988-1997 Patrick Powell, San Diego, California
#     papowell@sdsu.edu
# See LICENSE for conditions of use.
#
###########################################################################
# MODULE: UTILS/Makefile
# PURPOSE: generate utilities
# Makefile.in,v 3.7 1998/03/30 01:54:50 papowell Exp
########################################################################## 

# Manual pages installation Makefile.
#
SRC = @srcdir@
VPATH=${SRC}
MANINSTCMD =	@INSTALL_MAN@

# change MANEXT to .gz or .Z if you use compressed manpages.
MANEXT =	

## fix up prefix to be a make variable
prefix = @prefix@
MAN =		$(prefix)/man
SHELL =		@SHELL@


all:

.PHONY: all clean install ci install.zman

CI=
CO=-kv
update:
	- for i in *.[0-9]; do \
		rcs -l ./$$i; \
		ci $(CI) -l -mUpdate -t-Initial ./$$i; \
	done;

	- VER=`cat ${SRC}/../VERSION`; \
	  for i in *.[0-9]; do \
		sed -e "s/^.ds VE.*/.ds VE $$VER/" ./$$i >/tmp/$$i; \
		cp /tmp/$$i ./$$i; \
	done;

	- for i in *.[0-9]; do \
		ci $(CI) -mUpdate -t-Initial ./$$i; \
		yes | co $(CO) ./$$i; \
	done

# Standard man install target.
#
install:
	-${SRC}/mkinstalldirs $(MAN)/man1 $(MAN)/man5 $(MAN)/man8
	cd ${SRC}; for i in *.1; do $(MANINSTCMD) $$i $(MAN)/man1/$$i$(MANEXT); done
	cd ${SRC}; for i in *.5; do $(MANINSTCMD) $$i $(MAN)/man5/$$i$(MANEXT); done
	cd ${SRC}; for i in *.8; do $(MANINSTCMD) $$i $(MAN)/man8/$$i$(MANEXT); done

# Install man pages in compressed form.
#
install.zman:
	for i in ${SRC}/*.1; do compress < $$i >/tmp/_; \
		 $(MANINSTCMD) /tmp/_ $(MAN)/man1.Z/$$i$(MANEXT); rm -f /tmp/_; done
	for i in ${SRC}/*.5; do compress < $$i >/tmp/_; \
		 $(MANINSTCMD) /tmp/_ $(MAN)/man5.Z/$$i$(MANEXT); rm -f /tmp/_; done
	for i in ${SRC}/*.8; do compress < $$i >/tmp/_; \
		 $(MANINSTCMD) /tmp/_ $(MAN)/man8.Z/$$i$(MANEXT); rm -f /tmp/_; done

uninstall:
	for i in *.1; do rm -f $(MAN)/man1/$$i$(MANEXT); done
	for i in *.5; do rm -f $(MAN)/man5/$$i$(MANEXT); done
	for i in *.8; do rm -f $(MAN)/man8/$$i$(MANEXT); done
	
realclean mostlyclean distclean:: clean
	rm -f Makefile

clean::

TAGS info:

cifast ci:
	if test ! -d RCS ; then mkdir RCS; fi;
	checkin() { \
		rcs -l $$1; \
		ci $(CI) -mUpdate -t-Initial $$1; \
		yes |co $(CO) $$1; \
	}; \
	for i in *.[0-9] Makefile.in Makefile; do \
		checkin $$i; \
	done;
