#
# Makefile for octave's doc/faq 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@

SOURCES =

TEXINFO := Octave-FAQ.texi

FORMATTED := Octave-FAQ.info Octave-FAQ.dvi Octave-FAQ.ps

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

BINDISTFILES =

SPELL := $(patsubst %.texi, %.spell, $(ALL_TEXINFO))

%.spell : %.texi
	rm -f $@
	sed -e 's/@@/ at /g' -e 's/@[a-zA-Z]*//g' $< | spell > $@.tmp
	mv $@.tmp $@

all: Octave-FAQ.info Octave-FAQ.dvi Octave-FAQ.ps
.PHONY: all

Octave-FAQ.info: Octave-FAQ.texi
	-makeinfo -I$(srcdir) $(srcdir)/Octave-FAQ.texi

Octave-FAQ.dvi: Octave-FAQ.texi
	-TEXINPUTS="$(srcdir):$(srcdir)/..:$(TEXINPUTS):" ; \
	  export TEXINPUTS ; \
	  $(TEXI2DVI) $(srcdir)/Octave-FAQ.texi

Octave-FAQ.ps: Octave-FAQ.dvi
	-dvips -o Octave-FAQ.ps Octave-FAQ.dvi

check install uninstall:
.PHONY: check install uninstall

tags: $(SOURCES)
	ctags $(SOURCES)

TAGS: $(SOURCES)
	etags $(SOURCES)

spell: $(SPELL)
.PHONY: spell

mostlyclean clean:
	rm -f Octave-FAQ.cp Octave-FAQ.fn Octave-FAQ.ky Octave-FAQ.pg \
	Octave-FAQ.tp Octave-FAQ.vr Octave-FAQ.cps Octave-FAQ.fns \
	Octave-FAQ.kys Octave-FAQ.pgs Octave-FAQ.tps Octave-FAQ.vrs \
	Octave-FAQ.aux	Octave-FAQ.log Octave-FAQ.toc
.PHONY: mostlyclean clean

distclean: clean
	rm -f Makefile
.PHONY: distclean

maintainer-clean: distclean
	rm -f tags TAGS Octave-FAQ.info Octave-FAQ.info-*
	rm -f Octave-FAQ.dvi Octave-FAQ.ps
.PHONY: maintainer-clean

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

bin-dist:
	if [ -n "$(BINDISTFILES)" ]; then \
	  ln $(BINDISTFILES) ../../`cat ../../.fname`/doc/faq ; \
	fi
.PHONY: bin-dist
