# Makefile for octave's doc/refcard directory
#
# Copyright (C) 1996, 1997, 2003, 2004, 2005, 2007 John W. Eaton
#
# This file is part of Octave.
# 
# Octave 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 3 of the License, or (at
# your option) any later version.
# 
# Octave 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 Octave; see the file COPYING.  If not, see
# <http://www.gnu.org/licenses/>.

TOPDIR = ../..

srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@

include $(TOPDIR)/Makeconf

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@

TEX := refcard.tex refcard-a4.tex refcard-legal.tex refcard-letter.tex 

FORMATTED := refcard-a4.dvi refcard-a4.ps refcard-a4.pdf \
	refcard-legal.dvi refcard-legal.ps refcard-legal.pdf \
	refcard-letter.dvi refcard-letter.ps refcard-letter.pdf

DISTFILES := $(addprefix $(srcdir)/, Makefile.in $(TEX)) $(FORMATTED)

all: $(FORMATTED)

refcard-a4.dvi: refcard-a4.tex refcard.tex
	-TEXINPUTS="$(srcdir):$(TEXINPUTS):" tex $<

refcard-a4.ps: refcard-a4.dvi
	-dvips -T 297mm,210mm -o $@ $<

refcard-a4.pdf: refcard-a4.tex refcard.tex
	-TEXINPUTS="$(srcdir):$(TEXINPUTS):" pdftex $<

refcard-legal.dvi: refcard-legal.tex refcard.tex
	-TEXINPUTS="$(srcdir):$(TEXINPUTS):" tex $<

refcard-legal.ps: refcard-legal.dvi
	-dvips -T 14in,8.5in -o $@ $<

refcard-legal.pdf: refcard-legal.tex refcard.tex
	-TEXINPUTS="$(srcdir):$(TEXINPUTS):" pdftex $<

refcard-letter.dvi: refcard-letter.tex refcard.tex
	-TEXINPUTS="$(srcdir):$(TEXINPUTS):" tex $<

refcard-letter.ps: refcard-letter.dvi
	-dvips -T 11in,8.5in -o $@ $<

refcard-letter.pdf: refcard-letter.tex refcard.tex
	-TEXINPUTS="$(srcdir):$(TEXINPUTS):" pdftex $<

check install install-strip uninstall:
.PHONY: check install install-strip uninstall

tags: $(SOURCES)
	ctags $(SOURCES)

TAGS: $(SOURCES)
	etags $(SOURCES)

mostlyclean clean:
	rm -f refcard-*.log
.PHONY: mostlyclean clean

distclean: clean
	rm -f Makefile
.PHONY: distclean

maintainer-clean: distclean
	rm -f tags TAGS	refcard-*.dvi refcard-*.ps refcard-*.pdf
.PHONY: maintainer-clean

dist: all
	ln $(DISTFILES) ../../`cat ../../.fname`/doc/refcard
.PHONY: dist
