#########   Main Makefile for the sctk  #############


####  Creation Date:  Aug 26, 2004
MAKE=make
### Set the installation prefix directory to the default.  (If
### relative paths are used, the are relative to two directories below
### 'src'.)
PREFIX=`cd ../.. && pwd`

all install:
	(cd asclite && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd sclite && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd rfilter1 && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd csrfilt && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd chfilt && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd hamzaNorm && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd tanweenFilt && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd acomp && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd def_art && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd hubscr && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd utf_filt && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd rttmSort && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd rttm2ctm && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd rttmSmooth && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd spkr2sad && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd mergectm2rttm && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd align2html && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd md-eval && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd stm2rttm && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd stmValidator && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd rttmValidator && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd ctmValidator && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd slatreport && if test -f makefile ; then $(MAKE) $@ ; fi)

clean distclean:
	(cd asclite && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd sclite && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd rfilter1 && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd csrfilt && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd chfilt && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd hamzaNorm && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd tanweenFilt && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd acomp && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd def_art && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd hubscr && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd utf_filt && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd rttmSort && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd rttm2ctm && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd rttmSmooth && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd spkr2sad && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd mergectm2rttm && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd align2html && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd md-eval && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd stm2rttm && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd stmValidator && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd rttmValidator && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd ctmValidator && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd slatreport && if test -f makefile ; then $(MAKE) $@ ; fi)

config:
	(cd asclite && if test -f makefile ; then $(MAKE) $@ ; fi)
	(cd sclite && sh config.sh -prefix=${PREFIX})
	(cd rfilter1 && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd csrfilt && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd chfilt && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd hamzaNorm && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd tanweenFilt && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd acomp && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd def_art && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd hubscr && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd utf_filt; sh config.sh -prefix=${PREFIX})
	(cd rttmSort && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd rttmSmooth && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd rttm2ctm && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd spkr2sad && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd mergectm2rttm && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd align2html && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd md-eval && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd stm2rttm && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd stmValidator && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd rttmValidator && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd ctmValidator && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)
	(cd slatreport && sed -e "s:PREFIX=.*:PREFIX=${PREFIX}:" < makefile.in > makefile)

checkFast:
	(cd asclite && $(MAKE) check)
	(cd rfilter1 && $(MAKE) check)
	(cd csrfilt && $(MAKE) check)
	(cd chfilt && $(MAKE) check)
	(cd hamzaNorm && $(MAKE) check)
	(cd tanweenFilt && $(MAKE) check)
	(cd acomp && $(MAKE) check)
	(cd def_art && $(MAKE) check)
	(cd hubscr && $(MAKE) check)
	(cd utf_filt && $(MAKE) check)
	(cd rttmSort && $(MAKE) check)
	(cd rttm2ctm && $(MAKE) check)
	(cd mergectm2rttm && $(MAKE) check)
	(cd align2html && $(MAKE) check)
	(cd md-eval && $(MAKE) check)
	(cd stmValidator && $(MAKE) check)
	(cd rttmValidator && $(MAKE) check)
	(cd ctmValidator && $(MAKE) check)
	(cd slatreport && $(MAKE) check)

check: all checkFast
	(cd sclite && if test -f makefile ; then $(MAKE) $@ ; fi)
