Add build system. Write most of the introduction.
[doc/wrestlers] / Makefile.m4
CommitLineData
dff0fad2
MW
1## -*-fundamental-*-
2##
3## $Id: Makefile.m4,v 1.1 2002/02/24 15:43:20 mdw Exp $
4##
5## Makefile for IPS
6##
7## (c) 2002 Mark Wooding
8##
9
10##----- Licensing notice ----------------------------------------------------
11##
12## This program 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.
16##
17## This program 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.
21##
22## You should have received a copy of the GNU General Public License
23## along with this program; if not, write to the Free Software Foundation,
24## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26AUTOMAKE_OPTIONS = foreign
27
28SRC = \
29 wrslides.tex wrslides.cls \
30 wr-backg.tex wr-main.tex ecc.mp \
31 wrestlers.tex
32
33changequote([[, ]])
34
35define([[DOECC]], [[mpost ecc.mp && mptopdf ecc.0 &&]])
36define([[L1]], [[latex $1]])
37define([[LFULL]],
38 [[latex $1 && bibtex $1 && latex $1 && latex $1 && latex $1]])
39define([[OUTPUTS]], [[dnl
40_([[notes]], [[L1]], [[wrslides]],
41 [[\wrslidesfalse]], [[DOECC]])dnl
42_([[slides]], [[L1]], [[wrslides]],
43 [[\wrslidestrue\includeonly{wr-main}]], [[DOECC]])dnl
44_([[longslides]], [[L1]], [[wrslides]],
45 [[\wrslidestrue]], [[DOECC]])dnl
46_([[paper]], [[LFULL]], [[wrestlers]], [[]])dnl
47_([[llncs]], [[LFULL]], [[wrestlers]], [[\fancystylefalse\shorttrue]])dnl
48]])
49define([[adorn]], [[define([[_]], [[$2$]][[1$3 ]])$1]])
50define([[tags]], [[adorn([[$1]])]])
51define([[addsuffix]], [[adorn([[$1]], [[wr-]], [[$2]])]])
52
53DVI = addsuffix([[OUTPUTS]], [[.dvi]])
54DVIGZ = addsuffix([[OUTPUTS]], [[.dvi.gz]])
55PS = addsuffix([[OUTPUTS]], [[.ps]])
56PSGZ = addsuffix([[OUTPUTS]], [[.ps.gz]])
57PDF = addsuffix([[OUTPUTS]], [[.pdf]])
58
59noinst_DATA = $(DVI) $(DVIGZ) $(PS) $(PSGZ) $(PDF)
60
61define([[_]], [[dnl
62wr-$1.dvi: $(SRC)
63 @if [ ! -d $1 ]; then \
64 mkdir $1; \
65 for i in $(SRC); do ln -s ../$(srcdir)/$$i $1; done; \
66 echo '$4' >$1/wr.cfg; \
67 fi
68 cd $1 && $5 $2($3) && cp $3.dvi ../wr-$1.dvi
69wr-$1.pdf: wr-$1.dvi
70 cd $1 && pdflatex $3 && cp $3.pdf ../wr-$1.pdf
71]])
72OUTPUTS
73
74%.gz: %; gzip -9cv $^ >$@.new && mv $@.new $@
75%.ps: %.dvi; dvips -o $@ $^
76
77CLEANFILES = *.dvi *.ps $(DVIGZ) $(PSGZ) $(PDF) *.[0-9] *-[0-9].pdf
78
79Makefile.am: Makefile.m4
80 cd $(srcdir) && m4 Makefile.m4 >Makefile.am
81
82EXTRA_DIST = $(SRC) Makefile.m4
83
84clean:; rm -rf tags([[OUTPUTS]]) && rm -f $(CLEANFILES)
85
86.PHONY: dvi
87
88##----- That's all, folks ---------------------------------------------------