New build system.
[doc/ips] / Makefile.m4
CommitLineData
384bd7f2 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
33AUTOMAKE_OPTIONS = foreign
34
35SRC = \
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
41changequote([[, ]])
42
43define([[OUTPUTS]], [[dnl
44_([[notes]], [[\ipsslidesfalse\ipsanswerstrue]])dnl
45_([[noans]], [[\ipsslidesfalse\ipsanswersfalse]])dnl
46_([[slides]], [[\ipsslidestrue]])dnl
47]])
48define([[adorn]], [[define([[_]], [[$2$]][[1$3 ]])$1]])
49define([[tags]], [[adorn([[$1]])]])
50define([[addsuffix]], [[adorn([[$1]], [[ips-]], [[$2]])]])
51
52DVIGZ = addsuffix([[OUTPUTS]], [[.dvi.gz]])
53PSGZ = addsuffix([[OUTPUTS]], [[.ps.gz]])
54PDF = addsuffix([[OUTPUTS]], [[.pdf]])
55
56noinst_DATA = $(DVIGZ) $(PSGZ) $(PDF)
57
58define([[_]], [[dnl
59ips-$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
68ips-$1.pdf: ips-$1.dvi
69 cd $1 && pdflatex ips && cp ips.pdf ../ips-$1.pdf
70ips-$1.dvi.gz: ips-$1.dvi
71 gzip -9cv ips-$1.dvi >ips-$1.dvi.gz
72ips-$1.ps: ips-$1.dvi
73 dvips -o ips-$1.ps ips-$1.dvi
74ips-$1.ps.gz: ips-$1.ps
75 gzip -9cv ips-$1.ps >ips-$1.ps.gz
76]])
77OUTPUTS
78
79CLEANFILES = *.dvi *.ps $(DVIGZ) $(PSGZ) $(PDF)
80
81Makefile.am: Makefile.m4
82 cd $(srcdir) && m4 Makefile.m4 >Makefile.am
83
84EXTRA_DIST = $(SRC) Makefile.m4
85
86clean:; rm -rf tags([[OUTPUTS]])
87
88.PHONY: dvi
89
90##----- That's all, folks ---------------------------------------------------