man.mk 1.87 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/>.
##
Quanah Gibson-Mount's avatar
Quanah Gibson-Mount committed
4
## Copyright 1998-2021 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%MODULEDIR%$(moduledir)%' \
35
			-e 's%RELEASEDATE%$(RELEASEDATE)%' \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
36
				$(srcdir)/$$page \
37
			| (cd $(srcdir); $(SOELIM) -) > $$page.$(TMP_SUFFIX); \
38
39
40
	done

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

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

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