blob: ae13cc04b4c6e5515899d1b87210b89f11e801d3 [file] [log] [blame]
# 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.
BASE_VER ?= 125070
DBUSXX_XML2CPP ?= dbusxx-xml2cpp
PKG_CONFIG ?= pkg-config
PC_DEPS = dbus-1 dbus-c++-1 libchrome-$(BASE_VER) libchromeos-$(BASE_VER)
PC_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PC_DEPS))
PC_LIBS := $(shell $(PKG_CONFIG) --libs $(PC_DEPS))
BINDINGS := adaptors/org.chromium.tpmd.h adaptors/org.chromium.tpmd.nvram.h
CXXFLAGS += -fvisibility=hidden
all: CXX_BINARY(tpmd)
OBJS := main.o tpmd.o volatile_nvram.o
CXX_BINARY(tpmd): main.o $(OBJS)
$(call cxx_binary,$(PC_LIBS))
clean: CXX_BINARY(tpmd)
adaptors/%.h: ../share/%.xml
mkdir -p $(dir $@)
$(DBUSXX_XML2CPP) $^ --adaptor=$@ --adaptor-template=ef-adaptor-stubs.tpl
main.o.depends: $(BINDINGS)
tpmd.o.depends: $(BINDINGS)
volatile_nvram.o.depends: $(BINDINGS)
install: all
install -D -m 755 $(OUT)tpmd $(DESTDIR)/usr/sbin/tpmd