man.mk 1.31 KB
Newer Older
1
2
3
## Copyright 1998,1999 The OpenLDAP Foundation
## COPYING RESTRICTIONS APPLY.  See COPYRIGHT File in top level directory
## of this package for details.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
4
5
6
7
8
9
10
##---------------------------------------------------------------------------
##
## Makefile Template for Manual Pages
##

MANDIR=$(mandir)/man$(MANSECT)

11
install-common: FORCE
Kurt Zeilenga's avatar
Kurt Zeilenga committed
12
13
14
15
16
17
18
	-$(MKDIR) -p $(MANDIR)
	@TMPMAN=/tmp/ldapman.$$$$$(MANCOMPRESSSUFFIX); \
	VERSION=`$(CAT) $(VERSIONFILE)`; \
	for page in *.$(MANSECT); do \
		$(SED) -e "s%LDVERSION%$$VERSION%" \
			-e 's%ETCDIR%$(sysconfdir)%' \
			-e 's%SYSCONFDIR%$(sysconfdir)%' \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
19
			-e 's%DATADIR%$(datadir)%' \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
			-e 's%SBINDIR%$(sbindir)%' \
			-e 's%BINDIR%$(bindir)%' \
			-e 's%LIBDIR%$(libdir)%' \
			-e 's%LIBEXECDIR%$(libexecdir)%' \
			$$page | $(MANCOMPRESS) > $$TMPMAN; \
		echo "installing $(MANDIR)/$$page"; \
		$(RM) $(MANDIR)/$$page $(MANDIR)/$$page$(MANCOMPRESSSUFFIX); \
		$(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(MANDIR)/$$page$(MANCOMPRESSSUFFIX); \
		if [ -f "$$page.links" ]; then \
			for link in `$(CAT) $$page.links`; do \
				echo "installing $(MANDIR)/$$link as link to $$page"; \
				$(RM) $(INSTDIR)/$$link $(MANDIR)/$$link$(MANCOMPRESSSUFFIX); \
				ln -sf $$page$(MANCOMPRESSSUFFIX) $(MANDIR)/$$link$(MANCOMPRESSSUFFIX); \
			done; \
		fi; \
	done; \
	$(RM) $$TMPMAN

Makefile: $(top_srcdir)/build/lib.mk
39