#  Makefile_head from ObjectProDSP 0.1
#  Copyright (C) 1994, Mountain Math Software, All rights reserved.
#  Licensed for free use and distribution under version 2 of the Gnu General
#  Public License. Please see file COPYING for details and restrictions.
#  
#  ObjectProDSP is a trademark of Mountain Math Software.
#  
NOD_MENU := $(wildcard ${OPD_ROOT}/src/menus/nodes/*.nod)

MENU_DEP = ${MENU_DIR}/ALL.tex_nod.men \
  ${MENU_DIR}/ALL.tex_nod.cls \
  ${MENU_DIR}/ALL.tex_nod.cmd 

DEFAULT : check_index

OPD_USER_NOT_CREATED=usrintr.tex menu.tex enviorn.tex command.tex \
	usermnx.tex mnroffmn.tex userman.tex dpplang.tex examples.tex

OPD_NOT_CREATED=${OPD_USER_NOT_CREATED}

userman.dvi : ${OPD_DOC_COM_DEP} ${OPD_USER_NOT_CREATED} exampmn.tex \
  ${MENU_DEP} ${EXAMP_DEP} ${HELP_DEP} \
  dppenv.tex ${MAC_DIR}/bibli.tex userman.txx 
	OPD_PATCH_TOC=${OPD_ROOT}/doc/scripts/toc_depth_scr.sh ; export OPD_PATCH_TOC ; \
	${OPD_LATEX} $@
	make check_index

${MENU_DEP} : ${OPD_ROOT}/src/menus/opd.menu ${NOD_MENU}
	cd ../build ; make ${MENU_DEP}


check_index :
	${OPD_CHECK_INDEX} userman
	make userman.dvi

exampmn.tex : ${EXAMP_DEP}
	sh ${DOC_DIR}/scripts/make_tex_input_list.sh "${EXAMP_DEP}" > $@

dppenv.tex : ${OPD_ROOT}/bin/opd
	${OPD_ROOT}/doc/scripts/make_from_exe.sh "${OPD_ROOT}/bin/opd  -e" $@ \
		 '\begin{verbatim}' '\end{verbatim}'

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

PS : userman.ps

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

DIST_LIST:
	@echo "Makefile_head domakemake ${OPD_USER_NOT_CREATED}" > DIST_LIST

Makefile : ${OPD_COM_MAKEFILE_DEP} 
	sh domakemake

.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

