PageRenderTime 31ms CodeModel.GetById 15ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 0ms

/native/external/espeak/src/Makefile

http://eyes-free.googlecode.com/
Makefile | 127 lines | 89 code | 27 blank | 11 comment | 0 complexity | 2c07e863f77ebd66f4e705e25f36fbad MD5 | raw file
  1# remove -fno-exceptions  if it causes problems with stdio library on some platforms (ARM)
  2
  3PREFIX=/usr
  4BINDIR=$(PREFIX)/bin
  5INCDIR=$(PREFIX)/include/espeak
  6LIBDIR=$(PREFIX)/lib
  7DATADIR=$(PREFIX)/share/espeak-data
  8
  9RELEASE = 1.39
 10BIN_NAME = speak
 11BIN2_NAME = espeak
 12LIB_NAME = libespeak.so
 13STATIC_LIB_NAME = libespeak.a
 14LIB_VERSION = 1
 15LIBTAG = $(LIB_VERSION).$(RELEASE)
 16
 17# Use SONAME_OPT=-Wl,h, on Solaris
 18SONAME_OPT=-Wl,-soname,
 19
 20# Use EXTRA_LIBS=-lm on Solaris
 21EXTRA_LIBS =
 22
 23INSTALL = install
 24LN_SF = /bin/ln -sf
 25MKDIR = mkdir -p
 26
 27AUDIO = portaudio
 28#AUDIO = pulseaudio
 29#AUDIO = sada
 30
 31ifeq ($(AUDIO),pulseaudio)
 32WAVE=wave_pulse.cpp
 33LIB_AUDIO=-lpulse
 34USE_AUDIO=-DUSE_PULSEAUDIO
 35else
 36ifeq ($(AUDIO),portaudio)
 37WAVE=wave.cpp
 38LIB_AUDIO=-lportaudio
 39USE_AUDIO=-DUSE_PORTAUDIO
 40else
 41ifeq ($(AUDIO),sada)
 42WAVE=wave_sada.cpp
 43USE_AUDIO=-DUSE_SADA
 44else
 45WAVE=wave.cpp
 46endif
 47endif
 48endif
 49
 50speak_SOURCES = speak.cpp compiledict.cpp dictionary.cpp intonation.cpp \
 51	readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \
 52	synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \
 53	tr_languages.cpp voices.cpp wavegen.cpp phonemelist.cpp
 54
 55libespeak_SOURCES = speak_lib.cpp compiledict.cpp dictionary.cpp intonation.cpp \
 56	readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \
 57	synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \
 58	tr_languages.cpp voices.cpp wavegen.cpp phonemelist.cpp \
 59	espeak_command.cpp event.cpp fifo.cpp $(WAVE) debug.cpp
 60
 61SRCS1=$(speak_SOURCES)
 62OBJS1=$(patsubst %.cpp,%.o,$(SRCS1))
 63LIBS1=-lstdc++ $(LIB_AUDIO) -lpthread $(EXTRA_LIBS)
 64
 65SRCS2=$(libespeak_SOURCES)
 66OBJS2=$(patsubst %.cpp,x_%.o,$(SRCS2))
 67LIBS2=-lstdc++ $(LIB_AUDIO) -lpthread
 68
 69SRCS3 = espeak.cpp
 70OBJS3=$(patsubst %.cpp,%.o,$(SRCS3))
 71LIBS3=-lstdc++ -L . -lespeak
 72
 73CXXFLAGS=-O2
 74
 75
 76all: $(BIN_NAME) $(LIB_NAME) $(STATIC_LIB_NAME) $(BIN2_NAME)
 77	mv $(LIB_NAME) $(LIB_NAME).$(LIBTAG)
 78
 79.cpp.o:
 80	$(CXX) $(CXXFLAGS) $(USE_AUDIO) -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -Wall -pedantic -I. -c -fno-exceptions  $<
 81
 82$(BIN_NAME): $(OBJS1)
 83	$(CXX) -o $@ $(OBJS1) $(LIBS1)
 84
 85$(BIN2_NAME): $(OBJS3) $(LIB_NAME)
 86	$(CXX) -o $@ $(OBJS3) $(LIBS3)
 87
 88
 89
 90x_%.o: %.cpp
 91	$(CXX) $(CXXFLAGS) $(USE_AUDIO) -Wall -fpic -pedantic \
 92	-I. -D LIBRARY -c -fno-exceptions  $<  -o x_$*.o
 93
 94$(LIB_NAME): $(OBJS2)
 95	$(CXX) -shared $(SONAME_OPT)$(LIB_NAME).$(LIB_VERSION) -o $@ $(OBJS2) $(LIBS2)
 96
 97$(STATIC_LIB_NAME): $(OBJS2)
 98	$(AR) cqs $(STATIC_LIB_NAME) $(OBJS2)
 99
100clean:
101	rm -f *.o *.a *~
102
103distclean: clean
104	rm -f $(BIN_NAME)
105	rm -f $(BIN2_NAME)
106	rm -f $(LIB_NAME)*
107
108install: all
109	# Create directories
110	rm -rf $(DESTDIR)$(DATADIR)
111	$(MKDIR) $(DESTDIR)$(BINDIR)
112	$(MKDIR) $(DESTDIR)$(LIBDIR)
113	$(MKDIR) $(DESTDIR)$(INCDIR)
114	$(MKDIR) $(DESTDIR)$(DATADIR)
115	# Install espeak executable
116	$(INSTALL) -m 755 $(BIN2_NAME) $(DESTDIR)$(BINDIR)
117	# Install shared library
118	$(INSTALL) -m 755 $(LIB_NAME).$(LIBTAG) $(DESTDIR)$(LIBDIR)
119	# Install static library
120	$(INSTALL) -m 755 $(STATIC_LIB_NAME) $(DESTDIR)$(LIBDIR)
121	$(LN_SF) $(LIB_NAME).$(LIBTAG) $(DESTDIR)$(LIBDIR)/$(LIB_NAME).$(LIB_VERSION)
122	$(LN_SF) $(LIB_NAME).$(LIB_VERSION) $(DESTDIR)$(LIBDIR)/$(LIB_NAME)
123	# Install development headers
124	$(INSTALL) -pm 644 speak_lib.h $(DESTDIR)$(INCDIR)
125	# Install data files
126	cp -prf ../espeak-data/* $(DESTDIR)$(DATADIR)
127