#$Id: Makefile 3963 2006-05-31 15:42:51Z raman $
#
# Jan 2007 Gilles Casse gcasse@oralux.org>
# * eSpeak driver for emacspeak
#
DESTDIR=
PREFIX=/usr
LIBDIR=$(PREFIX)/lib
INCDIR=$(PREFIX)/include

CC=g++
INSTALL = install
libparentdir = ${PREFIX}/share/emacs/site-lisp
libdir2 =$(libparentdir)/emacspeak/servers/linux-espeak
CFLAGS= -O2 -I/usr/include/espeak -fPIC  -DPIC -pedantic -ansi -Wall
LIBS= -ltcl -lespeak

TTS=libtclespeak.so
all: libtclespeak.so

tclespeak.lo: tclespeak.cpp
	libtool --mode=compile $(CC) $(CFLAGS) -c $<

libtclespeak.so: tclespeak.lo 
	libtool --mode=link $(CC) $(CFLAGS) -g -o $@ tclespeak.lo $(LIBS)  -shared

clean:
	rm -f *.so *.o *.lo libtclespeak.so
	rm -rf .libs

install:  tclespeak.so
	if test ! -d $(libdir2) ; then mkdir $(libdir2); fi ; \
	chmod 755 $(libdir2); \
	$(INSTALL) -m 0644 $(TTS) $(libdir2)

