Makefile 5.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
#----------------------------------------------------------------------------
#
# Makefile
#	Postgres documentation makefile
#	Thomas Lockhart
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
11
#    $Header: /cvsroot/pgsql/doc/src/sgml/Makefile,v 1.14 2000/05/02 20:01:51 thomas Exp $
12 13
#
#----------------------------------------------------------------------------
14

15 16 17
PGDOCS= ../..
SRCDIR= ../../../src

18
# This is where the default stylesheets appear on my linux system.
19 20 21
# Probably no need to change this; rather, put definitions
#  for HSTYLE and PSTYLE and/or for HDSL and PDSL
#  in Makefile.custom in your code src directory.
22 23
#HSTYLE=/usr/lib/sgml/stylesheets/nwalsh-modular/html
#PSTYLE=/usr/lib/sgml/stylesheets/nwalsh-modular/print
24
# This is where the production stylesheets appear on postgresql.org
25

26 27
HSTYLE= /home/users/t/thomas/db118.d/docbook/html
PSTYLE= /home/users/t/thomas/db118.d/docbook/print
28 29 30 31

HDSL=$(HSTYLE)/docbook.dsl
PDSL=$(PSTYLE)/docbook.dsl

32 33
# Options for DocBook style sheets

34
DBOPTS= -D ref -D ../graphics
35
#DBOPTS+= -V %no-split-output% -V %no-make-index%
36 37 38 39
# use-id-as-filename picks up the "Id=" fields to use as file names.
# If this is omitted then file names are generic "c01.htm"
#  as in v6.3 documentation. Yuck.
DBOPTS+= -V %use-id-as-filename%
40

41 42 43 44 45 46
# docbook2man generates man pages from docbook refentry source code.
# This is where the (patched) docbook2man perl scripts reside on hub.org.

D2MDIR= /home/users/t/thomas/d2x/docbook2man
D2MSCRIPT= $(D2MDIR)/docbook2man-spec.pl

47 48 49 50 51 52
TAR= tar

# Pick up Makefile.global from the source area
# This is the only resource from the code source area and is optional.
# Actually, we want this to get Makefile.custom - thomas 1998-03-01

53 54
ifneq ($(wildcard $(SRCDIR)/Makefile.global),)
  include $(SRCDIR)/Makefile.global
55 56 57 58 59 60 61 62 63 64 65
endif

# Hmm, made this optional but jade _really_ doesn't like them missing
# - thomas 1998-03-01
ifneq ($(HDSL), )
HTMLOPTS= -d $(HDSL)
endif
ifneq ($(PDSL), )
PRINTOPTS= -d $(PDSL)
endif

66 67
vpath %.sgml ./ref

