#-----------------------------------------------------------------------------
# Copyright (c) 1994 Regents of the University of Michigan.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that this notice is preserved and that due credit is given
# to the University of Michigan at Ann Arbor. The name of the University
# may not be used to endorse or promote products derived from this
# software without specific prior written permission. This software
# is provided ``as is'' without express or implied warranty.
#
#       LDAP man8 makefile
#
#-----------------------------------------------------------------------------

LDAPSRC= ../../..
SECT=8
INSTDIR=$(MANDIR)/man$(SECT)
VERSIONFILE = $(LDAPSRC)/build/version

all:	FORCE

install:	FORCE
	-$(MKDIR) -p $(INSTDIR)
	@TMPMAN=/tmp/ldapman.$$$$; \
	VERSION=`$(CAT) $(VERSIONFILE)`; \
	for page in *.$(SECT); do \
	    $(SED) -e 's%ETCDIR%$(RUNTIMEETCDIR)%' -e "s%LDVERSION%$$VERSION%" \
		    $$page > $$TMPMAN; \
	    echo "installing $(INSTDIR)/$$page"; \
	    $(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(INSTDIR)/$$page; \
	    if [ -f "$$page.links" ]; then \
		for link in `$(CAT) $$page.links`; do \
		    echo ".so man$(SECT)/$$page" > $$TMPMAN; \
		    echo "installing $(INSTDIR)/$$link as link to $$page"; \
		    $(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN \
			    $(INSTDIR)/$$link; \
		done; \
	    fi; \
	done; \
	$(RM) $$TMPMAN

clean:	FORCE

depend:	FORCE

lint:	FORCE

5lint:	FORCE

links:
	@$(LN) .src/*.$(SECT) .src/*links .
