# # 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. PACKAGE = ragel prefix = @prefix@ datarootdir = @datarootdir@ docdir = @docdir@ mandir = @mandir@ MANPAGES = ragel.1 # Rules. all: ragel-guide.pdf $(MANPAGES) 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)}' | tr '|' '\\' > version.tex echo '|def|pubdate{$(PUBDATE)}' | tr '|' '\\' >> version.tex %.1: %.1.in ../version.mk cat $< | sed 's/@PUBDATE@/$(PUBDATE)/' \ | sed 's/@VERSION@/$(VERSION)/' > $@ clean: rm -f $(MANPAGES) *.bak *.aux *.dvi *.log *.toc *.pdf distclean: clean rm -f Makefile man: $(MANPAGES) man-install: man install -d $(DESTDIR)$(mandir)/man1 install -m 644 ragel.1 $(DESTDIR)$(mandir)/man1/ragel.1 install -m 644 rlgen-dot.1 $(DESTDIR)$(mandir)/man1/rlgen-dot.1 install -m 644 rlgen-cd.1 $(DESTDIR)$(mandir)/man1/rlgen-cd.1 install -m 644 rlgen-java.1 $(DESTDIR)$(mandir)/man1/rlgen-java.1 install -m 644 rlgen-ruby.1 $(DESTDIR)$(mandir)/man1/rlgen-ruby.1 install: all man-install install -d $(DESTDIR)$(docdir) install -m 644 ragel-guide.pdf $(DESTDIR)$(docdir)/ragel-guide.pdf gzip -c ../ChangeLog > ChangeLog.gz install -m 644 ChangeLog.gz $(DESTDIR)$(docdir)/ChangeLog.gz rm ChangeLog.gz