| # 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 ?= 180609 |
| |
| DBUSXX_XML2CPP ?= dbusxx-xml2cpp |
| PKG_CONFIG ?= pkg-config |
| PC_DEPS = dbus-1 dbus-c++-1 glib-2.0 libpcrecpp libchrome-$(BASE_VER) \ |
| libchromeos-$(BASE_VER) |
| PC_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PC_DEPS)) |
| PC_LIBS := $(shell $(PKG_CONFIG) --libs $(PC_DEPS)) |
| CXXFLAGS += $(PC_CFLAGS) |
| |
| # Need this to come after the PC_* flags since our |
| # sub-module.mk files utilize them. |
| include common.mk |
| |
| CXXFLAGS += -fvisibility=hidden |
| CXXFLAGS += -I$(OUT) # for bindings |
| |
| all: CXX_BINARY(debugd) |
| |
| tests: override NEEDS_MOUNTS = 1 |
| tests: TEST(CXX_BINARY(testrunner)) |
| tests: |
| bash ../src/helpers/capture_utility_test.sh |
| |
| TOOLS := $(patsubst %,%_tool.o, \ |
| anonymizer \ |
| debug_logs \ |
| debug_mode \ |
| example \ |
| icmp \ |
| log \ |
| memory \ |
| modem_status \ |
| netif \ |
| network_status \ |
| packet_capture \ |
| ping \ |
| perf \ |
| route \ |
| storage \ |
| subprocess \ |
| systrace \ |
| tracepath) |
| OBJS := cpu_info_parser.o debug_daemon.o process_with_id.o \ |
| process_with_output.o random_selector.o sandboxed_process.o $(TOOLS) |
| TESTOBJS := \ |
| anonymizer_tool_test.o \ |
| cpu_info_parser_test.o \ |
| log_tool_test.o \ |
| modem_status_tool_test.o \ |
| process_with_id_test.o \ |
| random_selector_test.o |
| |
| CXX_BINARY(debugd): main.o $(OBJS) |
| $(call cxx_binary,-lminijail $(PC_LIBS)) |
| CXX_BINARY(testrunner): testrunner.o $(OBJS) $(TESTOBJS) |
| $(call cxx_binary,-lgtest -lminijail $(PC_LIBS)) |
| CXX_BINARY(helpers/capture_packets): helpers/capture_packets.o |
| $(call cxx_binary,-lpcap -lminijail) |
| |
| clean: CXX_BINARY(debugd) |
| |
| adaptors/%.h: ../share/%.xml |
| mkdir -p $(dir $@) |
| $(DBUSXX_XML2CPP) $^ --adaptor=$@ |
| |
| proxies/%.h: $(SYSROOT)/usr/share/dbus-1/interfaces/%.xml |
| mkdir -p $(dir $@) |
| $(DBUSXX_XML2CPP) $^ --proxy=$@ |
| |
| main.o.depends: adaptors/org.chromium.debugd.h |
| debug_daemon.o.depends: adaptors/org.chromium.debugd.h |
| debug_mode_tool.o.depends: proxies/org.chromium.flimflam.Manager.h \ |
| proxies/org.freedesktop.DBus.Properties.h \ |
| proxies/org.freedesktop.ModemManager.h \ |
| proxies/org.freedesktop.ModemManager1.h |