blob: 97d5375e55b1a80094d552bb9d6a16a75fe04763 [file] [log] [blame]
# 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++
CXXFLAGS ?= -Wall -Werror -g
LIBS = -lbase -lpthread -lrt -lchromeos
INCLUDE_DIRS = -I.. $(shell pkg-config --cflags gobject-2.0 dbus-1 dbus-glib-1)
LIB_DIRS = $(shell pkg-config --libs gobject-2.0 dbus-1 dbus-glib-1)
SESSION_COMMON_OBJS = session_manager_service.o child_job.o interface.o
DBUS_SOURCE = session_manager.xml
DBUS_SERVER = bindings/server.h
DBUS_CLIENT = bindings/client.h
SESSION_BIN = session_manager
SESSION_OBJS = $(SESSION_COMMON_OBJS) session_manager_main.o
SIGNALLER_BIN = signaller
SIGNALLER_OBJS = signaller.o
TEST_BIN = session_manager_unittest
TEST_OBJS = $(SESSION_COMMON_OBJS) session_manager_testrunner.o \
session_manager_unittest.o child_job_unittest.o
BINDINGS_DIR = bindings
$(LIBS) $(LDFLAGS) -lgtest -lgmock -o $(TEST_BIN)
$(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) -c $< -o $@
mkdir -p $(BINDINGS_DIR)
dbus-binding-tool --mode=glib-server \
--prefix=`basename $(DBUS_SOURCE) .xml` $(DBUS_SOURCE) > $(DBUS_SERVER)
dbus-binding-tool --mode=glib-client \
--prefix=`basename $(DBUS_SOURCE) .xml` $(DBUS_SOURCE) > $(DBUS_CLIENT)