1998-03-01 20:37:44 +00:00
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
#
|
2000-07-17 22:31:59 +00:00
|
|
|
# PostgreSQL documentation installation makefile
|
1998-03-01 20:37:44 +00:00
|
|
|
#
|
|
|
|
# Copyright (c) 1994, Regents of the University of California
|
|
|
|
#
|
2009-06-27 21:06:46 +00:00
|
|
|
# $PostgreSQL: pgsql/doc/Makefile,v 1.37 2009/06/27 21:06:46 tgl Exp $
|
1998-03-01 20:37:44 +00:00
|
|
|
#
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
|
2001-08-29 19:14:40 +00: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-17 22:31:59 +00:00
|
|
|
#
|
|
|
|
# To actually build the documenation, look into the src/ and src/sgml
|
|
|
|
# subdirectories.
|
1998-03-01 20:37:44 +00:00
|
|
|
|
2000-07-17 22:31:59 +00:00
|
|
|
subdir = doc
|
|
|
|
top_builddir = ..
|
|
|
|
include $(top_builddir)/src/Makefile.global
|
1998-03-01 20:37:44 +00:00
|
|
|
|
2001-08-29 19:14:40 +00:00
|
|
|
.NOTPARALLEL:
|
1998-03-01 20:37:44 +00:00
|
|
|
|
2000-12-26 20:47:07 +00:00
|
|
|
ifneq ($(wildcard $(srcdir)/postgres.tar.gz),)
|
2007-02-09 15:56:00 +00:00
|
|
|
found_html = yes
|
2000-12-26 20:47:07 +00:00
|
|
|
endif
|
1998-04-17 03:58:11 +00:00
|
|
|
|
2000-07-17 22:31:59 +00:00
|
|
|
ifneq ($(wildcard $(srcdir)/man.tar.gz),)
|
2001-08-29 19:14:40 +00:00
|
|
|
# SCO OpenServer's man system is sufficiently different to not bother.
|
|
|
|
ifneq ($(PORTNAME), sco)
|
2007-02-09 15:56:00 +00:00
|
|
|
found_man = yes
|
2000-07-17 22:31:59 +00:00
|
|
|
endif
|
2001-08-29 19:14:40 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
ifdef found_man
|
|
|
|
ifndef sqlmansect
|
|
|
|
sqlmansect = 7
|
|
|
|
endif
|
|
|
|
sqlmansectnum = $(shell expr X'$(sqlmansect)' : X'\([0-9]\)')
|
|
|
|
|
2009-06-19 19:15:13 +00:00
|
|
|
fix_sqlmansectnum = sed -e '/^\.TH/s/"7"/"$(sqlmansect)"/' \
|
|
|
|
-e 's/\\fR(7)/\\fR($(sqlmansectnum))/g' \
|
|
|
|
-e '1s/^\.so man7/.so man$(sqlmansectnum)/g;1s/^\(\.so.*\)\.7$$/\1.$(sqlmansect)/g'
|
|
|
|
|
2001-08-29 19:14:40 +00:00
|
|
|
all: man1/.timestamp man$(sqlmansectnum)/.timestamp
|
1998-03-01 20:37:44 +00:00
|
|
|
|
2008-11-14 10:22:48 +00:00
|
|
|
man1/.timestamp: man7/.timestamp
|
2002-02-06 20:29:35 +00:00
|
|
|
@echo timestamp >$@
|
|
|
|
|
2008-11-14 10:22:48 +00:00
|
|
|
man7/.timestamp: man.tar.gz
|
2009-06-27 21:06:46 +00:00
|
|
|
gzip -d -c $< | $(TAR) xf -
|
2008-11-14 10:22:48 +00:00
|
|
|
ifneq ($(sqlmansectnum),7)
|
2001-08-29 19:14:40 +00:00
|
|
|
for file in man1/*.1; do \
|
|
|
|
mv $$file $$file.bak && \
|
2009-06-19 19:15:13 +00:00
|
|
|
$(fix_sqlmansectnum) $$file.bak >$$file && \
|
2002-11-27 23:21:12 +00:00
|
|
|
rm -f $$file.bak || exit; \
|
2001-08-29 19:14:40 +00:00
|
|
|
done
|
2008-11-14 10:22:48 +00:00
|
|
|
endif
|
2002-02-06 20:29:35 +00:00
|
|
|
@echo timestamp >$@
|
1998-03-01 20:37:44 +00:00
|
|
|
|
2008-11-14 10:22:48 +00:00
|
|
|
ifneq ($(sqlmansectnum),7)
|
|
|
|
man$(sqlmansectnum)/.timestamp: man7/.timestamp
|
2001-08-29 19:14:40 +00:00
|
|
|
$(mkinstalldirs) man$(sqlmansectnum)
|
2008-11-14 10:22:48 +00:00
|
|
|
for file in man7/*.7; do \
|
2009-06-19 19:15:13 +00:00
|
|
|
$(fix_sqlmansectnum) $$file >man$(sqlmansectnum)/`basename $$file | sed 's/.7$$/.$(sqlmansect)/'` || exit; \
|
2001-08-29 19:14:40 +00:00
|
|
|
done
|
|
|
|
@echo timestamp >$@
|
2008-11-14 10:22:48 +00:00
|
|
|
endif
|
2001-08-29 19:14:40 +00:00
|
|
|
endif # found_man
|
1998-03-01 20:37:44 +00:00
|
|
|
|
|
|
|
|
2000-07-17 22:31:59 +00:00
|
|
|
install: all installdirs
|
2000-12-26 20:47:07 +00:00
|
|
|
ifdef found_html
|
2009-06-27 21:06:46 +00:00
|
|
|
gzip -d -c $(srcdir)/postgres.tar.gz | ( cd $(DESTDIR)$(htmldir)/html && $(TAR) xf - )
|
2000-07-17 22:31:59 +00:00
|
|
|
endif
|
|
|
|
ifdef found_man
|
2001-08-29 19:14:40 +00:00
|
|
|
for file in man1/*.1 man$(sqlmansectnum)/*.$(sqlmansect) ; do \
|
|
|
|
$(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/$$file || exit; \
|
|
|
|
done
|
2000-07-17 22:31:59 +00:00
|
|
|
endif
|
1998-03-01 20:37:44 +00:00
|
|
|
|
1998-10-06 05:44:05 +00:00
|
|
|
|
2000-07-17 22:31:59 +00:00
|
|
|
installdirs:
|
2001-08-29 19:14:40 +00:00
|
|
|
ifdef found_html
|
2008-02-17 16:36:43 +00:00
|
|
|
$(mkinstalldirs) '$(DESTDIR)$(htmldir)'/html
|
2001-08-29 19:14:40 +00:00
|
|
|
endif
|
|
|
|
ifdef found_man
|
2005-12-09 21:19:36 +00:00
|
|
|
$(mkinstalldirs) $(addprefix '$(DESTDIR)$(mandir)'/man, 1 $(sqlmansectnum))
|
2001-08-29 19:14:40 +00:00
|
|
|
endif
|
1998-03-01 20:37:44 +00:00
|
|
|
|
|
|
|
|
2000-07-17 22:31:59 +00:00
|
|
|
uninstall:
|
2000-12-26 20:47:07 +00:00
|
|
|
ifdef found_html
|
2009-06-26 06:37:14 +00:00
|
|
|
rm -f $(addprefix $(DESTDIR)$(htmldir)/html/, $(shell gunzip -c $(srcdir)/postgres.tar.gz | $(TAR) tf -))
|
2000-12-26 20:47:07 +00:00
|
|
|
endif
|
2000-07-17 22:31:59 +00:00
|
|
|
ifdef found_man
|
2009-06-26 06:37:14 +00:00
|
|
|
rm -f $(filter-out %/, $(addprefix $(DESTDIR)$(mandir)/, $(shell gunzip -c $(srcdir)/man.tar.gz | $(TAR) tf - | sed -e 's,man7/,man$(sqlmansectnum)/,' -e 's/.7$$/.$(sqlmansect)/')))
|
2000-07-17 22:31:59 +00:00
|
|
|
endif
|
2001-08-29 19:14:40 +00:00
|
|
|
|
|
|
|
|
2002-07-28 15:19:59 +00:00
|
|
|
clean distclean maintainer-clean:
|
2008-11-14 10:22:48 +00:00
|
|
|
rm -rf man1/ man7/ man$(sqlmansectnum)/
|
2002-07-28 15:19:59 +00:00
|
|
|
$(MAKE) -C src $@
|