1998-03-02 04:37:44 +08:00
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
#
|
2000-07-18 06:31:59 +08:00
|
|
|
# PostgreSQL documentation installation makefile
|
1998-03-02 04:37:44 +08:00
|
|
|
#
|
|
|
|
# Copyright (c) 1994, Regents of the University of California
|
|
|
|
#
|
2008-02-18 00:36:43 +08:00
|
|
|
# $PostgreSQL: pgsql/doc/Makefile,v 1.30 2008/02/17 16:36:42 petere Exp $
|
1998-03-02 04:37:44 +08:00
|
|
|
#
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
|
2001-08-30 03:14:40 +08:00
|
|
|
# This makefile is responsible for installing the documentation. The
|
|
|
|
# files to be installed are prepared specially and are placed in this
|
|
|
|
# directory during distribution bundling. In CVS-based trees these
|
|
|
|
# files don't exist, so we skip the installation in that case.
|
|
|
|
#
|
|
|
|
# Before we install the man pages, we massage the section numbers to
|
|
|
|
# follow the local conventions.
|
2000-07-18 06:31:59 +08:00
|
|
|
#
|
|
|
|
# To actually build the documenation, look into the src/ and src/sgml
|
|
|
|
# subdirectories.
|
1998-03-02 04:37:44 +08:00
|
|
|
|
2000-07-18 06:31:59 +08:00
|
|
|
subdir = doc
|
|
|
|
top_builddir = ..
|
|
|
|
include $(top_builddir)/src/Makefile.global
|
1998-03-02 04:37:44 +08:00
|
|
|
|
2001-08-30 03:14:40 +08:00
|
|
|
.NOTPARALLEL:
|
1998-03-02 04:37:44 +08:00
|
|
|
|
2000-12-27 04:47:07 +08:00
|
|
|
ifneq ($(wildcard $(srcdir)/postgres.tar.gz),)
|
2007-02-09 23:56:00 +08:00
|
|
|
found_html = yes
|
2000-12-27 04:47:07 +08:00
|
|
|
endif
|
1998-04-17 11:58:11 +08:00
|
|
|
|
2000-07-18 06:31:59 +08:00
|
|
|
ifneq ($(wildcard $(srcdir)/man.tar.gz),)
|
2001-08-30 03:14:40 +08:00
|
|
|
# SCO OpenServer's man system is sufficiently different to not bother.
|
|
|
|
ifneq ($(PORTNAME), sco)
|
2007-02-09 23:56:00 +08:00
|
|
|
found_man = yes
|
2000-07-18 06:31:59 +08:00
|
|
|
endif
|
2001-08-30 03:14:40 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
ifdef found_man
|
|
|
|
ifndef sqlmansect
|
|
|
|
sqlmansect = 7
|
|
|
|
endif
|
|
|
|
sqlmansectnum = $(shell expr X'$(sqlmansect)' : X'\([0-9]\)')
|
|
|
|
|
|
|
|
all: man1/.timestamp man$(sqlmansectnum)/.timestamp
|
1998-03-02 04:37:44 +08:00
|
|
|
|
2002-02-07 04:29:35 +08:00
|
|
|
man1/.timestamp: man$(sqlmansect_dummy)/.timestamp
|
|
|
|
@echo timestamp >$@
|
|
|
|
|
|
|
|
man$(sqlmansect_dummy)/.timestamp: man.tar.gz
|
2001-08-30 03:14:40 +08:00
|
|
|
gzip -d -c $< | $(TAR) xf -
|
|
|
|
for file in man1/*.1; do \
|
|
|
|
mv $$file $$file.bak && \
|
|
|
|
sed -e 's/\\fR($(sqlmansect_dummy))/\\fR($(sqlmansectnum))/' $$file.bak >$$file && \
|
2002-11-28 07:21:12 +08:00
|
|
|
rm -f $$file.bak || exit; \
|
2001-08-30 03:14:40 +08:00
|
|
|
done
|
2002-02-07 04:29:35 +08:00
|
|
|
@echo timestamp >$@
|
1998-03-02 04:37:44 +08:00
|
|
|
|
2001-08-30 03:14:40 +08:00
|
|
|
man$(sqlmansectnum)/.timestamp: man$(sqlmansect_dummy)/.timestamp
|
|
|
|
$(mkinstalldirs) man$(sqlmansectnum)
|
|
|
|
for file in man$(sqlmansect_dummy)/*.$(sqlmansect_dummy); do \
|
|
|
|
sed -e '/^\.TH/s/"$(sqlmansect_dummy)"/"$(sqlmansect)"/' \
|
|
|
|
-e 's/\\fR($(sqlmansect_dummy))/\\fR($(sqlmansectnum))/' \
|
|
|
|
$$file >man$(sqlmansectnum)/`basename $$file | sed 's/.$(sqlmansect_dummy)$$/.$(sqlmansect)/'` || exit; \
|
|
|
|
done
|
|
|
|
@echo timestamp >$@
|
|
|
|
endif # found_man
|
1998-03-02 04:37:44 +08:00
|
|
|
|
|
|
|
|
2000-07-18 06:31:59 +08:00
|
|
|
install: all installdirs
|
2000-12-27 04:47:07 +08:00
|
|
|
ifdef found_html
|
2008-02-18 00:36:43 +08:00
|
|
|
gzip -d -c $(srcdir)/postgres.tar.gz | ( cd $(DESTDIR)$(htmldir)/html && $(TAR) xf - )
|
2000-07-18 06:31:59 +08:00
|
|
|
endif
|
|
|
|
ifdef found_man
|
2001-08-30 03:14:40 +08:00
|
|
|
for file in man1/*.1 man$(sqlmansectnum)/*.$(sqlmansect) ; do \
|
|
|
|
$(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/$$file || exit; \
|
|
|
|
done
|
2000-07-18 06:31:59 +08:00
|
|
|
endif
|
1998-03-02 04:37:44 +08:00
|
|
|
|
1998-10-06 13:44:05 +08:00
|
|
|
|
2000-07-18 06:31:59 +08:00
|
|
|
installdirs:
|
2001-08-30 03:14:40 +08:00
|
|
|
ifdef found_html
|
2008-02-18 00:36:43 +08:00
|
|
|
$(mkinstalldirs) '$(DESTDIR)$(htmldir)'/html
|
2001-08-30 03:14:40 +08:00
|
|
|
endif
|
|
|
|
ifdef found_man
|
2005-12-10 05:19:36 +08:00
|
|
|
$(mkinstalldirs) $(addprefix '$(DESTDIR)$(mandir)'/man, 1 $(sqlmansectnum))
|
2001-08-30 03:14:40 +08:00
|
|
|
endif
|
1998-03-02 04:37:44 +08:00
|
|
|
|
|
|
|
|
2000-07-18 06:31:59 +08:00
|
|
|
uninstall:
|
2000-12-27 04:47:07 +08:00
|
|
|
ifdef found_html
|
2008-02-18 00:36:43 +08:00
|
|
|
-rm -f $(addprefix $(DESTDIR)$(htmldir)/html/, $(shell gunzip -c $(srcdir)/postgres.tar.gz | tar tf -))
|
2000-12-27 04:47:07 +08:00
|
|
|
endif
|
2000-07-18 06:31:59 +08:00
|
|
|
ifdef found_man
|
2001-08-30 03:14:40 +08:00
|
|
|
-rm -f $(addprefix $(DESTDIR)$(mandir)/, $(shell gunzip -c $(srcdir)/man.tar.gz | tar tf - | sed -e 's,man$(sqlmansect_dummy)/,man$(sqlmansectnum)/,' -e 's/.$(sqlmansect_dummy)$$/.$(sqlmansect)/'))
|
2000-07-18 06:31:59 +08:00
|
|
|
endif
|
2001-08-30 03:14:40 +08:00
|
|
|
|
|
|
|
|
2002-07-28 23:19:59 +08:00
|
|
|
clean distclean maintainer-clean:
|
2001-08-30 03:14:40 +08:00
|
|
|
rm -rf man1/ man$(sqlmansectnum)/ man$(sqlmansect_dummy)/
|
2002-07-28 23:19:59 +08:00
|
|
|
$(MAKE) -C src $@
|