]> git.sur5r.net Git - openldap/blob - build/man.mk
Sync with HEAD (fix global schemadn)
[openldap] / build / man.mk
1 # $OpenLDAP$
2 ## Copyright 1998-2002 The OpenLDAP Foundation
3 ## COPYING RESTRICTIONS APPLY.  See COPYRIGHT File in top level directory
4 ## of this package for details.
5 ##---------------------------------------------------------------------------
6 ##
7 ## Makefile Template for Manual Pages
8 ##
9
10 MANDIR=$(mandir)/man$(MANSECT)
11 TMP_SUFFIX=tmp
12
13 all-common:
14         PAGES=`cd $(srcdir); echo *.$(MANSECT)`; \
15         for page in $$PAGES; do \
16                 $(SED) -e "s%LDVERSION%$(VERSION)%" \
17                         -e 's%ETCDIR%$(sysconfdir)%' \
18                         -e 's%LOCALSTATEDIR%$(localstatedir)%' \
19                         -e 's%SYSCONFDIR%$(sysconfdir)%' \
20                         -e 's%DATADIR%$(datadir)%' \
21                         -e 's%SBINDIR%$(sbindir)%' \
22                         -e 's%BINDIR%$(bindir)%' \
23                         -e 's%LIBDIR%$(libdir)%' \
24                         -e 's%LIBEXECDIR%$(libexecdir)%' \
25                         -e 's%RELEASEDATE%$(RELEASEDATE)%' \
26                         $(srcdir)/$$page > $$page.$(TMP_SUFFIX); \
27         done
28
29 install-common:
30         -$(MKDIR) $(DESTDIR)$(MANDIR)
31         PAGES=`cd $(srcdir); echo *.$(MANSECT)`; \
32         for page in $$PAGES; do \
33                 echo "installing $(MANDIR)/$$page"; \
34                 $(RM) $(DESTDIR)$(MANDIR)/$$page; \
35                 $(INSTALL) $(INSTALLFLAGS) -m 644 $$page.$(TMP_SUFFIX) $(DESTDIR)$(MANDIR)/$$page; \
36                 if test -f "$(srcdir)/$$page.links" ; then \
37                         for link in `$(CAT) $(srcdir)/$$page.links`; do \
38                                 echo "installing $(MANDIR)/$$link as link to $$page"; \
39                                 $(RM) $(DESTDIR)$(MANDIR)/$$link ; \
40                                 $(LN_S) $$page $(DESTDIR)$(MANDIR)/$$link; \
41                         done; \
42                 fi; \
43         done
44
45 clean-common:   FORCE
46         $(RM) *.tmp all-common
47
48 Makefile: $(top_srcdir)/build/man.mk