1# Makefile.am for GNUPLOT documentation directory
2# based on Makefile.in as of 20-may-2012
3#
4# Note that the master file for generating documentation is gnuplot.doc.
5# See README.
6#
7# To print manual:
8#
9#   For LaTeX
10#       make dvi
11#     or
12#       make pdf
13#	(requires pdflatex and also graphicx and picins packages)
14#     or
15#       make pdf_nofig
16#       (PDF without figures, e.g. if graphicx or picins are not present)
17#     or
18#       make ps
19#
20#   For groff (GNU troff}
21#       make grotxt
22#       (print or view gnuplot.txt)
23#     or
24#       make grodvi
25#       (print or view gnuplot.dvi)
26#     or
27#       make grops
28#       (print or view gnuplot.ps)
29#     or
30#       make groff
31#       (all three of the above)
32#
33#   For nroff
34#     make nroff
35#     (print or view gnuplot.nroff)
36#
37#   For troff
38#     make "TROFF=itroff" troff    (use your troff here)
39#
40#   For GNU info (texinfo)
41#     make info
42#
43
44# default is what is needed for interactive gnuplot
45gih_DATA = gnuplot.gih
46gihdir = @GIHDIR@
47
48noinst_PROGRAMS = checkdoc doc2ipf doc2tex doc2gih doc2rnh doc2hlp	\
49                  doc2rtf doc2ms alldoc2gih
50
51AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/term
52
53T = $(top_srcdir)/term/
54CORETERM = $(T)ai.trm $(T)aquaterm.trm $(T)be.trm $(T)caca.trm \
55$(T)cairo.trm $(T)canvas.trm $(T)cgm.trm $(T)context.trm \
56$(T)corel.trm $(T)debug.trm $(T)djsvga.trm $(T)dumb.trm $(T)dxf.trm \
57$(T)dxy.trm $(T)eepic.trm $(T)emf.trm $(T)emxvga.trm $(T)epson.trm \
58$(T)estimate.trm $(T)excl.trm $(T)fig.trm $(T)gd.trm $(T)ggi.trm \
59$(T)gpic.trm $(T)grass.trm $(T)hp2648.trm $(T)hp26.trm $(T)hp500c.trm \
60$(T)hpgl.trm $(T)hpljii.trm $(T)hppj.trm $(T)imagen.trm $(T)kyo.trm \
61$(T)latex.trm $(T)linux.trm $(T)lua.trm $(T)metafont.trm \
62$(T)metapost.trm $(T)mif.trm $(T)pbm.trm \
63$(T)pdf.trm $(T)pm.trm $(T)post.trm $(T)pslatex.trm \
64$(T)pstricks.trm $(T)qms.trm $(T)qt.trm $(T)regis.trm \
65$(T)svg.trm $(T)t410x.trm $(T)tek.trm $(T)texdraw.trm $(T)tgif.trm \
66$(T)tkcanvas.trm $(T)tpic.trm $(T)vgagl.trm \
67$(T)vws.trm $(T)win.trm $(T)wxt.trm $(T)x11.trm $(T)xlib.trm
68
69# DIST_COMMON = README
70
71SOURCES = checkdoc.c doc2gih.c doc2hlp.c doc2ipf.c doc2ms.c doc2rnh.c	\
72doc2rtf.c doc2tex.c windows/doc2html.c termdoc.c xref.c
73
74TERM_H = $(top_srcdir)/src/term.h
75
76DOCHEADERS = doc2x.h xref.h
77
78EXTRA_DIST = Makefile.in doc2texi.el figure_missing.pdf gnuplot.doc \
79titlepag.ipf titlepag.ms titlepag.tex	\
80toc_entr.sty psdoc faq-ja.tex gnuplot-ja.doc README.ja	\
81term-ja.diff plotstyles.gnu plotstyles_cvt.cmd gnuplot.pdf \
82windows/wgnuplot.hhk windows/wgnuplot.hhp windows/wgnuplot.stp windows/doc2html.c
83
84ELCS = gnuplot-eldoc.elc
85
86MOSTLYCLEANFILES = gnuplot.aux gnuplot.ind gnuplot.log gnuplot.out	\
87gnuplot.toc figures.aux figures.log figures.toc figures.idx		\
88figures.ilg figures.ind figures.out nofigures.aux nofigures.log		\
89nofigures.toc nofigures.idx nofigures.ilg nofigures.ind nofigures.out	\
90pdffigures.tex pdffigures.aux wxhelp/doc2html.o
91
92CLEANFILES = allterm.h gnuplot.dvi figures.tex nofigures.tex		\
93gnuplot.tex gnuplot.idx gnuplot.ilg gnuplot.ps 	\
94gnuplot.gih gnuplot.hlp gnuplot.info* gnuplot.ipf gnuplot.ms		\
95gnuplot.rnh gnuplot.rtf gnuplot.nroff gnuplot.txt gnuplot-groff.dvi	\
96gnuplot-groff.ps gnuplot.tmp VERSION gnuplot.4tc gnuplot.4ct		\
97gnuplot.idv gnuplot.xref gnuplot.lg gnuplot.pdf wxhelp_figures		\
98wxhelp/*.html wxhelp/wgnuplot.hhc wxhelp/wgnuplot.hhk			\
99wxhelp/wgnuplot.htc wxhelp/doc2html$(EXEEXT) windows/wgnuplot.htk	\
100windows/*.png gnuplot.htb gnuplot.texi gnuplot-eldoc.el $(ELCS)
101
102DISTFILES = $(DIST_COMMON) $(SOURCES) $(DOCHEADERS) $(EXTRA_DIST)
103
104BUILT_SOURCES = allterm.h
105
106GNUPLOT_EXE = ../src/gnuplot$(EXEEXT)
107
108$(GNUPLOT_EXE):
109	( cd ../src ; $(MAKE) gnuplot$(EXEEXT) )
110
111if BUILD_LUA
112LUA_HELP = gnuplot-tikz.help
113$(LUA_HELP): $(top_srcdir)/term/lua/gnuplot-tikz.lua
114	$(AM_V_GEN) $(LUA) $< termhelp > $@
115else
116LUA_HELP =
117endif
118
119allterm.h: $(CORETERM) $(LUA_HELP)
120	$(AM_V_GEN) for e in `egrep "^[ 	]*START_HELP" $(CORETERM) |\
121	     LC_ALL=C sort -f -t':' -k2` ; do \
122	  f=`echo $$e |cut -d\: -f1` ; s=`echo $$e | cut -d\: -f2` ;\
123	  sed -n "/^[ 	]*$$s/,/^[ 	]*END_HELP/p" $$f ; \
124	done >$@
125
126# for debugging
127alldoc: check dvi gih hlp html info ipf nroff pdf ps rnh rtf htb
128
129### [tn]roff documentation
130troff: gnuplot.ms $(srcdir)/titlepag.ms
131	$(AM_V_GEN) tbl gnuplot.ms | eqn | $(TROFF) -ms
132
133nroff: gnuplot.nroff
134gnuplot.nroff: gnuplot.ms $(srcdir)/titlepag.ms
135	$(AM_V_GEN) tbl $< | neqn | nroff -ms | col > $@
136
137### groff documentation
138
139groff: grotxt grodvi grops
140
141grotxt: gnuplot.txt
142gnuplot.txt: gnuplot.ms $(srcdir)/titlepag.ms
143	$(AM_V_GEN) groff -s -p -t -e -ms -Tlatin1 $< > $@
144
145grodvi: gnuplot-groff.dvi
146gnuplot-groff.dvi: gnuplot.ms $(srcdir)/titlepag.ms
147	$(AM_V_GEN) groff -s -p -t -e -ms -Tdvi $< > $@
148
149grops: gnuplot-groff.ps
150gnuplot-groff.ps: gnuplot.ms $(srcdir)/titlepag.ms
151	$(AM_V_GEN) groff -s -p -t -e -ms -Tps $< > $@
152
153### doc2xxx dependencies
154gnuplot.ms: doc2ms$(EXEEXT) $(srcdir)/gnuplot.doc
155	$(AM_V_GEN) ./doc2ms$(EXEEXT) $(srcdir)/gnuplot.doc gnuplot.ms "$(srcdir)/titlepag.ms"
156
157doc2ms_SOURCES = doc2ms.c termdoc.c
158doc2ms_CPPFLAGS = -DALL_TERM_DOC $(AM_CPPFLAGS)
159
160### html
161html: htmldocs/gnuplot.html
162htmldocs/gnuplot.html: figures.tex wxhelp_figures pdf_figures
163	$(AM_V_GEN)if test $(LATEX2HTML) != no ; then \
164	  mkdir -p htmldocs ; \
165	  $(LATEX2HTML) -dir htmldocs -local_icons $< ; \
166	else \
167	  echo latex2html not found - cannot build html file ; \
168	fi
169
170### PDF documentation
171pdf_figures: $(GNUPLOT_EXE) $(srcdir)/plotstyles.gnu
172	$(AM_V_at)GNUPLOT_LIB=$(top_srcdir)/demo $(GNUPLOT_EXE) $(srcdir)/plotstyles.gnu
173	$(AM_V_GEN)touch $@
174
175figures.tex: allterm.h doc2tex$(EXEEXT) $(srcdir)/gnuplot.doc
176	$(AM_V_GEN)./doc2tex$(EXEEXT) -figures $(srcdir)/gnuplot.doc $@
177
178nofigures.tex: allterm.h doc2tex$(EXEEXT) $(srcdir)/gnuplot.doc
179	$(AM_V_GEN)./doc2tex$(EXEEXT) $(srcdir)/gnuplot.doc $@
180
181pdf: gnuplot.pdf
182pdf_nofig: nofigures.pdf
183
184gnuplot.pdf: figures.tex pdf_figures $(srcdir)/titlepag.tex $(srcdir)/toc_entr.sty
185	$(AM_V_GEN)if test $(PDFLATEX) != no ; then \
186	  rm -f figures.idx ; \
187	  touch figures.idx ; \
188	  rm -f pdffigures.tex ; \
189	  ( echo "\usepackage{graphicx}" > pdffigures.tex ; \
190	    echo "\usepackage{picins}" >> pdffigures.tex ; \
191	  ) ; \
192	  TEXINPUTS=.:$(srcdir):$(top_srcdir):${TEXINPUTS}: $(PDFLATEX) $< ; \
193	  TEXINPUTS=.:$(srcdir):$(top_srcdir):${TEXINPUTS}: $(PDFLATEX) $< ; \
194	  TEXINPUTS=.:$(srcdir):$(top_srcdir):${TEXINPUTS}: $(PDFLATEX) $< ; \
195	  makeindex figures ; \
196	  TEXINPUTS=.:$(srcdir):$(top_srcdir):${TEXINPUTS}: $(PDFLATEX) $< ; \
197	  mv figures.pdf $@ ; \
198	  rm -f pdffigurex.tex pdffigures.aux ; \
199	else \
200	  echo pdflatex not found - cannot build pdf file ; \
201	fi
202
203nofigures.pdf: nofigures.tex $(srcdir)/titlepag.tex $(srcdir)/toc_entr.sty
204	$(AM_V_GEN)if test $(PDFLATEX) != no ; then \
205	  rm -f nofigures.idx ; \
206	  touch nofigures.idx ; \
207	  rm -f pdffigures.tex ; \
208	  echo "" > pdffigures.tex ; \
209	  TEXINPUTS=.:$(srcdir):$(top_srcdir):${TEXINPUTS}: $(PDFLATEX) $< ; \
210	  TEXINPUTS=.:$(srcdir):$(top_srcdir):${TEXINPUTS}: $(PDFLATEX) $< ; \
211	  TEXINPUTS=.:$(srcdir):$(top_srcdir):${TEXINPUTS}: $(PDFLATEX) $< ; \
212	  makeindex nofigures ; \
213	  TEXINPUTS=.:$(srcdir):$(top_srcdir):${TEXINPUTS}: $(PDFLATEX) $< ; \
214	  rm -f pdffigurex.tex pdffigures.aux ; \
215	else \
216	  echo pdflatex not found - cannot build pdf file ; \
217	fi
218
219### LaTeX documentation
220tex: gnuplot.tex
221gnuplot.tex: nofigures.tex
222	$(AM_V_GEN) $(LN_S) $< $@
223
224doc2tex_SOURCES = doc2tex.c termdoc.c
225doc2tex_CPPFLAGS = -DALL_TERM_DOC $(AM_CPPFLAGS)
226
227dvi: gnuplot.dvi
228gnuplot.dvi: gnuplot.tex $(srcdir)/titlepag.tex $(srcdir)/toc_entr.sty
229	$(AM_V_GEN)if test $(LATEX) != no ; then \
230	  rm -f nofigures.idx ; \
231	  touch nofigures.idx ; \
232	  rm -f pdffigures.tex ; \
233	  echo "" > pdffigures.tex ; \
234	  TEXINPUTS=.:$(srcdir):$(top_srcdir):${TEXINPUTS}: $(LATEX) $< ; \
235	  TEXINPUTS=.:$(srcdir):$(top_srcdir):${TEXINPUTS}: $(LATEX) $< ; \
236	  TEXINPUTS=.:$(srcdir):$(top_srcdir):${TEXINPUTS}: $(LATEX) $< ; \
237	  makeindex gnuplot ; \
238	  TEXINPUTS=.:$(srcdir):$(top_srcdir):${TEXINPUTS}: $(LATEX) $< ; \
239	  rm -f pdffigurex.tex pdffigures.aux ; \
240	else \
241	  echo "latex not found - cannot build dvi file" ; \
242	fi
243
244### Postscript format
245# if pslatex has been installed, add "times" to titlepage.tex
246ps: gnuplot.ps
247
248gnuplot.ps: gnuplot.dvi
249	$(AM_V_GEN)if test $(DVIPS) != no ; then \
250	   $(DVIPS) gnuplot.dvi -o gnuplot.ps ; \
251	else \
252	   echo "dvips not found - cannot build PS file" ; \
253	fi
254
255# this is how to make gnuplot.hlp
256hlp: gnuplot.hlp
257
258gnuplot.hlp: doc2hlp$(EXEEXT) $(srcdir)/gnuplot.doc
259	$(AM_V_GEN)./doc2hlp$(EXEEXT) $(srcdir)/gnuplot.doc gnuplot.hlp
260
261doc2hlp_SOURCES = doc2hlp.c termdoc.c
262
263### gnuplot interactive help format
264gih: gnuplot.gih
265
266gnuplot.gih: doc2gih$(EXEEXT) $(srcdir)/gnuplot.doc
267	$(AM_V_GEN)./doc2gih$(EXEEXT) $(srcdir)/gnuplot.doc gnuplot.gih
268
269doc2gih_SOURCES = doc2gih.c termdoc.c
270
271# To include all terminals in the .gih file
272allgih: alldoc2gih$(EXEEXT) $(srcdir)/gnuplot.doc
273	@echo "generate gnuplot.gih with all terminals"
274	$(AM_V_at)./alldoc2gih$(EXEEXT) $(srcdir)/gnuplot.doc gnuplot.gih
275
276alldoc2gih_SOURCES = doc2gih.c termdoc.c
277alldoc2gih_CPPFLAGS = -DALL_TERM_DOC $(AM_CPPFLAGS)
278
279### wxhelp format
280htb: gnuplot.htb
281
282gnuplot.htb: wxhelp/wgnuplot.html wxhelp_figures	\
283$(srcdir)/windows/wgnuplot.hhp wxhelp/wgnuplot.hhc	\
284$(srcdir)/windows/wgnuplot.hhk
285	$(AM_V_GEN) zip -j9 gnuplot.htb windows/wgnuplot.hhp		\
286wxhelp/wgnuplot.hhc wxhelp/wgnuplot.hhk wxhelp/*.html windows/*.png
287
288wxhelp/wgnuplot.html: doc2wxhtml$(EXEEXT) $(srcdir)/gnuplot.doc
289	$(AM_V_GEN) ./doc2wxhtml$(EXEEXT) $(srcdir)/gnuplot.doc wxhelp/
290
291#doc2wxhtml_SOURCES = windows/doc2html.c termdoc.c xref.c allterm.h
292#doc2wxhtml_CPPFLAGS = -DALL_TERM_DOC -DWXHELP -I../src $(AM_CPPFLAGS)
293
294wxhelp_figures: $(GNUPLOT_EXE) $(srcdir)/plotstyles.gnu
295	$(AM_V_at) [ -d windows ] || mkdir -p windows
296	$(AM_V_at) GNUPLOT_LIB=$(top_srcdir)/demo $(GNUPLOT_EXE) -e "winhelp=1;" $(srcdir)/plotstyles.gnu
297	$(AM_V_GEN)touch $@
298
299### GNU info format
300info: gnuplot.info
301
302# Thanks to Bruce Ravel for doc2texi.el!
303gnuplot.texi gnuplot-eldoc.el: $(srcdir)/doc2texi.el $(srcdir)/gnuplot.doc
304	$(AM_V_GEN) if test "$(EMACS)" != no; then \
305	   test "$(top_srcdir)" = "$(top_builddir)" || cp $(srcdir)/gnuplot.doc . ; \
306	   $(EMACS) -batch -q --no-site-file -l $< -f d2t-doc-to-texi ; \
307	   test "$(top_srcdir)" = "$(top_builddir)" || rm -f ./gnuplot.doc ; \
308	else \
309	   echo "No emacs found - cannot create texinfo file" ; \
310	fi
311
312${ELCS}: gnuplot-eldoc.el
313	$(AM_V_GEN) if test "$(EMACS)" != no; then \
314	   echo "Compiling gnuplot-eldoc.el" ; \
315	   $(EMACS) -batch -q --no-site-file -f batch-byte-compile $* ; \
316	else \
317	   echo "No emacs found - cannot create gnuplot-eldoc.elc file" ; \
318	fi
319
320# Rules processing texinfo could be provided by automake
321# automatically, using a line like info_TEXINFOS = gnuplot.texi.  But
322# that only appears to work with a non-generated texi file for input.
323
324gnuplot.info: gnuplot.texi
325	$(AM_V_GEN) $(MAKEINFO) -I$(srcdir) $< --no-split --output=$@
326
327install-info: gnuplot.info
328	$(AM_V_at) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(infodir)
329	$(AM_V_at) $(INSTALL_DATA) gnuplot.info $(DESTDIR)$(infodir)/gnuplot.info
330	$(AM_V_at) if (install-info --version && \
331	     install-info --version | fgrep -i -v debian) >/dev/null 2>&1; then \
332	  install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/gnuplot.info || : ;\
333	else : ; fi
334
335# this is how to make OS/2 ipfc documentation
336ipf: gnuplot.ipf
337
338gnuplot.ipf: doc2ipf$(EXEEXT) $(srcdir)/gnuplot.doc
339	$(AM_V_GEN) ./doc2ipf$(EXEEXT) $(srcdir)/gnuplot.doc gnuplot.ipf
340
341doc2ipf_SOURCES = doc2ipf.c termdoc.c xref.c
342
343### Rich Text Format
344rtf: gnuplot.rtf
345
346gnuplot.rtf: doc2rtf$(EXEEXT) $(srcdir)/gnuplot.doc
347	$(AM_V_GEN) ./doc2rtf$(EXEEXT) $(srcdir)/gnuplot.doc gnuplot.rtf
348
349doc2rtf_SOURCES = doc2rtf.c termdoc.c xref.c
350
351# this is how to make rnh documentation (VMS help format)
352rnh: gnuplot.rnh
353
354gnuplot.rnh: doc2rnh$(EXEEXT) $(srcdir)/gnuplot.doc
355	$(AM_V_GEN) ./doc2rnh$(EXEEXT) $(srcdir)/gnuplot.doc gnuplot.rnh
356
357doc2rnh_SOURCES = doc2rnh.c termdoc.c
358
359# this is how to check the gnuplot.doc file
360check-local: checkdoc$(EXEEXT)
361	$(AM_V_at)./checkdoc$(EXEEXT) < $(srcdir)/gnuplot.doc; \
362	if test $$? -eq 0; then \
363	  echo "PASS: gnuplot.doc"; \
364	else \
365	  :; \
366	fi
367
368checkdoc_SOURCES = checkdoc.c termdoc.c gnuplot.doc
369
370clean-local:
371	$(AM_V_at)for f in figure*.pdf $(LUA_HELP); do \
372	   if [ "$$f" != "figure_missing.pdf" ]; then \
373	     rm -f $$f ; \
374	   else \
375	     :; \
376	   fi \
377	 done
378	$(AM_V_at)rm -f pdf_figures
379
380# for VMS only
381install-vms: gnuplot.hlp
382	$(AM_V_at)$(INSTALL_DATA) gnuplot.hlp $(datadir)/gnuplot.hlp
383
384#the end
385