Debian Codegraph @

tools/Makefile.flite

raw
1 ########################################################-*-mode:Makefile-*-
2 ## ##
3 ## Language Technologies Institute ##
4 ## Carnegie Mellon University ##
5 ## Copyright (c) 2000-2015 ##
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
39 FLITE_LANG=__FLITELANG__
40 FLITE_LEX=__FLITELEX__
41 LOCAL_INCLUDES = -I$(TOP)/lang/$(FLITE_LANG) -I$(TOP)/lang/$(FLITE_LEX)
42 LOCAL_LANGLEX_LIBS = -lflite_$(FLITE_LANG) -lflite_$(FLITE_LEX)
43 LOCAL_LIBS = -L . -l$(VOICENAME)
44 H =
45
46 CSRCS = $(VOICENAME).c
47
48 VOICES=$(VOICENAME)
49
50 ifeq ($(VOICETYPE),diphone)
51 ## Diphone
52 CSRCS +=$(VOICENAME)_$(VOICETYPE).c
53 CSRCS +=$(VOICENAME)_lpc.c
54 CSRCS +=$(VOICENAME)_res.c
55 CSRCS +=$(VOICENAME)_residx.c
56 else
57 ifeq ($(VOICETYPE),cg)
58 ## Clustergen
59 CSRCS += $(VOICENAME)_cg.c
60 CSRCS += $(VOICENAME)_cg_phonestate.c
61 # Identify which .c param files are used single or multi-rfs
62 include paramfiles.mak
63 CSRCS += $(shell ls $(VOICENAME)_cg_*_f0_trees.c)
64 CSRCS += $(shell ls $(VOICENAME)_cg_*_mcep_trees.c)
65 CSRCS += $(shell ls $(VOICENAME)_cg_*_params.c)
66 CSRCS += $(shell ls $(VOICENAME)_cg_*_durmodel.c)
67 ifeq ($(SPAMF0),true)
68 CSRCS += $(VOICENAME)_spamf0_phrase.c $(VOICENAME)_spamf0_accent.c $(VOICENAME)_spamf0_accent_params.c
69 endif
70 ifeq ($(CG_GRAPHEME),true)
71 CSRCS += $(VOICENAME)_phoneset.c
72 EXTRA_CC_FLAGS += -DCG_GRAPHEME=1
73 endif
74 MCEPOBJS =
75 LPCOBJS =
76 else
77 ## Clunits/ldom
78 CSRCS += $(VOICENAME)_clunits.c
79 CSRCS += $(VOICENAME)_cltrees.c $(VOICENAME)_lpc.c $(VOICENAME)_mcep.c
80 CSRCS += $(VOICENAME)_cl_durmodel.c
81 MCEPSRCS = $(shell if [ -f $(VOICENAME)_mcep_000.c ]; then ls $(VOICENAME)_mcep_*.c ; fi)
82 MCEPOBJS = $(MCEPSRCS:.c=.o)
83 LPCSRCS= $(shell if [ -f $(VOICENAME)_lpc_000.c ] ; then ls $(VOICENAME)_lpc_*.c; fi )
84 LPCOBJS = $(LPCSRCS:.c=.o)
85 RESSRCS= $(shell if [ -f $(VOICENAME)_res_000.c ] ; then ls $(VOICENAME)_res_*.c; fi )
86 RESOBJS = $(RESSRCS:.c=.o)
87 endif
88 endif
89
90 OBJS = $(CSRCS:.c=.o) $(LPCOBJS) $(MCEPOBJS) $(RESOBJS)
91
92 ALL = lib$(VOICENAME).a flite_$(VOICENAME)
93
94 include $(FLITEDIR)/config/common_make_rules
95
96 LIBDIR=.
97 ifdef SHFLAGS
98 ALL += lib$(VOICENAME).so
99 endif
100
101 $(VOICENAME)_lpc.o: $(VOICENAME)_lpc.c
102 $(CC) $(CFLAGS) -I. -I$(FLITEDIR)/include -c -o $@ $<
103
104 $(VOICENAME)_mcep.o: $(VOICENAME)_mcep.c
105 $(CC) $(CFLAGS) -I. -I$(FLITEDIR)/include -c -o $@ $<
106
107 flite_$(VOICENAME): flite_main.o flite_voice_list.o flite_lang_list.o $(FLITELIBS) lib$(VOICENAME).a
108 $(CC) $(CFLAGS) -o $@ flite_main.o flite_voice_list.o flite_lang_list.o $(LOCAL_LIBS) $(LOCAL_LANGLEX_LIBS) $(FLITELIBFLAGS) $(LDFLAGS)
109
110 lib$(VOICENAME).a: $(OBJS)
111 @ $(AR) cruv lib$(VOICENAME).a $(OBJS)
112 @ $(RANLIB) lib$(VOICENAME).a
113 @ touch .build_lib
114
115 flite_voice_list.c:
116 $(TOP)/tools/make_voice_list $(VOICES)
117
118 flite_lang_list.c:
119 $(TOP)/tools/make_lang_list $(FLITE_LANG) $(FLITE_LEX)
120
121 # Dump cg voice as single file
122 voicedump : flite_$(VOICENAME)
123 ./flite_$(VOICENAME) -voicedump $(VOICENAME).flitevox
124 # Add build date to the flitevox file
125 $(FLITEDIR)/bin/flitevox_info -set build_date -val "`date`" -voice $(VOICENAME).flitevox
126
127 # Run front end tests
128 flitecheck:
129 $(FLITEDIR)/bin/run_flitecheck $(VOICENAME).flitevox
130