# Copyright (c) 1991-2016 Kawahara Lab., Kyoto University
# Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
# Copyright (c) 2005-2016 Julius project team, Nagoya Institute of Technology
# All rights reserved
#
# Makefile.in --- Makefile Template for configure
#
SHELL=/bin/sh

PRIMARY_LIBS=libsent libjulius
APPS=julius mkbingram mkbinhmm adinrec adintool mkgshmm mkss jcontrol gramtools generate-ngram jclient-perl binlm2arpa
SUBDIRS=$(PRIMARY_LIBS) $(APPS) 

CONFIG_SUBDIRS=mkgshmm gramtools jcontrol mkbingram julius libjulius libsent

RM=@RM@ -f
prefix=@prefix@
exec_prefix=@exec_prefix@
INSTALL=@INSTALL@

.PHONY: all install install.bin clean distclean configure doxygen

all install install.bin clean distclean: $(SUBDIRS)

$(APPS): $(PRIMARY_LIBS)

all: TARGET=all

install: TARGET=install

install.bin: TARGET=install.bin

clean: TARGET=clean
clean:
	$(RM) config.log config.cache

distclean: TARGET=distclean
distclean:
	$(RM) config.log config.cache
	$(RM) config.status
	$(RM) Makefile

configure:
	for d in $(CONFIG_SUBDIRS); do \
	  (cd $$d; autoconf); \
	done

doxygen:
	mkdir -p doxygen/en
	mkdir -p doxygen/ja
	cat support/doxygen.conf.en libjulius/doxygen.conf.ver > doxygen/doxygen.conf.en
	cat support/doxygen.conf.ja libjulius/doxygen.conf.ver > doxygen/doxygen.conf.ja
	doxygen doxygen/doxygen.conf.en > doxygen/doxygen-en.log 2> doxygen/doxygen-en-err.log
	doxygen doxygen/doxygen.conf.ja > doxygen/doxygen-ja.log 2> doxygen/doxygen-ja-err.log

$(SUBDIRS): force
	@ test -f $@/Makefile && $(MAKE) -C $@ $(TARGET)

.PHONY: force

force :;
