X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=build%2Fman.mk;h=6d25337bdb47148b939455c5729c228cbe70cad4;hb=49bf49de06a1aab8a2b7b5df2675672e6cd7282b;hp=2b616b4c2ddc6cdbc4702a1bb72773900326ff59;hpb=b048b22ed9558735c84eabd5e1bfd1c62c4aef39;p=openldap diff --git a/build/man.mk b/build/man.mk index 2b616b4c2d..6d25337bdb 100644 --- a/build/man.mk +++ b/build/man.mk @@ -1,43 +1,57 @@ -##--------------------------------------------------------------------------- +# $OpenLDAP$ +## This work is part of OpenLDAP Software . +## +## Copyright 1998-2005 The OpenLDAP Foundation. +## All rights reserved. ## -## Makefile Template for Manual Pages +## Redistribution and use in source and binary forms, with or without +## modification, are permitted only as authorized by the OpenLDAP +## Public License. ## +## A copy of this license is available in the file LICENSE in the +## top-level directory of the distribution or, alternatively, at +## . +##--------------------------------------------------------------------------- +# +# Makefile Template for Manual Pages +# MANDIR=$(mandir)/man$(MANSECT) +TMP_SUFFIX=tmp -install-common: all-common install-local - -$(MKDIR) -p $(MANDIR) - @TMPMAN=/tmp/ldapman.$$$$$(MANCOMPRESSSUFFIX); \ - VERSION=`$(CAT) $(VERSIONFILE)`; \ - for page in *.$(MANSECT); do \ - $(SED) -e "s%LDVERSION%$$VERSION%" \ +all-common: + PAGES=`cd $(srcdir); echo *.$(MANSECT)`; \ + for page in $$PAGES; do \ + $(SED) -e "s%LDVERSION%$(VERSION)%" \ -e 's%ETCDIR%$(sysconfdir)%' \ + -e 's%LOCALSTATEDIR%$(localstatedir)%' \ -e 's%SYSCONFDIR%$(sysconfdir)%' \ + -e 's%DATADIR%$(datadir)%' \ -e 's%SBINDIR%$(sbindir)%' \ -e 's%BINDIR%$(bindir)%' \ -e 's%LIBDIR%$(libdir)%' \ -e 's%LIBEXECDIR%$(libexecdir)%' \ - $$page | $(MANCOMPRESS) > $$TMPMAN; \ + -e 's%RELEASEDATE%$(RELEASEDATE)%' \ + $(srcdir)/$$page > $$page.$(TMP_SUFFIX); \ + done + +install-common: + -$(MKDIR) $(DESTDIR)$(MANDIR) + PAGES=`cd $(srcdir); echo *.$(MANSECT)`; \ + for page in $$PAGES; do \ 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 \ + $(RM) $(DESTDIR)$(MANDIR)/$$page; \ + $(INSTALL) $(INSTALLFLAGS) -m 644 $$page.$(TMP_SUFFIX) $(DESTDIR)$(MANDIR)/$$page; \ + if test -f "$(srcdir)/$$page.links" ; then \ + for link in `$(CAT) $(srcdir)/$$page.links`; do \ echo "installing $(MANDIR)/$$link as link to $$page"; \ - $(RM) $(INSTDIR)/$$link $(MANDIR)/$$link$(MANCOMPRESSSUFFIX); \ - ln -sf $$page$(MANCOMPRESSSUFFIX) $(MANDIR)/$$link$(MANCOMPRESSSUFFIX); \ + $(RM) $(DESTDIR)$(MANDIR)/$$link ; \ + $(LN_S) $$page $(DESTDIR)$(MANDIR)/$$link; \ done; \ fi; \ - done; \ - $(RM) $$TMPMAN + done -all-common: all-local -clean-common: clean-local -veryclean-common: veryclean-local clean-local -depend-common: depend-local -lint: lint-local -lint5: lint5-local +clean-common: FORCE + $(RM) *.tmp all-common -# these could be empty -lint-local: FORCE -lint5-local: FORCE +Makefile: $(top_srcdir)/build/man.mk