Lines 1-155
Link Here
|
1 |
Allow parallel builds: |
|
|
2 |
|
3 |
1. First, modify make_voice_list script to accept the |
4 |
output file (defaulting to flite_voice_list.c as before). |
5 |
2. Use a per-library subdirectory to build shared objecs from |
6 |
the .shared.a-counterparts -- using the same shared_os/ |
7 |
was causing conflicts, when multiple such libraries were |
8 |
built in parallel. |
9 |
3. Use the new feature of make_voice_list (see 1.) to build |
10 |
separate voice-list files for each voice, thus avoiding |
11 |
the last sort of conflicts. |
12 |
|
13 |
This also removes linking unnecessary libraries into flite_VOICE |
14 |
executables -- only the library providing the particular voice is used |
15 |
now. |
16 |
|
17 |
-mi |
18 |
|
19 |
--- tools/make_voice_list 2009-04-08 09:18:42.000000000 -0400 |
20 |
+++ tools/make_voice_list 2014-12-01 19:39:40.000000000 -0500 |
21 |
@@ -36,26 +36,38 @@ |
22 |
########################################################################### |
23 |
|
24 |
-rm -f flite_voice_list.c |
25 |
+case "$1" in |
26 |
+-o) |
27 |
+ output=$2 |
28 |
+ shift 2 |
29 |
+ ;; |
30 |
+*) |
31 |
+ output=flite_voice_list.c |
32 |
+ ;; |
33 |
+esac |
34 |
+ |
35 |
+rm -f $output |
36 |
+exec > $output |
37 |
+ |
38 |
+cat << EOT |
39 |
+/* Generated automatically from make_voice_list */ |
40 |
+ |
41 |
+#include "flite.h" |
42 |
+ |
43 |
+EOT |
44 |
|
45 |
-echo "/* Generated automatically from make_voice_list */" >flite_voice_list.c |
46 |
-echo >>flite_voice_list.c |
47 |
-echo '#include "flite.h"' >>flite_voice_list.c |
48 |
-echo >>flite_voice_list.c |
49 |
for i in $* |
50 |
do |
51 |
- echo "cst_voice *register_"$i"(const char *voxdir);">>flite_voice_list.c |
52 |
+ echo "cst_voice *register_"$i"(const char *voxdir);" |
53 |
done |
54 |
|
55 |
-echo >>flite_voice_list.c |
56 |
-echo "cst_val *flite_set_voice_list(void)" >>flite_voice_list.c |
57 |
-echo "{" >>flite_voice_list.c |
58 |
+echo |
59 |
+echo "cst_val *flite_set_voice_list(void)" |
60 |
+echo "{" |
61 |
for i in $* |
62 |
do |
63 |
- echo " flite_voice_list = cons_val(voice_val(register_"$i"(NULL)),flite_voice_list);" >>flite_voice_list.c |
64 |
+ echo " flite_voice_list = cons_val(voice_val(register_"$i"(NULL)),flite_voice_list);" |
65 |
done |
66 |
- echo " flite_voice_list = val_reverse(flite_voice_list);" >>flite_voice_list.c |
67 |
- echo " return flite_voice_list;" >>flite_voice_list.c |
68 |
- |
69 |
-echo "}" >>flite_voice_list.c |
70 |
-echo >>flite_voice_list.c |
71 |
+ echo " flite_voice_list = val_reverse(flite_voice_list);" |
72 |
+ echo " return flite_voice_list;" |
73 |
|
74 |
+echo "}" |
75 |
--- config/common_make_rules 2009-07-30 10:52:56.000000000 -0400 |
76 |
+++ config/common_make_rules 2014-12-01 19:43:50.000000000 -0500 |
77 |
@@ -121,11 +121,11 @@ |
78 |
$(LIBDIR)/%.so: $(LIBDIR)/%.shared.a |
79 |
@ echo making $@ |
80 |
- @ rm -rf shared_os && mkdir shared_os |
81 |
+ @ rm -rf shared_os.$* && mkdir shared_os.$* |
82 |
@ rm -f $@ $@.${PROJECT_VERSION} $@.${PROJECT_SHLIB_VERSION} |
83 |
- @ (cd shared_os && ar x ../$<) |
84 |
- @ (cd shared_os && $(CC) -shared -Wl,-soname,`basename $@`.${PROJECT_SHLIB_VERSION} -o ../$@.${PROJECT_VERSION} *.os) |
85 |
+ @ (cd shared_os.$* && ar x ../$<) |
86 |
+ @ (cd shared_os.$* && $(CC) -shared -Wl,-soname,`basename $@`.${PROJECT_SHLIB_VERSION} -o ../$@.${PROJECT_VERSION} *.os) |
87 |
@ (cd $(LIBDIR) && ln -s `basename $@.${PROJECT_VERSION}` `basename $@.${PROJECT_SHLIB_VERSION}` ) |
88 |
@ (cd $(LIBDIR) && ln -s `basename $@.${PROJECT_SHLIB_VERSION}` `basename $@` ) |
89 |
- @ rm -rf shared_os |
90 |
+ @ rm -rf shared_os.$* |
91 |
|
92 |
$(OBJDIR)/.make_build_dirs: |
93 |
--- main/Makefile 2009-08-14 17:11:07.000000000 -0400 |
94 |
+++ main/Makefile 2014-12-01 21:07:35.000000000 -0500 |
95 |
@@ -40,5 +40,5 @@ |
96 |
ALL_DIRS= |
97 |
SRCS = flite_main.c flite_time_main.c t2p_main.c compile_regexes.c |
98 |
-OBJS = $(SRCS:.c=.o) flite_voice_list.o |
99 |
+OBJS = $(SRCS:.c=.o) |
100 |
FILES = Makefile $(SRCS) |
101 |
LOCAL_INCLUDES = |
102 |
@@ -47,8 +47,9 @@ |
103 |
$(BINDIR)/flite$(EXEEXT) \ |
104 |
$(BINDIR)/t2p$(EXEEXT) $(BINDIR)/compile_regexes$(EXEEXT) \ |
105 |
- flite_voice_list.c each $(EXTRABINS) |
106 |
+ $(EXTRABINS) |
107 |
|
108 |
VOICES=$(VOXES) |
109 |
VOICELIBS=$(VOICES:%=flite_%) |
110 |
+VOICEEXES=$(VOICES:%=${BINDIR}/flite_%) |
111 |
|
112 |
flite_LIBS = $(VOICELIBS) $(LANGS:%=flite_%) $(LEXES:%=flite_%) flite |
113 |
@@ -76,5 +77,4 @@ |
114 |
|
115 |
ifdef SHFLAGS |
116 |
-flite_LIBS_flags += -Wl,-rpath $(LIBDIR) |
117 |
shared_libs: $(SHAREDLIBS) |
118 |
else |
119 |
@@ -82,9 +82,9 @@ |
120 |
endif |
121 |
|
122 |
-$(BINDIR)/flite$(EXEEXT): flite_main.o $(flite_LIBS_deps) |
123 |
+flite_voice_list.c: |
124 |
$(TOP)/tools/make_voice_list $(VOICES) |
125 |
- rm -f flite_voice_list.o |
126 |
- $(MAKE) flite_voice_list.o |
127 |
- $(CC) $(CFLAGS) -o $@ flite_main.o flite_voice_list.o $(flite_LIBS_flags) $(LDFLAGS) |
128 |
+ |
129 |
+$(BINDIR)/flite$(EXEEXT): flite_main.o flite_voice_list.c $(flite_LIBS_deps) |
130 |
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ flite_main.o flite_voice_list.c $(flite_LIBS_flags) $(LDFLAGS) |
131 |
|
132 |
$(BINDIR)/flite_time$(EXEEXT): flite_time_main.o $(flite_time_LIBS_deps) |
133 |
@@ -98,15 +98,12 @@ |
134 |
$(CC) $(CFLAGS) -o $@ compile_regexes.o $(FLITELIBFLAGS) $(LDFLAGS) |
135 |
|
136 |
-each: |
137 |
- @ for i in $(VOICES) ; \ |
138 |
- do \ |
139 |
- $(MAKE) VOICE=$$i $(BINDIR)/flite_$$i ; \ |
140 |
- done |
141 |
+each: ${VOICEEXES} |
142 |
+ |
143 |
+voice_list_%.c: $(TOP)/tools/make_voice_list |
144 |
+ $(TOP)/tools/make_voice_list -o $@ |
145 |
|
146 |
-$(BINDIR)/flite_${VOICE}: flite_main.o $(flite_LIBS_deps) |
147 |
- $(TOP)/tools/make_voice_list $(VOICE) |
148 |
- rm -f flite_voice_list.o |
149 |
- $(MAKE) flite_voice_list.o |
150 |
- $(CC) $(CFLAGS) -o $@ flite_main.o flite_voice_list.o $(flite_LIBS_flags) $(LDFLAGS) |
151 |
+$(BINDIR)/flite_%: voice_list_%.c flite_main.o $(flite_LIBS_deps) |
152 |
+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ flite_main.o voice_list_$*.c \ |
153 |
+ $(filter-out -lflite_cmu_%,${flite_LIBS_flags}) -lflite_$* $(LDFLAGS) |
154 |
|
155 |
install: |