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