New build system.
[doc/ips] / Makefile.m4
diff --git a/Makefile.m4 b/Makefile.m4
new file mode 100644 (file)
index 0000000..e8e1df7
--- /dev/null
@@ -0,0 +1,90 @@
+## -*-fundamental-*-
+##
+## $Id: Makefile.m4,v 1.1 2002/02/24 15:43:20 mdw Exp $
+##
+## Makefile for IPS
+##
+## (c) 2002 Mark Wooding
+##
+
+##----- Licensing notice ----------------------------------------------------
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+## 
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+## 
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software Foundation,
+## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+##----- Revision history ----------------------------------------------------
+##
+## $Log: Makefile.m4,v $
+## Revision 1.1  2002/02/24 15:43:20  mdw
+## New build system.
+##
+
+AUTOMAKE_OPTIONS = foreign
+
+SRC = \
+        ips.tex ips.cls \
+        basics.tex \
+        auth-mac.tex auth-sig.tex \
+        enc-intro.tex enc-pub.tex enc-symm.tex enc-ies.tex
+
+changequote([[, ]])
+
+define([[OUTPUTS]], [[dnl
+_([[notes]], [[\ipsslidesfalse\ipsanswerstrue]])dnl
+_([[noans]], [[\ipsslidesfalse\ipsanswersfalse]])dnl
+_([[slides]], [[\ipsslidestrue]])dnl
+]])
+define([[adorn]], [[define([[_]], [[$2$]][[1$3 ]])$1]])
+define([[tags]], [[adorn([[$1]])]])
+define([[addsuffix]], [[adorn([[$1]], [[ips-]], [[$2]])]])
+
+DVIGZ = addsuffix([[OUTPUTS]], [[.dvi.gz]])
+PSGZ = addsuffix([[OUTPUTS]], [[.ps.gz]])
+PDF = addsuffix([[OUTPUTS]], [[.pdf]])
+
+noinst_DATA = $(DVIGZ) $(PSGZ) $(PDF)
+
+define([[_]], [[dnl
+ips-$1.dvi: $(SRC)
+       @if [ ! -d $1 ]; then \
+         mkdir $1; \
+         for i in $(SRC); do ln -s ../$$i $1; done; \
+         echo '$2' >$1/ips.cfg; \
+       fi
+       cd $1 && \
+       latex ips && bibtex ips && latex ips && latex ips && \
+       cp ips.dvi ../ips-$1.dvi
+ips-$1.pdf: ips-$1.dvi
+       cd $1 && pdflatex ips && cp ips.pdf ../ips-$1.pdf
+ips-$1.dvi.gz: ips-$1.dvi
+       gzip -9cv ips-$1.dvi >ips-$1.dvi.gz
+ips-$1.ps: ips-$1.dvi
+       dvips -o ips-$1.ps ips-$1.dvi
+ips-$1.ps.gz: ips-$1.ps
+       gzip -9cv ips-$1.ps >ips-$1.ps.gz
+]])
+OUTPUTS
+
+CLEANFILES = *.dvi *.ps $(DVIGZ) $(PSGZ) $(PDF)
+
+Makefile.am: Makefile.m4
+       cd $(srcdir) && m4 Makefile.m4 >Makefile.am
+
+EXTRA_DIST = $(SRC) Makefile.m4
+
+clean:; rm -rf tags([[OUTPUTS]])
+
+.PHONY: dvi
+
+##----- That's all, folks ---------------------------------------------------