summaryrefslogtreecommitdiff
path: root/Docs/Makefile.am
blob: c4da4e9d0d392e9d8ed3bcc6477526ab1ac139ef (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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Normally you do not need to remake the files here. But if you want
# to you will need the GNU TeX-info utilities. To make a Postscript
# files you also need TeX and dvips. To make the PDF file you will
# need pdftex. We use the teTeX distribution for all of these.

# We avoid default automake rules because of problems with .dvi file
# and BSD makes

# If you know how to fix any of this more elegantly please mail
# david@mysql.com

TEXI2HTML_FLAGS =	-iso -number
DVIPS =			dvips
MAKEINFO =		@MAKEINFO@
TEXINFO_TEX =		Support/texinfo.tex

noinst_SCRIPTS =	Support/texi2html Support/generate-text-files.pl \
			Support/generate-mirror-listing.pl
info_TEXINFOS =		manual.texi

targets =		manual.txt mysql.info manual.html

BUILT_SOURCES =		$(targets) manual_toc.html include.texi
EXTRA_DIST =		$(noinst_SCRIPTS) $(BUILT_SOURCES) mysqld_error.txt INSTALL-BINARY

all:			$(targets) txt_files

txt_files:		../INSTALL-SOURCE ../COPYING ../COPYING.LIB \
			../MIRRORS INSTALL-BINARY

CLEAN_FILES:		$(BUILD_SOURCES)
	touch $(BUILD_SOURCES)

# The PostScript and PDF version are so big that they are not included in the
# standard distribution. It is available for download from the home page.  
paper: manual_a4.ps manual_letter.ps  $(PDFMANUAL)

#########################################################################

# The Makefile contains the previous version so we can not use that
include.texi:	../configure.in
	echo "@c This file is autogenerated by the Makefile" > $@
	echo -n "@set mysql_version " >> $@
	grep "AM_INIT_AUTOMAKE(mysql, " ../configure.in | \
	 sed -e 's;AM_INIT_AUTOMAKE(mysql, ;;' -e 's;);;' >> $@
	echo -n "@set default_port " >> $@
	grep "MYSQL_TCP_PORT_DEFAULT=" ../configure.in | \
	 sed -e 's;MYSQL_TCP_PORT_DEFAULT=;;' >> $@

mysql.info:	manual.texi include.texi
	cd $(srcdir) && $(MAKEINFO) --no-split -I $(srcdir) $<

manual.txt:	manual.texi include.texi
	cd $(srcdir) && \
	$(MAKEINFO) -I $(srcdir) --no-headers --no-split --output $@ $<

manual.html:	manual.texi include.texi $(srcdir)/Support/texi2html
	cd $(srcdir) && @PERL@ $(srcdir)/Support/texi2html $(TEXI2HTML_FLAGS) $<

manual_toc.html: manual.html


# Fix: add --output-comment with some interesting info?
# Fix: @image worked with a older version of pdftex. 
# Note: @image will work if we first convert all images to pdf ...
#       is that worth it?
# Comment: We need to run pdftex 2 times to get the cross references right.
manual.pdf: manual.texi
	cat manual.texi | sed -e 's|@image{[^}]*} *||g' > manual-tmp.texi
	pdftex --interaction=nonstopmode manual-tmp.texi
	texindex manual-tmp.??
	pdftex --interaction=nonstopmode manual-tmp.texi
	texindex manual-tmp.??
	pdftex --interaction=nonstopmode manual-tmp.texi
	mv manual-tmp.pdf manual.pdf
	rm -f manual-tmp.*
	touch $@

# Target to produce NuSphere Manual
nusphere.pdf: manual.texi
	cat manual.texi \
	| sed -e 's/@example/@smallexample/g' \
	      -e 's/@end example/@end smallexample/g' \
	      -e 's/@c ifnusphere //g' \
	      -e 's|@image{[^}]*} *||g' \
	> manual-tmp.texi
	pdftex --interaction=nonstopmode manual-tmp.texi
	texindex manual-tmp.??
	pdftex --interaction=nonstopmode manual-tmp.texi
	texindex manual-tmp.??
	pdftex --interaction=nonstopmode manual-tmp.texi
	mv manual-tmp.pdf nusphere.pdf
	rm -f manual-tmp.*
	touch $@

# The texi2dvi gives a lot of harmless errors. Just ignore them unless
# you want to help with the typesetting part.
# This is the European papersize version
manual_a4.ps:	manual.texi include.texi
	TEXINPUTS=$(srcdir):$$TEXINPUTS \
	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' \
	    $(TEXI2DVI) --batch --texinfo --quiet '@afourpaper' $<
	$(DVIPS) -t a4 manual.dvi -o $@
	touch $@

# This is the American papersize version
manual_letter.ps:	manual.texi include.texi
	TEXINPUTS=$(srcdir):$$TEXINPUTS \
	  MAKEINFO='$(MAKEINFO) -I $(srcdir)' \
	    $(TEXI2DVI) --batch $<
	$(DVIPS) -t letter manual.dvi -o $@
	touch $@

# Include images for the manual in the distribution
dist-hook:
	BD=`cd $(top_srcdir); pwd`; \
	if test ! -d $(distdir)/Flags; then mkdir -p $(distdir)/Flags; fi; \
	$(INSTALL_DATA) $(srcdir)/Flags/*.gif $(srcdir)/Flags/*.eps \
		$(srcdir)/Flags/*.txt $(distdir)/Flags;
	echo "PostScript and PDF versions suitable for printing" \
		> $(distdir)/manual.ps
	echo "are available from http://www.mysql.com/Manual/" \
		>> $(distdir)/manual.ps
	echo "or any mirror site" \
		>> $(distdir)/manual.ps

GT = $(srcdir)/Support/generate-text-files.pl

../INSTALL-SOURCE:	mysql.info $(GT)
	perl -w $(GT) mysql.info "Installing" "Compatibility" > $@

# We put the description for the binary installation here so that
# people who download source wont have to see it. It is moved up to
# the toplevel by the script that makes the binary tar files.
INSTALL-BINARY:	mysql.info $(GT)
	perl -w $(GT) mysql.info "Installing binary" "Installing source" > $@

../COPYING:		mysql.info $(GT)
	perl -w $(GT) mysql.info "GPL license" "LGPL license" > $@

../COPYING.LIB:		mysql.info $(GT)
	perl -w $(GT) mysql.info "LGPL license" "Function Index" > $@

../MIRRORS:		manual.texi $(srcdir)/Support/generate-mirror-listing.pl
	perl -w $(srcdir)/Support/generate-mirror-listing.pl manual.texi > $@

# Don't update the files from bitkeeper
%::SCCS/s.%