Commit | Line | Data |
---|---|---|
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 | ||
26 | AUTOMAKE_OPTIONS = foreign | |
27 | ||
28 | SRC = \ | |
29 | wrslides.tex wrslides.cls \ | |
30 | wr-backg.tex wr-main.tex ecc.mp \ | |
31 | wrestlers.tex | |
32 | ||
33 | changequote([[, ]]) | |
34 | ||
35 | define([[DOECC]], [[mpost ecc.mp && mptopdf ecc.0 &&]]) | |
36 | define([[L1]], [[latex $1]]) | |
37 | define([[LFULL]], | |
38 | [[latex $1 && bibtex $1 && latex $1 && latex $1 && latex $1]]) | |
39 | define([[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 | ]]) | |
49 | define([[adorn]], [[define([[_]], [[$2$]][[1$3 ]])$1]]) | |
50 | define([[tags]], [[adorn([[$1]])]]) | |
51 | define([[addsuffix]], [[adorn([[$1]], [[wr-]], [[$2]])]]) | |
52 | ||
53 | DVI = addsuffix([[OUTPUTS]], [[.dvi]]) | |
54 | DVIGZ = addsuffix([[OUTPUTS]], [[.dvi.gz]]) | |
55 | PS = addsuffix([[OUTPUTS]], [[.ps]]) | |
56 | PSGZ = addsuffix([[OUTPUTS]], [[.ps.gz]]) | |
57 | PDF = addsuffix([[OUTPUTS]], [[.pdf]]) | |
58 | ||
59 | noinst_DATA = $(DVI) $(DVIGZ) $(PS) $(PSGZ) $(PDF) | |
60 | ||
61 | define([[_]], [[dnl | |
62 | wr-$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 | |
69 | wr-$1.pdf: wr-$1.dvi | |
70 | cd $1 && pdflatex $3 && cp $3.pdf ../wr-$1.pdf | |
71 | ]]) | |
72 | OUTPUTS | |
73 | ||
74 | %.gz: %; gzip -9cv $^ >$@.new && mv $@.new $@ | |
75 | %.ps: %.dvi; dvips -o $@ $^ | |
76 | ||
77 | CLEANFILES = *.dvi *.ps $(DVIGZ) $(PSGZ) $(PDF) *.[0-9] *-[0-9].pdf | |
78 | ||
79 | Makefile.am: Makefile.m4 | |
80 | cd $(srcdir) && m4 Makefile.m4 >Makefile.am | |
81 | ||
82 | EXTRA_DIST = $(SRC) Makefile.m4 | |
83 | ||
84 | clean:; rm -rf tags([[OUTPUTS]]) && rm -f $(CLEANFILES) | |
85 | ||
86 | .PHONY: dvi | |
87 | ||
88 | ##----- That's all, folks --------------------------------------------------- |