man.mk 1.35 KB
Newer Older
Kurt Zeilenga's avatar
Kurt Zeilenga committed
1
# $OpenLDAP$
2
3
4
## 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
5
6
7
8
9
10
##---------------------------------------------------------------------------
##
## Makefile Template for Manual Pages
##

MANDIR=$(mandir)/man$(MANSECT)
11
TMP_SUFFIX=tmp
Kurt Zeilenga's avatar
Kurt Zeilenga committed
12

13
all-common:
14
15
	PAGES=`cd $(srcdir); echo *.$(MANSECT)`; \
	for page in $$PAGES; do \
16
		$(SED) -e "s%LDVERSION%$(VERSION)%" \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
17
			-e 's%ETCDIR%$(sysconfdir)%' \
18
			-e 's%LOCALSTATEDIR%$(localstatedir)%' \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
19
			-e 's%SYSCONFDIR%$(sysconfdir)%' \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
20
			-e 's%DATADIR%$(datadir)%' \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
21
22
23
24
			-e 's%SBINDIR%$(sbindir)%' \
			-e 's%BINDIR%$(bindir)%' \
			-e 's%LIBDIR%$(libdir)%' \
			-e 's%LIBEXECDIR%$(libexecdir)%' \
25
			$(srcdir)/$$page > $$page.$(TMP_SUFFIX); \
26
27
28
	done

install-common:
29
30
31
	-$(MKDIR) $(MANDIR)
	PAGES=`cd $(srcdir); echo *.$(MANSECT)`; \
	for page in $$PAGES; do \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
32
		echo "installing $(MANDIR)/$$page"; \
33
34
		$(RM) $(MANDIR)/$$page; \
		$(INSTALL) $(INSTALLFLAGS) -m 644 $$page.$(TMP_SUFFIX) $(MANDIR)/$$page; \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
35
		if test -f "$(srcdir)/$$page.links" ; then \
36
			for link in `$(CAT) $(srcdir)/$$page.links`; do \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
37
				echo "installing $(MANDIR)/$$link as link to $$page"; \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
38
				$(RM) $(MANDIR)/$$link ; \
39
				$(LN_S) $$page $(MANDIR)/$$link; \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
40
41
			done; \
		fi; \
42
	done
Kurt Zeilenga's avatar
Kurt Zeilenga committed
43

44
45
46
47
clean-common:   FORCE
	$(RM) *.tmp all-common

Makefile: $(top_srcdir)/build/man.mk