# -*- makefile -*-
#
# This file is automatically generated by configure.
# Do not hand edit.

CC       = @CC@
AUDIODEFS = @AUDIODEFS@
CFLAGS   = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
DEFS     = @DEFS@
LIBS = @LIBS@

AUDIOLIBS   = @AUDIOLIBS@

FL_LANG  = @FL_LANG@
FL_VOX   = @FL_VOX@
FL_LEX   = @FL_LEX@

exec_prefix   = @exec_prefix@
prefix        = @prefix@
EXEEXT	      = @EXEEXT@
INSTALLBINDIR = @bindir@
INSTALLLIBDIR = @libdir@
INSTALLINCDIR = @includedir@/flite
flite_dir:=@flite_dir@
flite_include_dir:=@flite_include_dir@

#CFLAGS+= -DDEBUG=2

# For making releases
FLITE_LIBS:=-L$(flite_dir)/lib -lflite_$(subst cmu_us_kal16,cmu_us_kal,$(FL_VOX)) -lflite_$(FL_LEX) -lflite_$(FL_LANG) -lflite

eflite: fs.o es.o soccon.o sockopen.o tone.o
	$(CC) $(LDFLAGS) -o $@ $^ -lm $(LIBS) $(FLITE_LIBS) $(AUDIOLIBS)

fs.o: fs.c
	$(CC) $(CFLAGS) @AUDIODEFS@ -I. -I$(flite_include_dir) -DREGISTER_VOX=register_$(subst cmu_us_kal16,cmu_us_kal,$(FL_VOX)) -DSTANDALONE -DEFLITE -c -o $@ $<

tone.o: tone.c
	$(CC) $(CFLAGS) -I$(flite_include_dir) -DEFLITE -c -o $@ $<

DISTFILES=es.c fs.c soccon.c sockopen.c tone.c es.h language.h lookup.h synthesizer.h configure configure.in Makefile.in COPYING ChangeLog INSTALL AUTHORS CREDITS README eflite_test.txt
release:
	mkdir ../eflite-$(EFLITE_VERSION) && cp $(DISTFILES) ../eflite-$(EFLITE_VERSION) && tar --owner root --group root -C.. -czf eflite-$(EFLITE_VERSION).tar.gz $(addprefix eflite-$(EFLITE_VERSION)/,$(DISTFILES)) && rm -r ../eflite-$(EFLITE_VERSION)

DIRFILES:=$(filter-out $(DISTFILES),$(wildcard *))
pristine:
ifneq (,$(DIRFILES))
	rm $(DIRFILES)
endif

clean:
ifneq (,$(wildcard *.o))
	rm *.o
endif

install: eflite
	mkdir -p $(exec_prefix)/bin && install -c -m 0755 $< $(exec_prefix)/bin

test: eflite
	./eflite -f eflite_test.txt
