#
# ***************************************************************
#     Remember to source opt-build-env first, if you are building 
#  any sub-set of these files outside of toplevel build procedure 
# ***************************************************************
#
TOPLEVELDIR = ../..
OPTSERVERBIN= optbin
SCRIPTDIR = ${TOPLEVELDIR}/${OPTSERVERBIN}

TODO =  ${SCRIPTDIR}/build-opt-env    \
	${SCRIPTDIR}/build-opt-env.pl \
	${SCRIPTDIR}/get2andjoin \
	${SCRIPTDIR}/getobj2 \
	${SCRIPTDIR}/getfile1vars.pl \
	${SCRIPTDIR}/join-form   \
	${SCRIPTDIR}/mathopt     \
	${SCRIPTDIR}/selopt3

all:${TODO}

${SCRIPTDIR}/build-opt-env: build-opt-env.tmp
	sed "s*jgofsdir*${JGOFSDIR}*g;\
		s*optionbin*${OPTSERVERBIN}*g;\
		s*myaddr*${MYADDR}*g;\
		s*portaddr*${PORT}*g;\
		s*temporaryfiledir*${TEMPDIR}*g" < build-opt-env.tmp >$@
	chmod +x $@;

${SCRIPTDIR}/build-opt-env.pl: build-opt-env.pl.tmp
	sed "s*perllocation*${PERL}*g;\
		s*jgofsdir*${JGOFSDIR}*g;\
		s*scriptloc*${OPTSERVERBIN}*g;\
		s*myaddr*${MYADDR}*g;\
		s*portaddr*${PORT}*g;\
		s*temporaryfiledir*${TEMPDIR}*g" < build-opt-env.pl.tmp >$@
	chmod +x $@;

${SCRIPTDIR}/get2andjoin:get2andjoin.tmp
	sed "s*perllocation*${PERL}*g" < get2andjoin.tmp >$@
	chmod +x $@;

${SCRIPTDIR}/getobj2:getobj2.tmp
	sed "s*perllocation*${PERL}*g" < getobj2.tmp >$@
	chmod +x $@;

${SCRIPTDIR}/getfile1vars.pl:getfile1vars.pl.tmp
	sed "s*perllocation*${PERL}*g" < getfile1vars.pl.tmp >$@
	chmod +x $@;

${SCRIPTDIR}/join-form:join-form.tmp
	sed "s*perllocation*${PERL}*g" < join-form.tmp >$@
	chmod +x $@;

${SCRIPTDIR}/mathopt:mathopt.tmp
	sed "s*perllocation*${PERL}*g" < mathopt.tmp >$@
	chmod +x $@;

${SCRIPTDIR}/selopt3:selopt3.tmp
	sed "s*perllocation*${PERL}*g" < selopt3.tmp >$@
	chmod +x $@;

####################	
clean:
	-rm ${TODO}
