#  Makefile from ObjectProDSP 0.2
#  Copyright (C) 1994 1995, 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.
#  
include ${OPD_ROOT}/scripts/Makefile_head
EXE= ${OPD_ROOT}/bin/hyphen ${OPD_ROOT}/bin/toc_depth  \
	${OPD_ROOT}/bin/cp_part ${OPD_ROOT}/bin/remove_orig \
	${OPD_ROOT}/bin/to_low_arg ${OPD_ROOT}/bin/nametrans \
	${OPD_ROOT}/bin/cmp_val_log  ${OPD_ROOT}/bin/gen_data \
	${OPD_ROOT}/bin/gen_dpp_code ${OPD_ROOT}/bin/report_test \
	${OPD_ROOT}/bin/compare_byte

LIB_1=${OPD_ROOT}/lib/Libopdcom${OPD_LIB_SUF}
LIB_2=${OPD_ROOT}/lib/Libopdnogui${OPD_LIB_SUF}
LIB_3=${OPD_ROOT}/lib/Libopdgen${OPD_LIB_SUF}
LIB=${LIB_1} ${LIB_2} ${LIB_3}

ALL: ${EXE}

INC_DIR_1=${OPD_ROOT}/src/include
INC_DIR_2=${OPD_ROOT}/src/include/ObjProNoGui
INC_DIR_VC=${OPD_ROOT}/src/include/nt_vc

INC= -I${INC_DIR_1} -I${INC_DIR_2} -I${INC_DIR_VC}

#FLAGS= ${INC} -DWIN32 -D__NT_VC__
FLAGS= ${INC} -g

${OPD_ROOT}/bin/hyphen : hyphen.cxx
	${OPD_CC} -c -g ${FLAGS} $<
	${OPD_CC} hyphen.o -o $@

${OPD_ROOT}/bin/toc_depth : toc_depth.cxx
	${OPD_CC} -c -g ${FLAGS} $<
	${OPD_CC} toc_depth.o -o $@

${OPD_ROOT}/bin/cp_part: cp_part.cxx
	${OPD_CC} -c -g ${FLAGS} $<
	${OPD_CC} cp_part.o ${LIB} -o $@

${OPD_ROOT}/bin/remove_orig: remove_orig.cxx
	${OPD_CC} -c -g ${FLAGS} $<
	${OPD_CC} remove_orig.o ${LIB} -o $@

${OPD_ROOT}/bin/to_low_arg: to_low_arg.cxx
	${OPD_CC} -c -g ${FLAGS} $<
	${OPD_CC} to_low_arg.o ${LIB} -o $@


${OPD_ROOT}/bin/gen_data: gen_data.cxx gen_datx.cxx gen_data.h ${LIB}
	${OPD_CC} -c -g ${FLAGS} gen_data.cxx
	${OPD_CC} -c -g ${FLAGS} gen_datx.cxx
	${OPD_CC} gen_data.o gen_datx.o ${LIB} -o $@

${OPD_ROOT}/bin/cmp_val_log: cmp_val_log.cxx ${LIB}
	${OPD_CC} -c -g ${FLAGS} $<
	${OPD_CC} cmp_val_log.o ${LIB} -o $@

${OPD_ROOT}/bin/compare_byte: compare_byte.cxx ${LIB}
	${OPD_CC} -c -g ${FLAGS} $<
	${OPD_CC} compare_byte.o ${LIB} -o $@

${OPD_ROOT}/bin/report_test: report_test.cxx ${LIB}
	${OPD_CC} -c -g ${FLAGS} $<
	${OPD_CC} report_test.o ${LIB} -o $@

${OPD_ROOT}/bin/nametrans: nametrans.cxx
	${OPD_CC} -c -g ${FLAGS} $<
	${OPD_CC} nametrans.o -o $@

${OPD_ROOT}/bin/gen_dpp_code: gen_dpp_code.cxx ${LIB_1}
	${OPD_CC} -c -g ${FLAGS} $<
	${OPD_CC} gen_dpp_code.o ${LIB_1} -o $@

${LIB_1}:
	cd ${OPD_ROOT}/src/genlib/nogui/obj ; ${OPD_MAKE}

${LIB_2}:
	cd ${OPD_ROOT}/src/genlib/common/obj ; ${OPD_MAKE}

${EXE}: ${INC_DIR_1}/ObjProGen/mkstr.h ${INC_DIR_1}/ObjProDSP/portable.h \
	${INC_DIR_1}/ObjProGen/cpyrght_exe.h ${INC_DIR_1}/ObjProGen/environ.h \
	${INC_DIR_1}/ObjProGen/makedir.h ${INC_DIR_2}/ObjProComGui/cgidbg.h  \
	${INC_DIR_1}/ObjProGen/copyright.h ${INC_DIR_1}/ObjProDSP/mpacket.h \
	${INC_DIR_1}/ObjProDSP/pltenm.h
