Makefile.flite 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. ########################################################-*-mode:Makefile-*-
  2. ## ##
  3. ## Language Technologies Institute ##
  4. ## Carnegie Mellon University ##
  5. ## Copyright (c) 2000-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. FLITEDIR=__FLITEDIR__
  34. TOP=$(FLITEDIR)
  35. DIRNAME=flite
  36. VOICENAME=__VOICENAME__
  37. VOICETYPE=__VOICETYPE__
  38. FLITE_LANG=__FLITELANG__
  39. FLITE_LEX=__FLITELEX__
  40. LOCAL_INCLUDES = -I$(TOP)/lang/$(FLITE_LANG) -I$(TOP)/lang/$(FLITE_LEX)
  41. LOCAL_LANGLEX_LIBS = -lflite_$(FLITE_LANG) -lflite_$(FLITE_LEX)
  42. LOCAL_LIBS = -L . -l$(VOICENAME)
  43. H =
  44. CSRCS = $(VOICENAME).c
  45. VOICES=$(VOICENAME)
  46. ifeq ($(VOICETYPE),diphone)
  47. ## Diphone
  48. CSRCS +=$(VOICENAME)_$(VOICETYPE).c
  49. CSRCS +=$(VOICENAME)_lpc.c
  50. CSRCS +=$(VOICENAME)_res.c
  51. CSRCS +=$(VOICENAME)_residx.c
  52. else
  53. ifeq ($(VOICETYPE),cg)
  54. ## Clustergen
  55. CSRCS += $(VOICENAME)_cg.c
  56. CSRCS += $(VOICENAME)_cg_f0_trees.c
  57. CSRCS += $(VOICENAME)_cg_phonestate.c
  58. # Identify which .c param files are used single or multi-rfs
  59. include paramfiles.mak
  60. CSRCS += $(shell ls $(VOICENAME)_cg_*_mcep_trees.c)
  61. CSRCS += $(shell ls $(VOICENAME)_cg_*_params.c)
  62. CSRCS += $(shell ls $(VOICENAME)_cg_*_durmodel.c)
  63. ifeq ($(SPAMF0),true)
  64. CSRCS += $(VOICENAME)_spamf0_phrase.c $(VOICENAME)_spamf0_accent.c $(VOICENAME)_spamf0_accent_params.c
  65. endif
  66. MCEPOBJS =
  67. LPCOBJS =
  68. else
  69. ## Clunits/ldom
  70. CSRCS += $(VOICENAME)_clunits.c
  71. CSRCS += $(VOICENAME)_cltrees.c $(VOICENAME)_lpc.c $(VOICENAME)_mcep.c
  72. CSRCS += $(VOICENAME)_cl_durmodel.c
  73. MCEPSRCS = $(shell if [ -f $(VOICENAME)_mcep_000.c ]; then ls $(VOICENAME)_mcep_*.c ; fi)
  74. MCEPOBJS = $(MCEPSRCS:.c=.o)
  75. LPCSRCS= $(shell if [ -f $(VOICENAME)_lpc_000.c ] ; then ls $(VOICENAME)_lpc_*.c; fi )
  76. LPCOBJS = $(LPCSRCS:.c=.o)
  77. RESSRCS= $(shell if [ -f $(VOICENAME)_res_000.c ] ; then ls $(VOICENAME)_res_*.c; fi )
  78. RESOBJS = $(RESSRCS:.c=.o)
  79. endif
  80. endif
  81. OBJS = $(CSRCS:.c=.o) $(LPCOBJS) $(MCEPOBJS) $(RESOBJS)
  82. ALL = lib$(VOICENAME).a flite_$(VOICENAME)
  83. include $(FLITEDIR)/config/common_make_rules
  84. LIBDIR=.
  85. ifdef SHFLAGS
  86. ALL += lib$(VOICENAME).so
  87. endif
  88. $(VOICENAME)_lpc.o: $(VOICENAME)_lpc.c
  89. $(CC) $(CFLAGS) -I. -I$(FLITEDIR)/include -c -o $@ $<
  90. $(VOICENAME)_mcep.o: $(VOICENAME)_mcep.c
  91. $(CC) $(CFLAGS) -I. -I$(FLITEDIR)/include -c -o $@ $<
  92. flite_$(VOICENAME): flite_main.o flite_voice_list.o flite_lang_list.o $(FLITELIBS) lib$(VOICENAME).a
  93. $(CC) $(CFLAGS) -o $@ flite_main.o flite_voice_list.o flite_lang_list.o $(LOCAL_LIBS) $(LOCAL_LANGLEX_LIBS) $(FLITELIBFLAGS) $(LDFLAGS)
  94. lib$(VOICENAME).a: $(OBJS)
  95. @ $(AR) cruv lib$(VOICENAME).a $(OBJS)
  96. @ $(RANLIB) lib$(VOICENAME).a
  97. @ touch .build_lib
  98. flite_voice_list.c:
  99. $(TOP)/tools/make_voice_list $(VOICES)
  100. flite_lang_list.c:
  101. $(TOP)/tools/make_lang_list $(FLITE_LANG) $(FLITE_LEX)
  102. # Dump cg voice as single file
  103. voicedump : flite_$(VOICENAME)
  104. ./flite_$(VOICENAME) -voicedump $(VOICENAME).flitevox