eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # remove -fno-exceptions if it causes problems with stdio library on some platforms (ARM)
  2. PREFIX=/
  3. BINDIR=$(PREFIX)/usr/bin
  4. INCDIR=$(PREFIX)/usr/include/espeak
  5. LIBDIR=$(PREFIX)/usr/lib
  6. DATADIR=$(PREFIX)/usr/share/espeak-data
  7. RELEASE = 1.35
  8. BIN_NAME = speak
  9. BIN2_NAME = espeak
  10. LIB_NAME = libespeak.so
  11. STATIC_LIB_NAME = libespeak.a
  12. LIB_VERSION = 1
  13. LIBTAG = $(LIB_VERSION).$(RELEASE)
  14. # Use SONAME_OPT=-Wl,h, on Solaris
  15. SONAME_OPT=-Wl,-soname,
  16. # Use EXTRA_LIBS=-lm on Solaris
  17. EXTRA_LIBS =
  18. INSTALL = install
  19. LN_SF = /bin/ln -sf
  20. MKDIR = mkdir -p
  21. #AUDIO = pulseaudio
  22. AUDIO = portaudio
  23. ifeq ($(AUDIO),pulseaudio)
  24. WAVE=wave_pulse.cpp
  25. LIB_AUDIO=pulse
  26. USE_AUDIO=USE_PULSEAUDIO
  27. else
  28. WAVE=wave.cpp
  29. LIB_AUDIO=portaudio
  30. USE_AUDIO=USE_PORTAUDIO
  31. endif
  32. speak_SOURCES = speak.cpp compiledict.cpp dictionary.cpp intonation.cpp \
  33. readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \
  34. synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \
  35. tr_languages.cpp voices.cpp wavegen.cpp phonemelist.cpp
  36. libespeak_SOURCES = speak_lib.cpp compiledict.cpp dictionary.cpp intonation.cpp \
  37. readclause.cpp setlengths.cpp numbers.cpp synth_mbrola.cpp \
  38. synthdata.cpp synthesize.cpp translate.cpp tr_english.cpp \
  39. tr_languages.cpp voices.cpp wavegen.cpp phonemelist.cpp \
  40. espeak_command.cpp event.cpp fifo.cpp $(WAVE) debug.cpp
  41. SRCS1=$(speak_SOURCES)
  42. OBJS1=$(patsubst %.cpp,%.o,$(SRCS1))
  43. LIBS1=-lstdc++ -l$(LIB_AUDIO) -lpthread $(EXTRA_LIBS)
  44. SRCS2=$(libespeak_SOURCES)
  45. OBJS2=$(patsubst %.cpp,x_%.o,$(SRCS2))
  46. LIBS2=-lstdc++ -l$(LIB_AUDIO) -lpthread
  47. SRCS3 = espeak.cpp
  48. OBJS3=$(patsubst %.cpp,%.o,$(SRCS3))
  49. LIBS3=-lstdc++ -L . -lespeak
  50. CXXFLAGS=-O2 -D$(USE_AUDIO)
  51. all: $(BIN_NAME) $(LIB_NAME) $(STATIC_LIB_NAME) $(BIN2_NAME)
  52. mv $(LIB_NAME) $(LIB_NAME).$(LIBTAG)
  53. .cpp.o:
  54. $(CXX) $(CXXFLAGS) -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -Wall -pedantic -I. -c -fno-exceptions $<
  55. $(BIN_NAME): $(OBJS1)
  56. $(CXX) -o $@ $(OBJS1) $(LIBS1)
  57. $(BIN2_NAME): $(OBJS3) $(LIB_NAME)
  58. $(CXX) -o $@ $(OBJS3) $(LIBS3)
  59. x_%.o: %.cpp
  60. $(CXX) $(CXXFLAGS) -Wall -fpic -pedantic \
  61. -I. -D LIBRARY -c -fno-exceptions $< -o x_$*.o
  62. $(LIB_NAME): $(OBJS2)
  63. $(CXX) -shared $(SONAME_OPT)$(LIB_NAME).$(LIB_VERSION) -o $@ $(OBJS2) $(LIBS2)
  64. $(STATIC_LIB_NAME): $(OBJS2)
  65. $(AR) cqs $(STATIC_LIB_NAME) $(OBJS2)
  66. clean:
  67. rm -f *.o *.a *~
  68. distclean: clean
  69. rm -f $(BIN_NAME)
  70. rm -f $(BIN2_NAME)
  71. rm -f $(LIB_NAME)*
  72. install: all
  73. # Create directories
  74. rm -rf $(DESTDIR)$(DATADIR)
  75. $(MKDIR) $(DESTDIR)$(BINDIR)
  76. $(MKDIR) $(DESTDIR)$(LIBDIR)
  77. $(MKDIR) $(DESTDIR)$(INCDIR)
  78. $(MKDIR) $(DESTDIR)$(DATADIR)
  79. # Install espeak executable
  80. $(INSTALL) -m 755 $(BIN2_NAME) $(DESTDIR)$(BINDIR)
  81. # Install shared library
  82. $(INSTALL) -m 755 $(LIB_NAME).$(LIBTAG) $(DESTDIR)$(LIBDIR)
  83. # Install static library
  84. $(INSTALL) -m 755 $(STATIC_LIB_NAME) $(DESTDIR)$(LIBDIR)
  85. $(LN_SF) $(LIB_NAME).$(LIBTAG) $(DESTDIR)$(LIBDIR)/$(LIB_NAME).$(LIB_VERSION)
  86. $(LN_SF) $(LIB_NAME).$(LIB_VERSION) $(DESTDIR)$(LIBDIR)/$(LIB_NAME)
  87. # Install development headers
  88. $(INSTALL) -pm 644 speak_lib.h $(DESTDIR)$(INCDIR)
  89. # Install data files
  90. cp -prf ../espeak-data/* $(DESTDIR)$(DATADIR)