aboutsummaryrefslogtreecommitdiff
path: root/doc/src/Makefile
blob: 88755599ee40bbc58e3057112fc09b1244bc3255 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# Postgres documentation makefile
# Thomas Lockhart

PGDOCS= ..
SRCDIR= ../../src

HPATH=$(PGDOCS)/doc
PPATH=$(PGDOCS)/doc

#HSTYLE=/usr/lib/sgml/stylesheets/jade/docbook/html
#PSTYLE=/usr/lib/sgml/stylesheets/jade/docbook/print

HSTYLE=/home/tgl/SGML/db107.d/docbook/html
PSTYLE=/home/tgl/SGML/db107.d/docbook/print

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

#DBOPTS=-V %no-split-output% -V %no-make-index%

TAR= tar
TAREXCLUDE= --exclude=Makefile --exclude='*.sgml'

# Pick up Makefile.custom from the source area
# This is the only resource from the code source area and is optional

ifneq ($(wildcard $(SRCDIR)/Makefile.custom), )
include $(SRCDIR)/Makefile.custom
endif

TARGETS= postgres tutorial user admin programmer

HTARGETS=#make this a mapping from targets
PTARGETS=#make this a mapping from targets

.PRECIOUS: postgres.html postgres.tex postgres.dvi
.PHONY: sources clean

install::
	$(MAKE) all
	(mv -rf *.gz ..)

all:: $(SGO) $(SGP)

sources::
	($(TAR) zcf sources.tar.gz --exclude='*.htm*' --exclude='*.gz' .)

user.tar.gz:
	$(MAKE) -C sgml clean
	$(MAKE) -C sgml user.html
	($(TAR) zcf $@ $(TAREXCLUDE) -C sgml .)

tutorial.tar.gz:
	$(MAKE) -C sgml clean
	$(MAKE) -C sgml tutorial.html
	($(TAR) zcf $@ $(TAREXCLUDE) -C sgml . -C .. -C graphics clientserver.gif)

clean::
	(rm -rf *.html *.htm)

distclean::
	$(MAKE) -C sgml clean

# Generic production rules

# Compressed file

%.gz:	%
	(gzip -f $<)

# TAR file for HTML package

%.tar:	%.html # %.ps
	(tar cf $@ $*.html index.html *.htm *.gif) # $*.ps
	(rm -rf index.html *.htm)

#	(mkdir $*)
#	(rm -rf $*/*)
#	(mv *.htm $*/)
#	(cd $*/; ln -sf book01.htm index.html)
#	(tar cf $@ $*)

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

%.html:	%.sgml $(HDSL)
	(rm -rf *.htm)
	jade $(DBOPTS) -D sgml -d $(HDSL) -t sgml $<
	(ln -sf book01.htm index.html)
	(ln -sf book01.htm $*.html)

#	(mkdir $(HPATH)/$*)	# be sure there is somewhere to put them
#	(rm -rf $(HPATH)/$*/*)	# remove existing files since some names may be obsolete
#	(mv *.htm $(HPATH)/$*/)	# and copy 'em over
#	(cd $(HPATH)/$*/; ln -sf book01.htm index.html)

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

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

# TeX and DVI

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

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

# Postscript from TeX

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

# Graphics

%.gif:
	cp -p graphics/%.gif .