Makefile.am 5.09 KB
Newer Older
bk@work.mysql.com's avatar
bk@work.mysql.com committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
# 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

21
targets =		manual.txt mysql.info manual.html
bk@work.mysql.com's avatar
bk@work.mysql.com committed
22 23 24 25 26 27 28 29 30

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

sasha@mysql.sashanet.com's avatar
sasha@mysql.sashanet.com committed
31 32
CLEAN_FILES:		$(BUILD_SOURCES)
	touch $(BUILD_SOURCES)
monty@donna.mysql.com's avatar
monty@donna.mysql.com committed
33

34
# The PostScript and PDF version are so big that they are not included in the
bk@work.mysql.com's avatar
bk@work.mysql.com committed
35
# standard distribution. It is available for download from the home page.  
36
paper: manual_a4.ps manual_letter.ps  $(PDFMANUAL)
bk@work.mysql.com's avatar
bk@work.mysql.com committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59

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

# The Makefile contains the previous version so we can not use that
include.texi:	../configure.in
	echo -n "@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) $<

60 61 62
manual_toc.html: manual.html


bk@work.mysql.com's avatar
bk@work.mysql.com committed
63 64
# Fix: add --output-comment with some interesting info?
# Fix: @image worked with a older version of pdftex. 
65 66
# Note: @image will work if we first convert all images to pdf ...
#       is that worth it?
bk@work.mysql.com's avatar
bk@work.mysql.com committed
67 68
# Comment: We need to run pdftex 2 times to get the cross references right.
manual.pdf: manual.texi
69 70 71 72 73 74 75 76
	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.*
bk@work.mysql.com's avatar
bk@work.mysql.com committed
77 78
	touch $@

79
# Target to produce NuSphere Manual
80 81 82 83 84 85
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' \
86 87 88 89 90 91 92 93
	> 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.*
94 95
	touch $@

bk@work.mysql.com's avatar
bk@work.mysql.com committed
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
# 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 '@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; \
	cp -p $(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 > $@
146 147 148

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