1## Process this file with automake to produce Makefile.in -*-Makefile-*-
2AUTOMAKE_OPTIONS = foreign
3
4##plt-files-begin
5##plt-files-end
6
7EXTRA_DIST = Makefile.am.in $(PLT_FILES) \
8header.tex makefile.dst tutorial.tex eg3.dat
9
10CLEANFILES = tutorial.aux tutorial.dvi tutorial.log tutorial.pdf tutorial.ps \
11tutorial.toc eg1.tex eg2.tex eg3.tex eg4.tex eg5.tex eg6.tex eg7.tex \
12eg7.eps eg7.pdf test.tex
13
14DVIPS = dvips
15LATEX = @LATEX@
16
17SUFFIXES = .dvi .plt .pdf .tex .ps
18
19# default target
20all: @TUTORIAL@
21
22tutorial: tutorial.dvi
23
24notutorial:
25
26# To touch it up after changes:
27remake: tutorial.dvi
28
29ps: tutorial.ps
30
31tutorial.ps: tutorial.dvi
32
33pdf: tutorial.pdf
34
35tutorial.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
41tutorial.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
47RUN_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
56eg7.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
68distclean-local:
69	@if test "$(top_srcdir)" != "$(top_builddir)" ; then \
70	  rm -f eg3.dat; \
71	fi
72
73Makefile.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 og-w $@t
80	mv $@t $@
81
82