#
# Makefile for octave's doc/refcard directory
#
# John W. Eaton
# jwe@bevo.che.wisc.edu
# University of Wisconsin-Madison
# Department of Chemical Engineering

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-legal.dvi refcard-legal.ps \
	refcard-letter.dvi refcard-letter.ps

DISTFILES := Makefile.in $(TEX) $(FORMATTED)

all: $(FORMATTED)

refcard-a4.dvi: refcard-a4.tex refcard.tex
	-TEXINPUTS="$(srcdir):$(TEXINPUTS):" ; export TEXINPUTS ; \
	  tex $(srcdir)/refcard-a4.tex

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

refcard-legal.dvi: refcard-legal.tex refcard.tex
	-TEXINPUTS="$(srcdir):$(TEXINPUTS):" ; export TEXINPUTS ; \
	  tex $(srcdir)/refcard-legal.tex

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

refcard-letter.dvi: refcard-letter.tex refcard.tex
	-TEXINPUTS="$(srcdir):$(TEXINPUTS):" ; export TEXINPUTS ; \
	  tex $(srcdir)/refcard-letter.tex

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

check install uninstall mostlyclean clean:
.PHONY: check install uninstall mostlyclean clean

tags: $(SOURCES)
	ctags $(SOURCES)

TAGS: $(SOURCES)
	etags $(SOURCES)

distclean: clean
	rm -f Makefile
.PHONY: distclean

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

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

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

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