Various small fixes.
[doc/ips] / Makefile.m4
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 ##----- Revision history ----------------------------------------------------
27 ##
28 ## $Log: Makefile.m4,v $
29 ## Revision 1.1 2002/02/24 15:43:20 mdw
30 ## New build system.
31 ##
32
33 AUTOMAKE_OPTIONS = foreign
34
35 SRC = \
36 ips.tex ips.cls \
37 basics.tex \
38 auth-mac.tex auth-sig.tex \
39 enc-intro.tex enc-pub.tex enc-symm.tex enc-ies.tex
40
41 changequote([[, ]])
42
43 define([[OUTPUTS]], [[dnl
44 _([[notes]], [[\ipsslidesfalse\ipsanswerstrue]])dnl
45 _([[noans]], [[\ipsslidesfalse\ipsanswersfalse]])dnl
46 _([[slides]], [[\ipsslidestrue]])dnl
47 ]])
48 define([[adorn]], [[define([[_]], [[$2$]][[1$3 ]])$1]])
49 define([[tags]], [[adorn([[$1]])]])
50 define([[addsuffix]], [[adorn([[$1]], [[ips-]], [[$2]])]])
51
52 DVIGZ = addsuffix([[OUTPUTS]], [[.dvi.gz]])
53 PSGZ = addsuffix([[OUTPUTS]], [[.ps.gz]])
54 PDF = addsuffix([[OUTPUTS]], [[.pdf]])
55
56 noinst_DATA = $(DVIGZ) $(PSGZ) $(PDF)
57
58 define([[_]], [[dnl
59 ips-$1.dvi: $(SRC)
60 @if [ ! -d $1 ]; then \
61 mkdir $1; \
62 for i in $(SRC); do ln -s ../$$i $1; done; \
63 echo '$2' >$1/ips.cfg; \
64 fi
65 cd $1 && \
66 latex ips && bibtex ips && latex ips && latex ips && \
67 cp ips.dvi ../ips-$1.dvi
68 ips-$1.pdf: ips-$1.dvi
69 cd $1 && pdflatex ips && cp ips.pdf ../ips-$1.pdf
70 ips-$1.dvi.gz: ips-$1.dvi
71 gzip -9cv ips-$1.dvi >ips-$1.dvi.gz
72 ips-$1.ps: ips-$1.dvi
73 dvips -o ips-$1.ps ips-$1.dvi
74 ips-$1.ps.gz: ips-$1.ps
75 gzip -9cv ips-$1.ps >ips-$1.ps.gz
76 ]])
77 OUTPUTS
78
79 CLEANFILES = *.dvi *.ps $(DVIGZ) $(PSGZ) $(PDF)
80
81 Makefile.am: Makefile.m4
82 cd $(srcdir) && m4 Makefile.m4 >Makefile.am
83
84 EXTRA_DIST = $(SRC) Makefile.m4
85
86 clean:; rm -rf tags([[OUTPUTS]])
87
88 .PHONY: dvi
89
90 ##----- That's all, folks ---------------------------------------------------