#  Makefile from ObjectProDSP 0.1
#  Copyright (C) 1994, Mountain Math Software. All rights reserved.
#  
#  This file is part of ObjectProDSP, a tool for Digital Signal
#  Processing design, development and implementation. It is free
#  software provided you use and distribute it under the terms of
#  version 2 of the GNU General Public License as published
#  by the Free Software Foundation. You may NOT distribute it or
#  works derived from it or code that it generates under ANY
#  OTHER terms.  In particular NONE of the ObjectProDSP system is
#  licensed for use under the GNU General Public LIBRARY License.
#  Mountain Math Software plans to offer a commercial version of
#  ObjectProDSP for a fee. That version will allow redistribution
#  of generated code under standard commercial terms.
#  
#  This program 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 version 2 of the GNU General
#  Public License along with this program. See file COPYING. If not
#  or if you wish information on commercial versions and licensing
#  write Mountain Math Software, P. O. Box 2124, Saratoga, CA 95070,
#  USA, or send us e-mail at: support@mtnmath.com.
#  
#  You may also obtain the GNU General Public License by writing the
#  Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
#  USA.  However if you received a copy of this program without the
#  file COPYING or without a copyright notice attached to all text
#  files, libraries and executables please inform Mountain Math Software.
#  
#  ObjectProDSP is a trademark of Mountain Math Software.
#  
include ${OPD_ROOT}/doc/mac/makefile_def
#See above file for a general explanation of how this Makefile works

DEFAULT : check_index

OPD_DEV_NOT_CREATED=devdoc.tex devman.tex devmenu.tex devnodes.tex \
	devmake.tex index.tex validate.tex
OPD_NOT_CREATED=${OPD_DEV_NOT_CREATED}

devman.dvi : ${OPD_DOC_COM_DEP} blockusr.tex devdoc.tex ${OPD_DEV_NOT_CREATED} \
  devman.txx ctortab.tex artyp.tex \
  mmenu.tex exampmenu.tex sighlp.tex sigtex.tex makemakeopt.tex
	${OPD_LATEX} $@
	make check_index

blockusr.tex : ${OPD_ROOT}/src/dsp/nodes/proc/block.usr
	@echo "\\begin{figure}" > $@
	@echo "\\begin{verbatim}" >> $@
	@${OPD_ROOT}/bin/cp_part \
		"// start first part of block.usr (this line is used in creating manuals)" \
		"// end first part of block.usr (this line is used in creating manuals)" \
		< $< | sed -e "/	/s//    /g"  >> $@
	@echo "\\end{verbatim}" >> $@
	@echo "\\caption{\\protect\\IntPp{} example program (part 1 of 3)}" >> $@
	@echo "\\label{Fig:blockusr}" >> $@
	@echo "\\end{figure}" >> $@
	@echo "\\begin{figure}" >> $@
	@echo "\\begin{verbatim}" >> $@
	@${OPD_ROOT}/bin/cp_part \
		"// end first part of block.usr (this line is used in creating manuals)" \
		"// end second part of block.usr (this line is used in creating manuals)" \
		< $< | sed -e "/	/s//    /g"  >> $@
	@echo "\\end{verbatim}" >> $@
	@echo "\\caption{\\protect\\IntPp{} example program (part 2 of 3)}" >> $@
	@echo "\\end{figure}" >> $@
	@echo "\\begin{figure}" >> $@
	@echo "\\begin{verbatim}" >> $@
	@${OPD_ROOT}/bin/cp_part \
		"// end second part of block.usr (this line is used in creating manuals)" \
		"// end last part of block.usr (this line is used in creating manuals)" \
		< $< | sed -e "/	/s//    /g"  >> $@
	@echo "\\end{verbatim}" >> $@
	@echo "\\caption{\\protect\\IntPp{} example program (part 3 of 3)}" >> $@
	@echo "\\end{figure}" >> $@

ctortab.tex : ${OPD_ROOT}/bin/mknode
	${OPD_ROOT}/doc/scripts/make_from_exe.sh "$< -D" $@

makemakeopt.tex : ${OPD_ROOT}/bin/makemake
	${OPD_ROOT}/doc/scripts/make_from_exe.sh "$< -tex " $@
	if [ -e ottok_mac_def ] ;then \
		cat $@ >> ottok_mac_def ; mv ottok_mac_def $@ ;fi

artyp.tex : ${OPD_ROOT}/src/include/ObjProDSP/arthtyp.h
	@echo "\\begin{verbatim}" > $@
	@${OPD_ROOT}/bin/cp_part \
		"// start ArithType definition (this line used in generating manual)" \
		"// stop ArithType definition (this line used in generating manual)" \
		< $< | sed -e "/	/s//    /g"  >> $@
	@echo "\\end{verbatim}" >> $@


sigtex.tex : ${OPD_ROOT}/doc/nodetex/ssignalT.tex
	@echo "\\begin{verbatim}" > $@
	@cat $< >> $@
	@echo "\\end{verbatim}" >> $@

sighlp.tex : ${OPD_ROOT}/doc/roff/ssignalT.roff
	@echo "\\begin{verbatim}" > $@
	@cat $< >> $@
	@echo "\\end{verbatim}" >> $@

exampmenu.tex : ${OPD_ROOT}/src/menus/opd.menu
	@echo "\\begin{verbatim}" > $@
	@${OPD_ROOT}/bin/cp_part \
		"// start of examples menu (this line used in generating manual)" \
		"// end of examples menu (this line used in generating manual)" \
		< $< | sed -e "/	/s//    /g"  >> $@
	@echo "\\end{verbatim}" >> $@

mmenu.tex : ${OPD_ROOT}/src/menus/opd.menu
	@echo "\\begin{verbatim}" > $@
	@${OPD_ROOT}/bin/cp_part \
		"// start of main menu (this line used in generating manual)" \
		"// end of main menu (this line used in generating manual)" \
		< $< | sed -e "/	/s//    /g"  >> $@
	@echo "\\end{verbatim}" >> $@

${OPD_ROOT}/bin/mknode :
	@echo "Warning \`${OPD_ROOT}/bin/mknode' not installed."

check_index :
	${OPD_CHECK_INDEX} devman
	make devman.dvi

PS : devman.ps

devman.ps : devman.dvi
	dvips -f $< > $@

DIST_LIST:
	@echo "Makefile ${OPD_DEV_NOT_CREATED}" > DIST_LIST

.PHONY: clean check_index DEFAULT DIST_LIST PS SPELL

clean:
	-rm -f *.dvi *.ps *.aux *.idx *.toc *.txx *.lof *.lot *.log *.slog  \
	dppenv.tex exampmn.tex

include ${OPD_ROOT}/doc/mac/makefile_suf

