| # Copyright (c) 2012 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++ |
| BASE_VER = 85268 |
| PKG_CONFIG ?= pkg-config |
| |
| PC_DEPS = alsa dbus-1 dbus-glib-1 gobject-2.0 \ |
| libchrome-$(BASE_VER) libchromeos-$(BASE_VER) |
| PC_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PC_DEPS)) |
| PC_LIBS := $(shell $(PKG_CONFIG) --libs $(PC_DEPS)) |
| |
| CXXFLAGS += -Wall -Werror |
| CPPFLAGS += -I. $(PC_CFLAGS) |
| LDLIBS = -lpico -lresample |
| LDLIBS += $(PC_LIBS) |
| |
| 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: speech_synthesizer |
| |
| clean: |
| rm -rf libttspico.so objs/ |
| |
| dirs: |
| mkdir -p objs/pico objs/linux |
| |
| CC_OBJS = $(CC_SRCS:%.cc=objs/%.o) |
| OBJS = $(CC_OBJS) |
| |
| $(CC_OBJS): objs/%.o: %.cc $(HEADERS) $(DBUS_SERVER) | dirs |
| $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $< -o $@ |
| |
| speech_synthesizer: $(OBJS) |
| $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) |
| |
| $(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) |