# Copyright (c) 1991-2002 Doshita Lab. Speech Group, Kyoto University
# Copyright (c) 2000-2002 Speech and Acoustics Processing Lab., NAIST
# All rights reserved 

#
# $Id: Makefile.in,v 1.8 2002/11/08 08:50:08 ri Exp $
#
SHELL=/bin/sh
.SUFFIXES:
.SUFFIXES: .c .o
.c.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<

LIBSENT=../libsent
CC=@CC@
CFLAGS=@CFLAGS@
CPPFLAGS=-I. -I$(LIBSENT)/include @CPPFLAGS@ @X_CFLAGS@ @DEFS@ `$(LIBSENT)/libsent-config --cflags`
LDFLAGS=@LDFLAGS@ -L$(LIBSENT) -lsent @LIBS@ @X_LIBS@ @X_EXTRA_LIBS@ @X_PRE_LIBS@ @XLIB@ `$(LIBSENT)/libsent-config --libs` -lm 
AWK=@AWK@
RM=@RM@ -f
prefix=@prefix@
exec_prefix=@exec_prefix@
INSTALL=@INSTALL@

############################################################

TARGET = @EXECNAME@

OBJSENT = main.o m_usage.o m_options.o m_jconf.o m_chkparam.o m_info.o \
	  m_bootup.o m_adin.o m_fusion.o \
	  wchmm.o wchmm_check.o factoring_sub.o \
	  beam.o outprob_style.o realtime-1stpass.o backtrellis.o \
	  search_bestfirst_main.o search_bestfirst_v1.o search_bestfirst_v2.o \
	  ngram_decode.o dfa_decode.o word_align.o \
	  wav2mfcc.o hmm_check.o \
	  result_tty.o result_msock.o module.o multi-gram.o record.o

############################################################

all: $(TARGET)

$(TARGET): $(LIBSENT)/libsent.a $(OBJSENT) version.c
	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(OBJSENT) version.c $(LDFLAGS)

version.c: $(OBJSENT)
	$(SHELL) stamp_version.sh "$(CC)" "$(CFLAGS)" \
	"`${AWK} '/J:/{n=1;next}/\#define/{if(n==1){printf(\" %s\",$$2)}}{n=0}' config.h`"

############################################################

install: install.bin install.man

install.bin: $(TARGET)
	${INSTALL} -d @bindir@
	@INSTALL_PROGRAM@ $(TARGET) @bindir@

install.man:
	${INSTALL} -d @mandir@/man1
	@INSTALL_DATA@ $(TARGET).man @mandir@/man1/$(TARGET).1

install.man.ja:
	${INSTALL} -d @mandir@/man1
	@INSTALL_DATA@ $(TARGET).man.ja @mandir@/man1/$(TARGET).1

depend:
	makedepend -- $(CFLAGS) -- $(OBJSENT)

smallclean:
	$(RM) *.o version.c

clean:
	$(RM) *.o version.c *.bak *~ core TAGS
	$(RM) config.log config.cache

distclean:
	$(RM) *.o version.c *.bak *~ core TAGS
	$(RM) config.log config.cache
	$(RM) config.status config.h
	$(RM) $(TARGET)
	$(RM) Makefile testsuite/Makefile

############################################################
configure:
	autoconf
	$(RM) config.h.in
	autoheader
