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