Makefile 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. ###########################################################################
  2. ## ##
  3. ## Language Technologies Institute ##
  4. ## Carnegie Mellon University ##
  5. ## Copyright (c) 2001-2008 ##
  6. ## All Rights Reserved. ##
  7. ## ##
  8. ## Permission is hereby granted, free of charge, to use and distribute ##
  9. ## this software and its documentation without restriction, including ##
  10. ## without limitation the rights to use, copy, modify, merge, publish, ##
  11. ## distribute, sublicense, and/or sell copies of this work, and to ##
  12. ## permit persons to whom this work is furnished to do so, subject to ##
  13. ## the following conditions: ##
  14. ## 1. The code must retain the above copyright notice, this list of ##
  15. ## conditions and the following disclaimer. ##
  16. ## 2. Any modifications must be clearly marked as such. ##
  17. ## 3. Original authors' names are not deleted. ##
  18. ## 4. The authors' names are not used to endorse or promote products ##
  19. ## derived from this software without specific prior written ##
  20. ## permission. ##
  21. ## ##
  22. ## CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK ##
  23. ## DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ##
  24. ## ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT ##
  25. ## SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE ##
  26. ## FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ##
  27. ## WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN ##
  28. ## AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ##
  29. ## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF ##
  30. ## THIS SOFTWARE. ##
  31. ## ##
  32. ###########################################################################
  33. ## ##
  34. ## Top level user programs ##
  35. ## ##
  36. ###########################################################################
  37. TOP=..
  38. DIRNAME=main
  39. BUILD_DIRS =
  40. ALL_DIRS=
  41. SRCS = flite_main.c flite_time_main.c t2p_main.c compile_regexes.c \
  42. flitevox_info_main.c
  43. OBJS = $(SRCS:.c=.o) flite_voice_list.o
  44. FILES = Makefile $(SRCS)
  45. LOCAL_INCLUDES =
  46. ALL = shared_libs \
  47. $(BINDIR)/flite$(EXEEXT) \
  48. $(BINDIR)/t2p$(EXEEXT) $(BINDIR)/compile_regexes$(EXEEXT) \
  49. $(BINDIR)/flitevox_info$(EXEEXT) \
  50. flite_voice_list.c each $(EXTRABINS)
  51. VOICES=$(VOXES)
  52. VOICELIBS=$(VOICES:%=flite_%)
  53. flite_LIBS = $(VOICELIBS) $(LANGS:%=flite_%) $(LEXES:%=flite_%) flite
  54. flite_LIBS_flags = -L$(LIBDIR) $(flite_LIBS:%=-l%)
  55. flite_LIBS_deps = $(flite_LIBS:%=$(LIBDIR)/lib%.a)
  56. include $(TOP)/config/common_make_rules
  57. # We need to set these vars, even if we're not going to build them
  58. # so make clean can remove them
  59. SHAREDARLIBS= $(flite_LIBS:%=$(LIBDIR)/lib%.shared.a)
  60. SHAREDLIBS = $(SHAREDARLIBS:%.shared.a=%.so)
  61. VERSIONSHAREDLIBS = $(SHAREDLIBS:%=%.${PROJECT_VERSION}) \
  62. $(SHAREDLIBS:%=%.${PROJECT_SHLIB_VERSION})
  63. flite_time_LIBS = flite_cmu_time_awb flite_usenglish flite_cmulex
  64. flite_time_LIBS_flags = -L$(LIBDIR) $(flite_time_LIBS:%=-l%)
  65. flite_time_LIBS_deps = $(flite_time_LIBS:%=$(LIBDIR)/lib%.a)
  66. LOCAL_CLEAN = $(BINDIR)/flite$(EXEEXT) $(BINDIR)/flite_time$(EXEEXT) \
  67. $(BINDIR)/t2p$(EXEEXT) \
  68. $(SHAREDARLIBS) $(SHAREDLIBS) $(VERSIONSHAREDLIBS) \
  69. $(flite_LIBS_deps) $(VOICES:%=$(BINDIR)/flite_%) \
  70. flite_voice_list.c
  71. ifdef SHFLAGS
  72. flite_LIBS_flags += -Wl,-rpath $(LIBDIR)
  73. shared_libs: $(SHAREDLIBS)
  74. else
  75. shared_libs: nothing
  76. endif
  77. .NOTPARALLEL: $(ALL)
  78. flite_lang_list:
  79. rm -f flite_lang_list.c
  80. $(TOP)/tools/make_lang_list $(LANGS) $(LEXES)
  81. $(MAKE) flite_lang_list.o
  82. $(BINDIR)/flite$(EXEEXT): flite_main.o flite_lang_list $(flite_LIBS_deps)
  83. $(TOP)/tools/make_voice_list $(VOICES)
  84. rm -f flite_voice_list.o
  85. $(MAKE) flite_voice_list.o
  86. $(CC) $(CFLAGS) -o $@ flite_main.o flite_voice_list.o flite_lang_list.o $(flite_LIBS_flags) $(LDFLAGS)
  87. $(BINDIR)/flitevox_info$(EXEEXT): flitevox_info_main.o flite_lang_list $(flite_LIBS_deps)
  88. $(TOP)/tools/make_voice_list $(VOICES)
  89. rm -f flite_voice_list.o
  90. $(MAKE) flite_voice_list.o
  91. $(CC) $(CFLAGS) -o $@ flitevox_info_main.o flite_voice_list.o flite_lang_list.o $(flite_LIBS_flags) $(LDFLAGS)
  92. $(BINDIR)/flite_time$(EXEEXT): flite_time_main.o $(flite_time_LIBS_deps)
  93. $(CC) $(CFLAGS) -o $@ flite_time_main.o $(flite_time_LIBS_flags) $(FLITELIBFLAGS) $(LDFLAGS)
  94. $(BINDIR)/t2p$(EXEEXT): t2p_main.o $(flite_LIBS_deps)
  95. $(CC) $(CFLAGS) -o $@ t2p_main.o $(flite_LIBS_flags) $(LDFLAGS)
  96. $(BINDIR)/compile_regexes$(EXEEXT): compile_regexes.o $(FLITELIBS)
  97. $(CC) $(CFLAGS) -o $@ compile_regexes.o $(FLITELIBFLAGS) $(LDFLAGS)
  98. each:
  99. @ for i in $(VOICES) ; \
  100. do \
  101. $(MAKE) VOICE=$$i $(BINDIR)/flite_$$i ; \
  102. done
  103. $(BINDIR)/flite_${VOICE}: flite_main.o flite_lang_list $(flite_LIBS_deps)
  104. $(TOP)/tools/make_voice_list $(VOICE)
  105. rm -f flite_voice_list.o
  106. $(MAKE) flite_voice_list.o
  107. $(CC) $(CFLAGS) -o $@ flite_main.o flite_voice_list.o flite_lang_list.o $(flite_LIBS_flags) $(LDFLAGS)
  108. install:
  109. # The basic binaries
  110. @ $(INSTALL) -m 755 $(BINDIR)/flite $(DESTDIR)$(INSTALLBINDIR)
  111. @ for i in $(VOICES) ; \
  112. do \
  113. $(INSTALL) $(BINDIR)/flite_$$i $(DESTDIR)$(INSTALLBINDIR); \
  114. done
  115. $(INSTALL) -m 755 $(BINDIR)/flite_time $(DESTDIR)$(INSTALLBINDIR)
  116. # The libraries: static and shared (if built)
  117. cp -pd $(flite_LIBS_deps) $(DESTDIR)$(INSTALLLIBDIR)
  118. ifdef SHFLAGS
  119. cp -pd $(SHAREDLIBS) $(VERSIONSHAREDLIBS) $(DESTDIR)$(INSTALLLIBDIR)
  120. endif