Makefile.m4: Fix dependencies for parallel building.
[mdwtools] / Makefile.m4
CommitLineData
86f6a31e 1## -*-makefile-*-
2##
86f6a31e 3## Build system for mdwtools
4##
5## (c) 2002 Mark Wooding
6##
7
8##----- Licensing notice ----------------------------------------------------
9##
10## This file is part of the mdwtools LaTeX package collection.
11##
12## mdwtools is free software; you can redistribute it and/or modify
13## it under the terms of the GNU General Public License as published by
14## the Free Software Foundation; either version 2 of the License, or
15## (at your option) any later version.
e8e9e5d8 16##
86f6a31e 17## mdwtools is distributed in the hope that it will be useful,
18## but WITHOUT ANY WARRANTY; without even the implied warranty of
19## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20## GNU General Public License for more details.
e8e9e5d8 21##
86f6a31e 22## You should have received a copy of the GNU General Public License
23## along with mdwtools; if not, write to the Free Software Foundation,
24## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
86f6a31e 26AUTOMAKE_OPTIONS = foreign
27
65bf31fc
MW
28pkglatexdir = ${texmfdir}/tex/latex/${PACKAGE}
29pkgdocdir = ${texmfdir}/doc/latex/${PACKAGE}
86f6a31e 30
950ff97f 31define(`addsuffix', `patsubst(`$1', `\>', `$2')')
86f6a31e 32define(`BASE', `\
83b69571 33 at centre cmtt colour crypto doafter exercise footnote mdwkey \
e8f3554e 34 mdwlist mdwmath mdwref mdwtab mdwthm poetry slowbox sverb syntax')
86f6a31e 35
8c890f24 36AUX = mdwtools.tex gpl.tex
950ff97f 37SRC = addsuffix(BASE, `.dtx')
38DVI = addsuffix(BASE, `.dvi') mdwtools.dvi
83b69571 39PS = addsuffix(BASE, `.ps') mdwtools.ps
6d6d46d2 40PDF = addsuffix(BASE, `.pdf') mdwtools.pdf
86f6a31e 41OBJ = \
42 at.sty \
950ff97f 43 cmtt.sty mttcmtt.fd mttenc.def \
83b69571 44 colour.sty \
86f6a31e 45 crypto.sty \
46 doafter.sty \
47 doafter.tex \
48 exercise.sty \
49 footnote.sty \
83b69571 50 mdwkey.sty \
86f6a31e 51 mdwlist.sty \
52 mdwmath.sty \
e8f3554e 53 mdwref.sty \
83b69571 54 mdwtab.sty mathenv.sty mtcolour.sty mtcolor.sty \
86f6a31e 55 mdwthm.sty mdwmargin.thm \
56 poetry.sty \
83b69571 57 slowbox.sty \
58 sverb.sty svcolor.sty svcolour.sty svsplit.sty \
86f6a31e 59 syntax.sty
60
8c890f24 61pkglatex_DATA = $(OBJ) mdwtools.tex
6d6d46d2 62pkgdoc_DATA = $(DVI) $(PS) $(PDF)
86f6a31e 63
83b69571 64SUFFIXES = .dtx .tex .dvi .ps
86f6a31e 65define(`run_latex', `latex "\def\indexing{n} \nonstopmode \input $<"
66 latex "\def\indexing{y} \nonstopmode \input $<"
67 makeindex -s gind.ist $`'*.idx
68 latex "\def\indexing{n} \nonstopmode \input $<"')
69
83b69571 70.dtx.dvi:
86f6a31e 71 run_latex
83b69571 72.tex.dvi:
86f6a31e 73 run_latex
83b69571 74.dvi.ps:
75 dvips -e0 -o $@ $<
6d6d46d2
MW
76.ps.pdf:
77 ps2pdf $< $@
83b69571 78
79$(DVI): gpl.tex $(OBJ) mdwtools.tex
86f6a31e 80
d03425ae
MW
81$(wordlist 2,$(words $(OBJ)),$(OBJ)): $(firstword $(OBJ))
82$(firstword $(OBJ)): $(SRC) mdwtools.ins
86f6a31e 83 tex mdwtools.ins
84
83b69571 85EXTRA_DIST = $(SRC) $(AUX) $(DVI) $(OBJ) $(PS) mdwtools.ins Makefile.m4
8c890f24 86
86f6a31e 87MAINTAINERCLEANFILES = $(OBJ) $(DVI)
88CLEANFILES = *.tmp *.aux *.idx *.ilg *.log *.toc *.ind *.lot *.ans
89
90Makefile.am: Makefile.m4
83b69571 91 m4 $(srcdir)/Makefile.m4 >Makefile.am.new
92 mv Makefile.am.new $(srcdir)/Makefile.am
86f6a31e 93
d3d35d4b
MW
94dist-hook::
95 echo $(VERSION) >$(distdir)/RELEASE
96EXTRA_DIST += auto-version
97
3aea29e2
MW
98EXTRA_DIST += debian/changelog debian/control debian/copyright debian/compat
99EXTRA_DIST += debian/rules
100
86f6a31e 101.PHONY: dvi
102
103##----- That's all, folks ---------------------------------------------------