man.mk 1.84 KB
Newer Older
Kurt Zeilenga's avatar
Kurt Zeilenga committed
1
# $OpenLDAP$
Kurt Zeilenga's avatar
Kurt Zeilenga committed
2
3
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
Kurt Zeilenga's avatar
Kurt Zeilenga committed
4
## Copyright 1998-2007 The OpenLDAP Foundation.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
5
## All rights reserved.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
6
##
Kurt Zeilenga's avatar
Kurt Zeilenga committed
7
8
9
## Redistribution and use in source and binary forms, with or without
## modification, are permitted only as authorized by the OpenLDAP
## Public License.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
10
##
Kurt Zeilenga's avatar
Kurt Zeilenga committed
11
12
13
14
15
16
17
## A copy of this license is available in the file LICENSE in the
## top-level directory of the distribution or, alternatively, at
## <http://www.OpenLDAP.org/license.html>.
##---------------------------------------------------------------------------
#
# Makefile Template for Manual Pages
#
Kurt Zeilenga's avatar
Kurt Zeilenga committed
18
19

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

22
all-common:
23
24
	PAGES=`cd $(srcdir); echo *.$(MANSECT)`; \
	for page in $$PAGES; do \
25
		$(SED) -e "s%LDVERSION%$(VERSION)%" \
26
			-e 's%ETCDIR%$(sysconfdir)%g' \
27
			-e 's%LOCALSTATEDIR%$(localstatedir)%' \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
28
			-e 's%SYSCONFDIR%$(sysconfdir)%' \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
29
			-e 's%DATADIR%$(datadir)%' \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
30
31
32
33
			-e 's%SBINDIR%$(sbindir)%' \
			-e 's%BINDIR%$(bindir)%' \
			-e 's%LIBDIR%$(libdir)%' \
			-e 's%LIBEXECDIR%$(libexecdir)%' \
34
			-e 's%RELEASEDATE%$(RELEASEDATE)%' \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
35
				$(srcdir)/$$page \
36
			| (cd $(srcdir); $(SOELIM) -) > $$page.$(TMP_SUFFIX); \
37
38
39
	done

install-common:
40
	-$(MKDIR) $(DESTDIR)$(MANDIR)
41
42
	PAGES=`cd $(srcdir); echo *.$(MANSECT)`; \
	for page in $$PAGES; do \
43
		echo "installing $$page in $(DESTDIR)$(MANDIR)"; \
44
45
		$(RM) $(DESTDIR)$(MANDIR)/$$page; \
		$(INSTALL) $(INSTALLFLAGS) -m 644 $$page.$(TMP_SUFFIX) $(DESTDIR)$(MANDIR)/$$page; \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
46
		if test -f "$(srcdir)/$$page.links" ; then \
47
			for link in `$(CAT) $(srcdir)/$$page.links`; do \
48
				echo "installing $$link in $(DESTDIR)$(MANDIR) as link to $$page"; \
49
				$(RM) $(DESTDIR)$(MANDIR)/$$link ; \
50
				$(LN_S) $(DESTDIR)$(MANDIR)/$$page $(DESTDIR)$(MANDIR)/$$link; \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
51
52
			done; \
		fi; \
53
	done
Kurt Zeilenga's avatar
Kurt Zeilenga committed
54

55
56
57
58
clean-common:   FORCE
	$(RM) *.tmp all-common

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