#
# 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 Octave-FAQ_toc.html

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 Octave-FAQ_toc.html
.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

# These option forms are supported by texi2html 1.65 and probably also
# more recent versions.
Octave-FAQ_toc.html:
	-texi2html -expandinfo -split_chapter $(srcdir)/Octave-FAQ.texi

check install install-strip uninstall:
.PHONY: check install install-strip 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
	rm -f Octave-FAQ_*.html
.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
