Makefile 4.08 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.30 2001/02/04 12:23:11 petere Exp $
12 13
#
#----------------------------------------------------------------------------
14

15 16
subdir = doc/src/sgml
top_builddir = ../../..
17
include $(top_builddir)/src/Makefile.global
18

19
.SECONDARY:
20
.NOTPARALLEL:
21

22 23 24 25
ifndef DOCBOOKSTYLE
DOCBOOKSTYLE = /home/projects/pgsql/developers/thomas/db143.d/docbook
endif

26
ifndef HSTYLE
27
HSTYLE = $(DOCBOOKSTYLE)/html
28 29
endif
ifndef PSTYLE
30
PSTYLE = $(DOCBOOKSTYLE)/print
31
endif
32 33 34 35

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

36 37 38 39 40 41 42 43 44 45 46 47
ifndef JADE
JADE = jade
endif
SGMLINCLUDE = -D ref -D ../graphics

ifndef NSGMLS
NSGMLS = nsgmls
endif

ifndef SGMLSPL
SGMLSPL = sgmlspl
endif
48

49

50 51
# docbook2man generates man pages from docbook refentry source code.

52 53
ifndef D2MDIR
# This is where the (patched) docbook2man perl scripts reside on hub.org.
54
D2MDIR= /home/users/t/thomas/d2x/docbook2man
55
endif
56 57
D2MSCRIPT= $(D2MDIR)/docbook2man-spec.pl

58
vpath %.sgml ./ref
59

60
ALLBOOKS = admin developer programmer reference tutorial user
61

62
ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml)
63

64

65 66 67
##
## Man pages
##
68

69
.PHONY: man
70

71
DEFAULTSECTION := l
72

73 74 75 76 77 78 79 80 81
man: $(ALLSGML)
	$(NSGMLS) $(NSGMLS_FLAGS) $(srcdir)/book-decl.sgml $(srcdir)/reference.sgml \
	  | $(SGMLSPL) $(D2MSCRIPT) --lowercase --section $(DEFAULTSECTION)
# One more time, to resolve cross-references
	$(NSGMLS) $(NSGMLS_FLAGS) $(srcdir)/book-decl.sgml $(srcdir)/reference.sgml \
	  | $(SGMLSPL) $(D2MSCRIPT) --lowercase --section $(DEFAULTSECTION)
	$(mkinstalldirs) man1 man$(DEFAULTSECTION)
	mv *.1 man1/
	mv *.$(DEFAULTSECTION) man$(DEFAULTSECTION)/
82

83 84 85 86 87

##
## HTML
##

88
JADE.html = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -d $(HDSL) -V %use-id-as-filename% -V %generate-legalnotice-link% -t sgml
89 90

postgres.html: postgres.sgml $(ALLSGML)
91
	@rm -f *.htm
92
	$(JADE.html) $<
93
# Include some softlinks to the generic default file names
94 95 96 97 98 99
	ln -sf postgres.htm index.html
	ln -sf postgres.htm postgres.html

$(addsuffix .html, $(ALLBOOKS)): %.html: %.sgml $(ALLSGML)
	@rm -f *.htm
	$(JADE.html) book-decl.sgml $<
100 101
	ln -sf $*.htm index.html
	ln -sf $*.htm $*.html
102 103


104 105 106
##
## Print
##
107

108
# RTF to allow minor editing for hardcopy
109
$(addsuffix .rtf, $(ALLBOOKS)): %.rtf: %.sgml $(ALLSGML)
110
	$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -d $(PDSL) -t rtf -V rtf-backend book-decl.sgml $<
111 112

# TeX and DVI
113
$(addsuffix .tex, $(ALLBOOKS)): %.tex: %.sgml $(ALLSGML)
114
	$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -d $(PDSL) -t tex -V tex-backend book-decl.sgml $<
115 116 117 118

%.dvi: %.tex
	jadetex $<
	jadetex $<
119
	jadetex $<
120 121 122 123 124

# Postscript from TeX
%.ps: %.dvi
	dvips -o $@ $<

125 126 127 128 129 130
%.pdf: %.tex
	pdfjadetex $<
	pdfjadetex $<
	pdfjadetex $<


131 132 133
# Graphics

%.gif:
134
	cp -p ../graphics/$@ .
135

136

137 138 139
##
## Semi-automatic generation of some text files.
##
140 141

INSTALL HISTORY: % : %.html
142 143
	@echo "|";\
	 echo "| You should now take \`$<', save it as a text file in Netscape,";\
144
	 echo "| and put it in place of the existing \`$@' file.";\
145 146 147
	 echo "|"


148 149 150 151
INSTALL.html HISTORY.html: %.html : tempfile_%.html
	sed 's/Chapter 1. *//g' $< >$@

tempfile_INSTALL.html tempfile_HISTORY.html: tempfile_%.html : tempfile_%.sgml
152
	$(JADE) $(JADEFLAGS) -d $(HDSL) -V nochunks -t sgml $< >$@
153 154 155 156 157 158 159 160 161


tempfile_INSTALL.sgml: standalone-install.sgml installation.sgml
	cat $+ >$@

tempfile_HISTORY.sgml: release.sgml
	( echo '<!doctype chapter PUBLIC "-//OASIS//DTD DocBook V3.1//EN">'; \
	  cat $< ) >$@

162

163
.INTERMEDIATE: tempfile_INSTALL.html tempfile_HISTORY.html tempfile_INSTALL.sgml tempfile_HISTORY.sgml
164 165 166 167 168 169


##
## Check
##

170
check: $(addprefix check-, $(ALLBOOKS)) check-postgres
171 172

# Quick syntax check without style processing
173 174 175 176
$(addprefix check-, $(ALLBOOKS)): check-%: %.sgml
	$(NSGMLS) $(SGMLINCLUDE) -s book-decl.sgml $<

check-postgres: postgres.sgml
177 178 179 180 181 182 183 184 185 186 187 188 189 190
	$(NSGMLS) $(SGMLINCLUDE) -s $<


##
## Clean
##

clean distclean maintainer-clean:
# HTML
	rm -f HTML.manifest *.html *.htm
# man
	rm -rf *.1 *.l man1 manl manpage.refs manpage.links manpage.log
# print
	rm -f *.rtf *.tex *.dvi *.aux *.log *.ps *.pdf