| # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| CXX ?= g++ |
| PKG_CONFIG ?= pkg-config |
| |
| LDFLAGS = -lpthread -lm -lasound -lpico -lresample -lchromeos -lrt -lbase |
| |
| CCFLAGS = $(CFLAGS) \ |
| -Wall -Werror \ |
| -I. \ |
| -I/build/x86_generic/usr/include \ |
| -L/build/x86_generic/usr/lib |
| |
| PC_DEPS = dbus-1 dbus-glib-1 gobject-2.0 libchromeos |
| INCLUDE_DIRS=-I.. $(shell $(PKG_CONFIG) --cflags $(PC_DEPS)) |
| LIB_DIRS=$(shell $(PKG_CONFIG) --libs $(PC_DEPS)) |
| |
| DBUS_SOURCE=speech_synthesizer.xml |
| DBUS_SERVER=bindings/server.h |
| BINDINGS_DIR=bindings |
| |
| CC_SRCS = linux/audio_output_alsa.cc linux/threading.cc \ |
| pico/pico_tts_engine.cc pico/load_pico_voices_static.cc resampler.cc \ |
| tts_engine.cc tts_service.cc speech_synthesizer_main.cc \ |
| speech_synthesizer_service.cc interface.cc |
| HEADERS = audio_output.h pico/pico_tts_engine.h resampler.h ringbuffer.h \ |
| threading.h tts_engine.h tts_receiver.h tts_service.h log.h \ |
| speech_synthesizer_service.h interface.h |
| |
| all: dirs speech_synthesizer |
| @echo "Done building." |
| |
| clean: |
| rm -rf libttspico.so objs/ |
| |
| dirs: |
| test -d objs/pico || mkdir -p objs/pico |
| test -d objs/linux || mkdir -p objs/linux |
| |
| CC_OBJS = $(CC_SRCS:%.cc=objs/%.o) |
| OBJS = $(CC_OBJS) |
| |
| $(CC_OBJS): objs/%.o: %.cc $(HEADERS) $(DBUS_SERVER) |
| $(CXX) -c $(CCFLAGS) $(INCLUDE_DIRS) $(LIB_DIRS) -fPIC -Iobjs/ $< -o $@ |
| |
| speech_synthesizer: $(OBJS) |
| $(CXX) \ |
| $(CCFLAGS) $(INCLUDE_DIRS) $(LIB_DIRS) \ |
| -o $@ $^ \ |
| $(LDFLAGS) |
| |
| $(BINDINGS_DIR): |
| mkdir -p $(BINDINGS_DIR) |
| |
| $(DBUS_SERVER): $(DBUS_SOURCE) $(BINDINGS_DIR) |
| dbus-binding-tool --mode=glib-server \ |
| --prefix=`basename $(DBUS_SOURCE) .xml` $(DBUS_SOURCE) > $(DBUS_SERVER) |