68 69
MANSOURCES= $(wildcard ref/*.sgml)

70 71 72
APPLICATIONS= createdb.sgml createlang.sgml createuser.sgml \
	dropdb.sgml droplang.sgml dropuser.sgml \
	ecpg-ref.sgml \
73
	initdb.sgml initlocation.sgml \
74
	ipcclean.sgml \
75 76
	pg_dump.sgml \
	pg_dumpall.sgml \
77
	pg_passwd.sgml \
78 79 80
	pg_upgrade.sgml \
	pgaccess-ref.sgml \
	pgadmin-ref.sgml \
81
	pgctl-ref.sgml \
82 83
	pgtclsh.sgml \
	pgtksh.sgml \
84 85 86 87 88
	postgres-ref.sgml \
	postmaster.sgml \
	psql-ref.sgml \
	vacuumdb.sgml

89
COMMANDS= abort.sgml alter_group.sgml alter_table.sgml alter_user.sgml \
90
	begin.sgml \
91 92 93
	close.sgml cluster.sgml comment.sgml commit.sgml copy.sgml \
	create_aggregate.sgml create_constraint.sgml create_database.sgml \
	create_function.sgml create_group.sgml \
94
	create_index.sgml \
95 96 97 98
	create_language.sgml create_operator.sgml create_rule.sgml create_sequence.sgml \
	create_table.sgml create_table_as.sgml create_trigger.sgml create_type.sgml \
	create_user.sgml create_view.sgml \
	declare.sgml delete.sgml \
99 100
	drop_aggregate.sgml drop_database.sgml drop_function.sgml drop_group.sgml \
	drop_index.sgml \
101 102
	drop_language.sgml drop_operator.sgml drop_rule.sgml drop_sequence.sgml \
	drop_table.sgml drop_trigger.sgml drop_type.sgml drop_user.sgml drop_view.sgml \
103
	end.sgml explain.sgml fetch.sgml grant.sgml \
104 105
	insert.sgml listen.sgml load.sgml lock.sgml move.sgml \
	notify.sgml \
106
	reindex.sgml reset.sgml revoke.sgml rollback.sgml \
107
	select.sgml select_into.sgml set.sgml show.sgml \
108
	truncate.sgml unlisten.sgml update.sgml vacuum.sgml
109 110 111

FUNCTIONS= current_date.sgml current_time.sgml current_timestamp.sgml current_user.sgml

112 113 114 115 116 117 118 119
#APPSOURCES= $(addprefix ref/, $(APPLICATIONS))
#SQLSOURCES= $(addprefix ref/, $(COMMANDS))
APPSOURCES= $(APPLICATIONS)
SQLSOURCES= $(COMMANDS)
XAPPTARGETS= $(APPLICATIONS:.sgml=.1)
APPTARGETS= $(XAPPTARGETS:-ref.1=.1)
XSQLTARGETS= $(COMMANDS:.sgml=.l)
SQLTARGETS= $(XSQLTARGETS:-ref.l=.l)
120

121 122 123 124 125 126 127
.PRECIOUS: postgres.tex postgres.dvi
.PHONY: install all clean distclean

install::

all::

128 129 130 131 132 133 134
man:
	$(MAKE) man1 manl
	($(RM) -r *.1 *.l man1 manl)
	$(MAKE) man1 manl

manpage.refs:
	$(MAKE) man
135

136
man1: $(APPTARGETS) manpage.refs
137 138
	$(RM) -rf man1
	if [ ! -d man1 ]; then mkdir man1; fi
139
	cp *.1 man1/
140

141
manl: $(SQLTARGETS) manpage.refs
142 143
	$(RM) -rf manl/*
	if [ ! -d manl ]; then mkdir manl; fi
144
	cp *.l manl/
145

146
clean::
147
	(rm -rf HTML.manifest *.html *.htm *.1 *.l man1 manl manpage*)
148 149 150 151 152 153 154 155

distclean::
	$(MAKE) clean

#
# Generic production rules
#

156
%.1: %-ref.sgml
157 158
	nsgmls $(NSGMLS_FLAGS) refentry.sgml $< \
	| sgmlspl $(D2MSCRIPT) --lowercase --blockformat --section 1
159 160

%.1: %.sgml
161 162
	nsgmls $(NSGMLS_FLAGS) refentry.sgml $< \
	| sgmlspl $(D2MSCRIPT) --lowercase --blockformat --section 1
163

164
%.l: %.sgml
165 166
	nsgmls $(NSGMLS_FLAGS) refentry.sgml $< \
	| sgmlspl $(D2MSCRIPT) --lowercase --blockformat --section l
167 168 169 170 171 172

# HTML
# Include some softlinks to the generic default file names

%.html:	%.sgml #$(HDSL)
	(rm -rf *.htm)
173
	jade $(DBOPTS) $(HTMLOPTS) -t sgml $<
174 175
	(ln -sf $*.htm index.html)
	(ln -sf $*.htm $*.html)
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199

# RTF to allow minor editing for hardcopy
# This is used for v6.3 docs

%.rtf: %.sgml #$(PDSL)
	jade $(DBOPTS) $(PRINTOPTS) -t rtf $<

# TeX and DVI

%.tex: %.sgml #$(PDSL)
	jade $(DBOPTS) $(PRINTOPTS) -t tex $<

%.dvi: %.tex
	jadetex $<
	jadetex $<

# Postscript from TeX

%.ps: %.dvi
	dvips -o $@ $<

# Graphics

%.gif:
200
	cp -p ../graphics/$@ .
201