# # Copyright 2001-2007 Adrian Thurston # # This file is part of Ragel. # # Ragel 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. # # Ragel 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 Ragel; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA INPUT = version.tex ragel-guide.tex # Pick up all the figures in the current dir. FIGURES = $(wildcard *.fig) PDFFIGS = $(FIGURES:%.fig=%.pdf) # Get the version info. include ../version.mk # Installation locations. prefix = @prefix@ docdir = @datadir@/doc/ragel mandir = @mandir@ # Rules. all: ragel-guide.pdf ragel.1 rlgen-cd.1 rlgen-java.1 rlgen-ruby.1 rlgen-dot.1 ragel-guide.pdf: $(PDFFIGS) $(INPUT) %.pdf: %.fig fig2dev -L pdf $< $@ %.pdf: %.tex pdflatex -interaction=nonstopmode $< >/dev/null pdflatex -interaction=nonstopmode $< >/dev/null pdflatex -interaction=nonstopmode $< >/dev/null version.tex: ../version.mk echo '\def\version{$(VERSION)}' > version.tex echo '\def\pubdate{$(PUBDATE)}' >> version.tex %.1: %.1.in ../version.mk cat $< | sed 's/@PUBDATE@/$(PUBDATE)/' \ | sed 's/@VERSION@/$(VERSION)/' > $@ #rlcodegen.1: rlcodegen.1.in ../version.mk # cat rlcodegen.1.in | sed 's/@PUBDATE@/$(PUBDATE)/' \ # | sed 's/@VERSION@/$(VERSION)/' > rlcodegen.1 clean: rm -f ragel.1 rlcodegen.1 \ *.bak *.aux *.dvi *.log *.toc *.pdf distclean: clean rm -f Makefile install: all install -d $(mandir)/man1 install -m 644 ragel.1 $(mandir)/man1/ragel.1 install -m 644 rlgen-dot.1 $(mandir)/man1/rlgen-dot.1 install -m 644 rlgen-cd.1 $(mandir)/man1/rlgen-cd.1 install -m 644 rlgen-java.1 $(mandir)/man1/rlgen-java.1 install -m 644 rlgen-ruby.1 $(mandir)/man1/rlgen-ruby.1 install -d $(docdir) install -m 644 ragel-guide.pdf $(docdir)/ragel-guide.pdf gzip -c ../ChangeLog > ChangeLog.gz install -m 644 ChangeLog.gz $(docdir)/ChangeLog.gz rm ChangeLog.gz