Initial release of Maemo 5 port of gnuplot
[gnuplot] / tutorial / Makefile.am.in
1 ## Process this file with automake to produce Makefile.in -*-Makefile-*-
2 AUTOMAKE_OPTIONS = foreign 1.2h
3
4 ##plt-files-begin
5 ##plt-files-end
6
7 EXTRA_DIST = Makefile.am.in $(PLT_FILES) \
8 header.tex makefile.dst tutorial.tex eg3.dat
9
10 CLEANFILES = tutorial.aux tutorial.dvi tutorial.log tutorial.pdf tutorial.ps \
11 tutorial.toc eg1.tex eg2.tex eg3.tex eg4.tex eg5.tex eg6.tex eg7.tex \
12 eg7.eps eg7.pdf test.tex
13
14 DVIPS = dvips
15 LATEX = @LATEX@
16
17 SUFFIXES = .dvi .plt .pdf .tex .ps
18
19 # default target
20 all: @TUTORIAL@
21
22 tutorial: tutorial.dvi
23
24 notutorial:
25
26 # To touch it up after changes:
27 remake: tutorial.dvi
28
29 ps: tutorial.ps
30
31 tutorial.ps: tutorial.dvi
32
33 pdf: tutorial.pdf
34
35 tutorial.dvi: eg1.tex eg2.tex eg3.tex eg4.tex eg5.tex eg6.tex eg7.tex eg7.eps test.tex \
36         tutorial.tex header.tex
37         @echo Building LaTeX tutorial
38         TEXINPUTS=.:$(srcdir):${TEXINPUTS}: $(LATEX) tutorial
39         TEXINPUTS=.:$(srcdir):${TEXINPUTS}: $(LATEX) tutorial
40
41 tutorial.pdf: eg1.tex eg2.tex eg3.tex eg4.tex eg5.tex eg6.tex eg7.tex eg7.pdf test.tex \
42         tutorial.tex header.tex
43         @echo "Building LaTeX tutorial (PDF version)"
44         TEXINPUTS=.:$(srcdir):${TEXINPUTS}: $(PDFLATEX) tutorial
45         TEXINPUTS=.:$(srcdir):${TEXINPUTS}: $(PDFLATEX) tutorial
46
47 RUN_GNUPLOT = if test -x $(top_builddir)/src/gnuplot ; then \
48           GNUPLOT_PS_DIR=$(top_srcdir)/term/PostScript \
49           GNUPLOT_LIB=$(srcdir) \
50           GNUTERM=latex \
51           $(top_builddir)/src/gnuplot $< ; \
52         else \
53           gnuplot $< ; \
54         fi
55
56 eg7.eps: eg7.plt
57         $(RUN_GNUPLOT)
58
59 .dvi.ps:
60         $(DVIPS) -o $@ $<
61
62 .plt.tex:
63         $(RUN_GNUPLOT)
64
65 .eps.pdf:
66         epstopdf $<
67
68 distclean-local:
69         @if test "$(top_srcdir)" != "$(top_builddir)" ; then \
70           rm -f eg3.dat; \
71         fi
72
73 Makefile.am: Makefile.am.in
74         rm -f $@ $@t
75         sed -n '1,/^##plt-files-begin/p' Makefile.am.in > $@t
76         echo PLT_FILES = *.plt | fmt | (tr '\012' @; echo ) \
77           |sed 's/@$$/%/;s/@/ \\@/g;' | tr @% '\012 ' >> $@t
78         sed -n '/^##plt-files-end/,$$p' $< >> $@t
79         chmod a-w $@t
80         mv $@t $@
81