blob: 8e34018083551c532c15fe217a31a3ef3f94617c [file] [log] [blame]
Thieu Le3426c8f2012-01-11 17:35:11 -08001# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Chris Masone96832c32011-05-03 12:23:18 -07002# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Darin Petkovd9050bb2012-09-26 16:02:52 +02005AR ?= ar
Darin Petkove6ca3202012-10-19 14:49:56 +02006CC ?= gcc
Chris Masone96832c32011-05-03 12:23:18 -07007CXX ?= g++
mukesh agrawaled8a45e2013-03-27 18:54:28 -07008# -clang uses clang to syntax check, and then runs gcc/g++ to actually
9# generate binaries.
10# -print-cmdline outputs both the clang and gnu command lines.
11# For more, see http://www.chromium.org/chromium-os/developer-guide
Darin Petkov374b5ee2012-11-06 11:20:04 +010012CFLAGS += \
mukesh agrawaled8a45e2013-03-27 18:54:28 -070013 -clang -print-cmdline \
Darin Petkov374b5ee2012-11-06 11:20:04 +010014 -Wall \
15 -Werror \
16 -Wextra \
17 -Wno-missing-field-initializers \
18 -Wno-unused-parameter \
19 -Wno-unused-result \
20 -Wuninitialized
mukesh agrawalf60e4062011-05-27 13:13:41 -070021CXXFLAGS ?= -fno-strict-aliasing
mukesh agrawaled8a45e2013-03-27 18:54:28 -070022
23# -Wno-bind-to-temporary copy is required for clang, because clang is
24# more strict than g++ with respect to c++98 and references to
25# temporaries. The restriction is relaxed in c++11, but we can't use
26# --std=c++11, because our code has other issues with c++11.
27#
28# For info on binding to temporaries, see
29# - http://stackoverflow.com/questions/13898750
30# - http://stackoverflow.com/questions/1826934
31#
32# TODO(quiche): remove -Wno-bind-to-temporary-copy after we move to
33# c++11. (crosbug.com/224515)
34CXXFLAGS += $(CFLAGS) \
35 -Woverloaded-virtual \
36 -Xclang-only=-Wno-bind-to-temporary-copy
Darin Petkov04d46b42011-08-31 14:17:34 -070037CXXFLAGS += $(EXTRA_CXXFLAGS)
Chris Masone96832c32011-05-03 12:23:18 -070038CPPFLAGS ?= -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
Chris Masone96832c32011-05-03 12:23:18 -070039PKG_CONFIG ?= pkg-config
Chris Masone14de6e52011-05-09 09:20:59 -070040DBUSXX_XML2CPP = dbusxx-xml2cpp
Daniel Erat0818cca2012-12-14 10:16:21 -080041PROTOC ?= protoc
Chris Masone96832c32011-05-03 12:23:18 -070042
Darin Petkov5236a8e2012-02-21 10:26:55 +010043BUILDDIR = build
Daniel Erat0818cca2012-12-14 10:16:21 -080044VPATH = $(BUILDDIR)
Darin Petkov5236a8e2012-02-21 10:26:55 +010045
Paul Stewart291a4732012-03-14 19:19:02 -070046LIBDIR = /usr/lib
Darin Petkov86654d32012-10-08 15:32:34 +020047SHIMDIR = $(LIBDIR)/shill/shims
Darin Petkov95f317f2012-10-22 13:37:43 +020048CPPFLAGS += -DSHIMDIR=\"$(SHIMDIR)\"
Wade Guthrie0d438532012-05-18 14:18:50 -070049
Paul Stewart5ad16062013-02-21 18:10:48 -080050BASE_VER ?= 180609
Darin Petkovd9050bb2012-09-26 16:02:52 +020051COMMON_PC_DEPS = libchrome-$(BASE_VER) libchromeos-$(BASE_VER)
Christopher Wiley49e247a2012-11-07 11:24:59 -080052SHILL_PC_DEPS = \
53 $(COMMON_PC_DEPS) \
54 dbus-c++-1 \
55 gio-2.0 \
56 glib-2.0 \
Christopher Wileyefd521f2012-11-07 17:32:46 -080057 libnl-3.0 \
58 libnl-genl-3.0
Christopher Wiley0d05c112013-03-19 17:49:38 -070059CRYPTO_UTIL_PC_DEPS = \
60 $(COMMON_PC_DEPS) \
61 protobuf-lite \
62 openssl
Darin Petkovfac01f02012-12-06 12:44:07 +010063NET_DIAGS_UPLOAD_PC_DEPS = $(COMMON_PC_DEPS)
Paul Stewart1c9a5662013-02-12 09:41:33 -080064NETFILTER_QUEUE_HELPER_PC_DEPS = \
65 $(COMMON_PC_DEPS) \
66 libmnl \
67 libnetfilter_queue \
68 libnfnetlink
Darin Petkovd9050bb2012-09-26 16:02:52 +020069NSS_GET_CERT_PC_DEPS = $(COMMON_PC_DEPS) nss
70INCLUDE_DIRS = \
71 -iquote.. \
72 -iquote $(BUILDDIR) \
Darin Petkov804e8d02012-10-10 16:44:36 +020073 $(shell $(PKG_CONFIG) --cflags \
Christopher Wiley0d05c112013-03-19 17:49:38 -070074 $(CRYPTO_UTIL_PC_DEPS) \
Darin Petkovfac01f02012-12-06 12:44:07 +010075 $(NET_DIAGS_UPLOAD_PC_DEPS) \
Paul Stewart1c9a5662013-02-12 09:41:33 -080076 $(NETFILTER_QUEUE_HELPER_PC_DEPS) \
Darin Petkov804e8d02012-10-10 16:44:36 +020077 $(NSS_GET_CERT_PC_DEPS) \
Darin Petkov804e8d02012-10-10 16:44:36 +020078 $(SHILL_PC_DEPS))
Darin Petkovd9050bb2012-09-26 16:02:52 +020079SHILL_LIBS = \
80 -lbootstat \
81 -lcares \
Darin Petkovd9050bb2012-09-26 16:02:52 +020082 -lmetrics \
83 -lminijail \
Daniel Erat0818cca2012-12-14 10:16:21 -080084 -lprotobuf-lite \
Chris Masonee016eb22013-03-09 16:45:05 -080085 -lrt \
Darin Petkovd9050bb2012-09-26 16:02:52 +020086 $(shell $(PKG_CONFIG) --libs $(SHILL_PC_DEPS))
Christopher Wiley0d05c112013-03-19 17:49:38 -070087CRYPTO_UTIL_LIBS = \
88 $(shell $(PKG_CONFIG) --libs $(CRYPTO_UTIL_PC_DEPS))
Darin Petkovfac01f02012-12-06 12:44:07 +010089NET_DIAGS_UPLOAD_LIBS = \
90 $(shell $(PKG_CONFIG) --libs $(NET_DIAGS_UPLOAD_PC_DEPS))
Paul Stewart1c9a5662013-02-12 09:41:33 -080091NETFILTER_QUEUE_HELPER_LIBS = \
92 $(shell $(PKG_CONFIG) --libs $(NETFILTER_QUEUE_HELPER_PC_DEPS))
Darin Petkovd9050bb2012-09-26 16:02:52 +020093NSS_GET_CERT_LIBS = $(shell $(PKG_CONFIG) --libs $(NSS_GET_CERT_PC_DEPS))
Chris Masone96832c32011-05-03 12:23:18 -070094
Darin Petkov4a09b6b2011-07-19 12:52:06 -070095DBUS_BINDINGS_DIR = dbus_bindings
Darin Petkov5236a8e2012-02-21 10:26:55 +010096BUILD_DBUS_BINDINGS_DIR = $(BUILDDIR)/shill/$(DBUS_BINDINGS_DIR)
Darin Petkov804e8d02012-10-10 16:44:36 +020097BUILD_DBUS_BINDINGS_SHIMS_DIR = $(BUILD_DBUS_BINDINGS_DIR)/shims
Darin Petkov5236a8e2012-02-21 10:26:55 +010098
Daniel Erat0818cca2012-12-14 10:16:21 -080099BUILD_PROTO_BINDINGS_DIR = $(BUILDDIR)/shill/proto_bindings
100
Darin Petkovd9050bb2012-09-26 16:02:52 +0200101BUILD_SHIMS_DIR = $(BUILDDIR)/shims
102
103_CREATE_BUILDDIR := $(shell mkdir -p \
104 $(BUILDDIR) \
105 $(BUILD_DBUS_BINDINGS_DIR) \
Darin Petkov804e8d02012-10-10 16:44:36 +0200106 $(BUILD_DBUS_BINDINGS_SHIMS_DIR) \
Daniel Erat0818cca2012-12-14 10:16:21 -0800107 $(BUILD_PROTO_BINDINGS_DIR)/power_manager \
Christopher Wiley5a3f23a2013-02-20 17:29:57 -0800108 $(BUILD_PROTO_BINDINGS_DIR)/shims/protos \
Darin Petkovd9050bb2012-09-26 16:02:52 +0200109 $(BUILD_SHIMS_DIR))
Darin Petkov4a09b6b2011-07-19 12:52:06 -0700110
Elly Jones5211a4c2012-01-26 19:25:20 -0500111DBUS_ADAPTOR_HEADERS :=
Chris Masone14de6e52011-05-09 09:20:59 -0700112
Darin Petkov567a7d02011-05-26 17:15:34 -0700113DBUS_PROXY_HEADERS = \
Darin Petkov18fb2f72012-06-14 09:09:34 +0200114 dbus-properties.h \
115 dbus-service.h \
Darin Petkov567a7d02011-05-26 17:15:34 -0700116 dhcpcd.h \
Darin Petkov394b7d42011-11-03 15:48:02 +0100117 power_manager.h \
Darin Petkov804e8d02012-10-10 16:44:36 +0200118 shims/flimflam-task.h \
Darin Petkov567a7d02011-05-26 17:15:34 -0700119 supplicant-bss.h \
120 supplicant-interface.h \
121 supplicant-network.h \
mukesh agrawalab87ea42011-05-18 11:44:49 -0700122 supplicant-process.h
Darin Petkov567a7d02011-05-26 17:15:34 -0700123
Darin Petkovf5f61e02011-07-29 11:35:40 -0700124# Generates rules for copying SYSROOT XMLs locally and updates the proxy header
125# dependencies.
126DBUS_BINDINGS_XML_SYSROOT = \
Darin Petkov096b3472012-05-15 10:26:22 +0200127 org.chromium.WiMaxManager>wimax_manager \
128 org.chromium.WiMaxManager.Device>wimax_manager-device \
Darin Petkovbd9f33a2013-03-20 10:38:07 +0100129 org.chromium.WiMaxManager.Network>wimax_manager-network
130
131# Rename local XML files with the names required by DBus to XML files with the
132# names required by the style guide, which will then be turned into generated
133# headers later.
134DBUS_BINDINGS_XML_LOCAL = \
135 org.chromium.flimflam.Device>flimflam-device \
136 org.chromium.flimflam.IPConfig>flimflam-ipconfig \
137 org.chromium.flimflam.Manager>flimflam-manager \
138 org.chromium.flimflam.Profile>flimflam-profile \
139 org.chromium.flimflam.Service>flimflam-service \
140 org.chromium.flimflam.Task>flimflam-task
141
142ifneq ($(SHILL_CELLULAR), 0)
143DBUS_PROXY_HEADERS += \
144 dbus-objectmanager.h \
145 modem-gobi.h
146
147DBUS_BINDINGS_XML_SYSROOT += \
Darin Petkovf5f61e02011-07-29 11:35:40 -0700148 org.freedesktop.ModemManager>modem_manager \
Darin Petkov1ec741c2011-08-02 10:45:27 -0700149 org.freedesktop.ModemManager.Modem>modem \
Darin Petkovf5f61e02011-07-29 11:35:40 -0700150 org.freedesktop.ModemManager.Modem.Cdma>modem-cdma \
151 org.freedesktop.ModemManager.Modem.Gsm.Card>modem-gsm-card \
152 org.freedesktop.ModemManager.Modem.Gsm.Network>modem-gsm-network \
Jason Glasgowee1081c2012-03-06 15:14:53 -0500153 org.freedesktop.ModemManager.Modem.Simple>modem-simple \
Arman Uguray6e5639f2012-11-15 20:30:19 -0800154 org.freedesktop.ModemManager1.Bearer>mm1-bearer \
Jason Glasgowee1081c2012-03-06 15:14:53 -0500155 org.freedesktop.ModemManager1.Modem>mm1-modem \
Arman Uguray2c39fab2012-12-12 16:56:34 -0800156 org.freedesktop.ModemManager1.Modem.Location>mm1-modem-location \
Jason Glasgowee1081c2012-03-06 15:14:53 -0500157 org.freedesktop.ModemManager1.Modem.Modem3gpp>mm1-modem-modem3gpp \
158 org.freedesktop.ModemManager1.Modem.ModemCdma>mm1-modem-modemcdma \
Jason Glasgow74f5ef22012-03-29 16:15:04 -0400159 org.freedesktop.ModemManager1.Modem.Simple>mm1-modem-simple \
Arman Uguray618af2b2012-12-11 19:20:42 -0800160 org.freedesktop.ModemManager1.Modem.Time>mm1-modem-time \
Darin Petkov096b3472012-05-15 10:26:22 +0200161 org.freedesktop.ModemManager1.Sim>mm1-sim
Darin Petkovbd9f33a2013-03-20 10:38:07 +0100162endif # SHILL_CELLULAR
Elly Jones5211a4c2012-01-26 19:25:20 -0500163
Darin Petkovf5f61e02011-07-29 11:35:40 -0700164define ADD_BINDING
165$(eval _SOURCE = $(word 1,$(subst >, ,$(1))))
166$(eval _TARGET = $(word 2,$(subst >, ,$(1))))
Darin Petkovf5f61e02011-07-29 11:35:40 -0700167DBUS_PROXY_HEADERS += $(_TARGET).h
Darin Petkov5236a8e2012-02-21 10:26:55 +0100168$(BUILD_DBUS_BINDINGS_DIR)/$(_TARGET).xml: \
Darin Petkovf5f61e02011-07-29 11:35:40 -0700169 $(SYSROOT)/usr/share/dbus-1/interfaces/$(_SOURCE).xml
170 cat $$< > $$@
171endef
172
Elly Jones5211a4c2012-01-26 19:25:20 -0500173define ADD_LOCAL_BINDING
174$(eval _SOURCE = $(word 1,$(subst >, ,$(1))))
175$(eval _TARGET = $(word 2,$(subst >, ,$(1))))
Elly Jones5211a4c2012-01-26 19:25:20 -0500176DBUS_ADAPTOR_HEADERS += $(_TARGET).h
Darin Petkov5236a8e2012-02-21 10:26:55 +0100177$(BUILD_DBUS_BINDINGS_DIR)/$(_TARGET).xml: $(DBUS_BINDINGS_DIR)/$(_SOURCE).xml
Elly Jones5211a4c2012-01-26 19:25:20 -0500178 cp $$< $$@
179endef
180
Darin Petkovf5f61e02011-07-29 11:35:40 -0700181$(foreach b,$(DBUS_BINDINGS_XML_SYSROOT),$(eval $(call ADD_BINDING,$(b))))
Elly Jones5211a4c2012-01-26 19:25:20 -0500182$(foreach b,$(DBUS_BINDINGS_XML_LOCAL),$(eval $(call ADD_LOCAL_BINDING,$(b))))
Darin Petkovf5f61e02011-07-29 11:35:40 -0700183
Darin Petkov4a09b6b2011-07-19 12:52:06 -0700184DBUS_ADAPTOR_BINDINGS = \
Darin Petkov5236a8e2012-02-21 10:26:55 +0100185 $(addprefix $(BUILD_DBUS_BINDINGS_DIR)/, $(DBUS_ADAPTOR_HEADERS))
186DBUS_PROXY_BINDINGS = \
187 $(addprefix $(BUILD_DBUS_BINDINGS_DIR)/, $(DBUS_PROXY_HEADERS))
Chris Masone96832c32011-05-03 12:23:18 -0700188
Daniel Erat0818cca2012-12-14 10:16:21 -0800189SYSTEM_API_PROTO_PATH = $(SYSROOT)/usr/include/chromeos/dbus
Christopher Wiley5a3f23a2013-02-20 17:29:57 -0800190SYSTEM_PROTO_BINDINGS_OBJS = $(addprefix $(BUILD_PROTO_BINDINGS_DIR)/, \
Daniel Erat0818cca2012-12-14 10:16:21 -0800191 power_manager/suspend.pb.o \
192 )
Christopher Wiley0d05c112013-03-19 17:49:38 -0700193CRYPTO_UTIL_PROTO_BINDINGS_OBJS = $(addprefix $(BUILD_PROTO_BINDINGS_DIR)/, \
Christopher Wiley5a3f23a2013-02-20 17:29:57 -0800194 shims/protos/crypto_util.pb.o \
195 )
Christopher Wiley0d05c112013-03-19 17:49:38 -0700196PROTO_BINDINGS_OBJS = \
197 $(SYSTEM_PROTO_BINDINGS_OBJS) \
198 $(CRYPTO_UTIL_PROTO_BINDINGS_OBJS)
199
Daniel Erat0818cca2012-12-14 10:16:21 -0800200PROTO_BINDINGS_H = $(PROTO_BINDINGS_OBJS:.o=.h)
Christopher Wiley5a3f23a2013-02-20 17:29:57 -0800201SYSTEM_PROTO_BINDINGS_CC = $(SYSTEM_PROTO_BINDINGS_OBJS:.o=.cc)
Christopher Wiley0d05c112013-03-19 17:49:38 -0700202SHIM_PROTO_BINDINGS_CC = $(CRYPTO_UTIL_PROTO_BINDINGS_OBJS:.o=.cc)
Daniel Erat0818cca2012-12-14 10:16:21 -0800203
Darin Petkovd9050bb2012-09-26 16:02:52 +0200204SHILL_LIB = $(BUILDDIR)/shill.a
Darin Petkov5236a8e2012-02-21 10:26:55 +0100205SHILL_OBJS = $(addprefix $(BUILDDIR)/, \
Arman Uguray26b7cf32013-02-17 13:56:12 -0800206 activating_iccid_store.o \
Paul Stewartac1328e2012-07-20 11:55:40 -0700207 arp_client.o \
Paul Stewart91a5aac2012-07-20 11:55:40 -0700208 arp_packet.o \
Paul Stewartf65320c2011-10-13 14:34:52 -0700209 async_connection.o \
repo sync90ee0fa2012-12-18 10:08:08 -0800210 attribute_list.o \
Paul Stewart3ecfa2b2011-07-15 10:47:42 -0700211 byte_string.o \
Wade Guthrie5020b572012-10-12 15:51:14 -0700212 callback80211_metrics.o \
Wade Guthrie64b4c142012-08-20 15:21:01 -0700213 callback80211_object.o \
Paul Stewart5baebb72013-03-14 11:43:29 -0700214 certificate_file.o \
Wade Guthrie0d438532012-05-18 14:18:50 -0700215 config80211.o \
Paul Stewartdd60e452011-08-08 11:38:36 -0700216 connection.o \
Wade Guthrief162f8b2013-02-27 14:13:55 -0800217 control_netlink_attribute.o \
Darin Petkov823c47e2011-06-27 16:15:35 -0700218 crypto_des_cbc.o \
Darin Petkov86964e02011-06-29 13:49:28 -0700219 crypto_provider.o \
Darin Petkov877642b2011-06-27 13:37:22 -0700220 crypto_rot47.o \
Chris Masoned0ceb8c2011-06-02 10:05:39 -0700221 dbus_adaptor.o \
Chris Masone96832c32011-05-03 12:23:18 -0700222 dbus_control.o \
Darin Petkov002c58e2012-06-19 02:56:05 +0200223 dbus_manager.o \
Darin Petkove0a312e2011-07-20 13:45:28 -0700224 dbus_properties.o \
Darin Petkov5c97ac52011-07-19 16:30:49 -0700225 dbus_properties_proxy.o \
Darin Petkov18fb2f72012-06-14 09:09:34 +0200226 dbus_service_proxy.o \
Chris Masone88cbd5f2011-07-03 14:30:04 -0700227 default_profile.o \
Christopher Wiley5a3f23a2013-02-20 17:29:57 -0800228 crypto_util_proxy.o \
Chris Masone96832c32011-05-03 12:23:18 -0700229 device.o \
Chris Masoned7732e42011-05-20 11:08:56 -0700230 device_dbus_adaptor.o \
Paul Stewart0af98bf2011-05-10 17:38:08 -0700231 device_info.o \
Darin Petkov50308cd2011-06-01 18:25:07 -0700232 dhcp_config.o \
233 dhcp_provider.o \
234 dhcpcd_proxy.o \
Darin Petkovf0136cd2012-11-07 16:18:02 +0100235 diagnostics_reporter.o \
Paul Stewartc2350ee2011-10-19 12:28:40 -0700236 dns_client.o \
mukesh agrawalb54601c2011-06-07 17:39:22 -0700237 endpoint.o \
Chris Masone7aa5f902011-07-11 11:13:35 -0700238 ephemeral_profile.o \
Chris Masone8fe2c7e2011-06-09 15:51:19 -0700239 error.o \
Paul Stewartb50f0b92011-05-16 16:31:42 -0700240 ethernet.o \
Paul Stewartf1ce5d22011-05-19 13:10:20 -0700241 ethernet_service.o \
Paul Stewart26b327e2011-10-19 11:38:09 -0700242 event_dispatcher.o \
Christopher Wileya59f7b92013-02-26 15:07:02 -0800243 file_io.o \
Arman Ugurayf4c61812013-01-10 18:58:39 -0800244 file_reader.o \
Gaurav Shah6d2c72d2012-10-16 16:30:44 -0700245 geolocation_info.o \
Darin Petkovf7897bc2011-06-08 17:13:36 -0700246 glib.o \
Paul Stewartf0aae102011-10-19 12:11:44 -0700247 glib_io_ready_handler.o \
248 glib_io_input_handler.o \
Gary Morainf80ef062012-05-16 14:57:04 -0700249 hook_table.o \
Paul Stewartf65320c2011-10-13 14:34:52 -0700250 http_proxy.o \
Paul Stewart188a84a2012-01-20 16:28:15 -0800251 http_request.o \
Paul Stewart95133562012-01-18 18:36:57 -0800252 http_url.o \
Paul Stewart1d18e8c2011-07-15 11:00:31 -0700253 ip_address.o \
Darin Petkove02b3ca2011-05-31 16:00:44 -0700254 ipconfig.o \
Chris Masonec6c6c132011-06-30 11:29:52 -0700255 ipconfig_dbus_adaptor.o \
Darin Petkov083047b2011-06-23 20:42:48 -0700256 key_file_store.o \
mukesh agrawal7a4e4002011-09-06 11:26:05 -0700257 key_value_store.o \
Paul Stewart3f43f432012-07-16 12:12:45 -0700258 link_monitor.o \
Chris Masone96832c32011-05-03 12:23:18 -0700259 manager.o \
Chris Masoned7732e42011-05-20 11:08:56 -0700260 manager_dbus_adaptor.o \
Christopher Wiley5781aa42012-07-30 14:42:23 -0700261 memory_log.o \
Thieu Le48e6d6d2011-12-06 00:40:27 +0000262 metrics.o \
Jorge Lucangeli Obesad43cc62012-04-11 16:25:43 -0700263 minijail.o \
Darin Petkov887f2982011-07-14 16:10:17 -0700264 modem_info.o \
Wade Guthrie0d438532012-05-18 14:18:50 -0700265 netlink_socket.o \
Wade Guthrief162f8b2013-02-27 14:13:55 -0800266 netlink_attribute.o \
Wade Guthrie16196242012-11-20 15:53:52 -0800267 nl80211_attribute.o \
repo syncdc085c82012-12-28 08:54:41 -0800268 nl80211_message.o \
Wade Guthrie0d438532012-05-18 14:18:50 -0700269 nl80211_socket.o \
Darin Petkov3c5e4dc2012-04-02 14:44:27 +0200270 nss.o \
Paul Stewarte6927402012-01-23 16:11:30 -0800271 portal_detector.o \
Gary Morain43bc6272012-01-30 14:01:15 -0800272 power_manager.o \
Darin Petkov394b7d42011-11-03 15:48:02 +0100273 power_manager_proxy.o \
Darin Petkov5a850472012-06-06 15:44:24 +0200274 process_killer.o \
Chris Masone52cd19b2011-06-29 17:23:04 -0700275 profile.o \
276 profile_dbus_adaptor.o \
Paul Stewart0756db92012-01-27 08:34:47 -0800277 profile_dbus_property_exporter.o \
Chris Masoneb925cc82011-06-22 15:39:57 -0700278 property_store.o \
Darin Petkovc90fe522011-07-15 13:59:47 -0700279 proxy_factory.o \
Paul Stewart75e89d22011-08-01 10:00:02 -0700280 routing_table.o \
Paul Stewartb6063942011-08-05 10:17:29 -0700281 resolver.o \
Eric Shienbrood3e20a232012-02-16 11:35:56 -0500282 rpc_task.o \
283 rpc_task_dbus_adaptor.o \
Paul Stewartf1ce5d22011-05-19 13:10:20 -0700284 rtnl_handler.o \
285 rtnl_listener.o \
Paul Stewartdd7df792011-07-15 11:09:50 -0700286 rtnl_message.o \
Ben Chanbc49ac72012-04-10 19:59:45 -0700287 scope_logger.o \
Chris Masone96832c32011-05-03 12:23:18 -0700288 service.o \
Chris Masoned7732e42011-05-20 11:08:56 -0700289 service_dbus_adaptor.o \
Paul Stewartc2350ee2011-10-19 12:28:40 -0700290 shill_ares.o \
Chris Masone96832c32011-05-03 12:23:18 -0700291 shill_config.o \
292 shill_daemon.o \
Chris Masoneb9c00592011-10-06 13:10:39 -0700293 shill_test_config.o \
Paul Stewartc2350ee2011-10-19 12:28:40 -0700294 shill_time.o \
Darin Petkov633ac6f2011-07-08 13:56:13 -0700295 sockets.o \
Paul Stewart1062d9d2012-04-27 10:42:27 -0700296 static_ip_parameters.o \
mukesh agrawalb20776f2012-02-10 16:00:36 -0800297 supplicant_bss_proxy.o \
mukesh agrawalaf571952011-07-14 14:31:12 -0700298 supplicant_interface_proxy.o \
Paul Stewart835934a2012-12-06 19:27:09 -0800299 supplicant_network_proxy.o \
mukesh agrawalaf571952011-07-14 14:31:12 -0700300 supplicant_process_proxy.o \
Paul Stewartfdd16072011-09-16 12:41:35 -0700301 technology.o \
Ben Chanb061f892013-02-27 17:46:55 -0800302 traffic_monitor.o \
mukesh agrawal93a29ed2012-04-17 16:13:01 -0700303 virtio_ethernet.o \
Darin Petkovf20994f2012-03-05 16:12:19 +0100304 vpn.o \
Darin Petkovb451d6e2012-04-23 11:56:41 +0200305 vpn_driver.o \
Darin Petkov33af05c2012-02-28 10:10:30 +0100306 vpn_provider.o \
307 vpn_service.o \
mukesh agrawalb54601c2011-06-07 17:39:22 -0700308 wifi.o \
309 wifi_endpoint.o \
Paul Stewart21f2aae2013-01-17 17:10:08 -0800310 wifi_provider.o \
mukesh agrawal6e277772011-09-29 15:04:23 -0700311 wifi_service.o \
Ben Chan99c8a4d2012-05-01 08:11:53 -0700312 wimax.o \
Darin Petkov096b3472012-05-15 10:26:22 +0200313 wimax_device_proxy.o \
314 wimax_manager_proxy.o \
Darin Petkov9893d9c2012-05-17 15:27:31 -0700315 wimax_network_proxy.o \
Darin Petkovb72b62e2012-05-15 16:55:36 +0200316 wimax_provider.o \
Ben Chan99c8a4d2012-05-01 08:11:53 -0700317 wimax_service.o \
Darin Petkov5236a8e2012-02-21 10:26:55 +0100318 wpa_supplicant.o \
Daniel Erat0818cca2012-12-14 10:16:21 -0800319 ) \
320 $(PROTO_BINDINGS_OBJS)
Chris Masone96832c32011-05-03 12:23:18 -0700321
322SHILL_BIN = shill
mukesh agrawal837bb562011-11-23 01:06:01 +0000323# Broken out separately, because (unlike other SHILL_OBJS), it
324# shouldn't be linked into TEST_BIN.
Darin Petkov5236a8e2012-02-21 10:26:55 +0100325SHILL_MAIN_OBJ = $(BUILDDIR)/shill_main.o
Chris Masone96832c32011-05-03 12:23:18 -0700326
327TEST_BIN = shill_unittest
Darin Petkov5236a8e2012-02-21 10:26:55 +0100328TEST_OBJS = $(addprefix $(BUILDDIR)/, \
Arman Uguray26b7cf32013-02-17 13:56:12 -0800329 activating_iccid_store_unittest.o \
Paul Stewartac1328e2012-07-20 11:55:40 -0700330 arp_client_unittest.o \
Paul Stewart91a5aac2012-07-20 11:55:40 -0700331 arp_packet_unittest.o \
Paul Stewartf65320c2011-10-13 14:34:52 -0700332 async_connection_unittest.o \
Paul Stewart3ecfa2b2011-07-15 10:47:42 -0700333 byte_string_unittest.o \
Paul Stewart5baebb72013-03-14 11:43:29 -0700334 certificate_file_unittest.o \
Darin Petkov823c47e2011-06-27 16:15:35 -0700335 crypto_des_cbc_unittest.o \
Darin Petkov86964e02011-06-29 13:49:28 -0700336 crypto_provider_unittest.o \
Darin Petkov877642b2011-06-27 13:37:22 -0700337 crypto_rot47_unittest.o \
Christopher Wiley5a3f23a2013-02-20 17:29:57 -0800338 crypto_util_proxy_unittest.o \
Wade Guthrie0d438532012-05-18 14:18:50 -0700339 config80211_unittest.o \
Paul Stewartdd60e452011-08-08 11:38:36 -0700340 connection_unittest.o \
Chris Masoned0ceb8c2011-06-02 10:05:39 -0700341 dbus_adaptor_unittest.o \
Darin Petkov002c58e2012-06-19 02:56:05 +0200342 dbus_manager_unittest.o \
Darin Petkove0a312e2011-07-20 13:45:28 -0700343 dbus_properties_unittest.o \
Chris Masone88cbd5f2011-07-03 14:30:04 -0700344 default_profile_unittest.o \
Darin Petkove02b3ca2011-05-31 16:00:44 -0700345 device_info_unittest.o \
Darin Petkovafa6fc42011-06-21 16:21:08 -0700346 device_unittest.o \
Darin Petkove7cb7f82011-06-03 13:21:51 -0700347 dhcp_config_unittest.o \
Darin Petkov98dd6a02011-06-10 15:12:57 -0700348 dhcp_provider_unittest.o \
Darin Petkovf0136cd2012-11-07 16:18:02 +0100349 diagnostics_reporter_unittest.o \
Paul Stewartc2350ee2011-10-19 12:28:40 -0700350 dns_client_unittest.o \
Darin Petkove4c0ace2011-08-24 10:32:46 -0700351 error_unittest.o \
Paul Stewartcf199de2012-08-16 07:50:41 -0700352 ethernet_service_unittest.o \
Arman Uguray26b7cf32013-02-17 13:56:12 -0800353 file_reader_unittest.o \
Gary Morainf80ef062012-05-16 14:57:04 -0700354 hook_table_unittest.o \
Paul Stewartf65320c2011-10-13 14:34:52 -0700355 http_proxy_unittest.o \
Paul Stewart188a84a2012-01-20 16:28:15 -0800356 http_request_unittest.o \
Paul Stewart95133562012-01-18 18:36:57 -0800357 http_url_unittest.o \
Paul Stewart1d18e8c2011-07-15 11:00:31 -0700358 ip_address_unittest.o \
Darin Petkove02b3ca2011-05-31 16:00:44 -0700359 ipconfig_unittest.o \
Darin Petkov083047b2011-06-23 20:42:48 -0700360 key_file_store_unittest.o \
Darin Petkov7f060332012-03-14 11:46:47 +0100361 key_value_store_unittest.o \
Paul Stewart3f43f432012-07-16 12:12:45 -0700362 link_monitor_unittest.o \
Darin Petkove02b3ca2011-05-31 16:00:44 -0700363 manager_unittest.o \
Christopher Wiley5781aa42012-07-30 14:42:23 -0700364 memory_log_unittest.o \
Thieu Le48e6d6d2011-12-06 00:40:27 +0000365 metrics_unittest.o \
Arman Ugurayc7b15602013-02-16 00:56:18 -0800366 mock_activating_iccid_store.o \
Chris Masone95207da2011-06-29 16:50:49 -0700367 mock_adaptors.o \
Paul Stewartc2350ee2011-10-19 12:28:40 -0700368 mock_ares.o \
Paul Stewartac1328e2012-07-20 11:55:40 -0700369 mock_arp_client.o \
Paul Stewartf65320c2011-10-13 14:34:52 -0700370 mock_async_connection.o \
Paul Stewart5baebb72013-03-14 11:43:29 -0700371 mock_certificate_file.o \
Paul Stewartc1dec4d2011-12-08 15:25:28 -0800372 mock_connection.o \
Darin Petkove02b3ca2011-05-31 16:00:44 -0700373 mock_control.o \
Darin Petkov2b8e44e2012-06-25 15:13:26 +0200374 mock_dbus_manager.o \
David Rochberg7cb06f62012-03-05 11:23:44 -0500375 mock_dbus_objectmanager_proxy.o \
Darin Petkov1bdedf12011-08-26 13:32:11 -0700376 mock_dbus_properties_proxy.o \
Darin Petkov18fb2f72012-06-14 09:09:34 +0200377 mock_dbus_service_proxy.o \
Chris Masonea82b7112011-05-25 15:16:29 -0700378 mock_device.o \
Darin Petkov1bdedf12011-08-26 13:32:11 -0700379 mock_device_info.o \
380 mock_dhcp_config.o \
381 mock_dhcp_provider.o \
382 mock_dhcp_proxy.o \
Darin Petkov385b9bc2012-12-03 15:25:05 +0100383 mock_diagnostics_reporter.o \
Paul Stewartf65320c2011-10-13 14:34:52 -0700384 mock_dns_client.o \
Paul Stewartcf199de2012-08-16 07:50:41 -0700385 mock_ethernet.o \
Paul Stewartc2350ee2011-10-19 12:28:40 -0700386 mock_event_dispatcher.o \
Darin Petkov1bdedf12011-08-26 13:32:11 -0700387 mock_glib.o \
Paul Stewarte6927402012-01-23 16:11:30 -0800388 mock_http_request.o \
Darin Petkovef34f182011-08-26 14:14:40 -0700389 mock_ipconfig.o \
Paul Stewart6c72c972012-07-27 11:29:20 -0700390 mock_link_monitor.o \
Gary Morain8a5726a2012-05-15 10:56:49 -0700391 mock_log.o \
392 mock_log_unittest.o \
Darin Petkovef34f182011-08-26 14:14:40 -0700393 mock_manager.o \
Thieu Le3426c8f2012-01-11 17:35:11 -0800394 mock_metrics.o \
Jorge Lucangeli Obesad43cc62012-04-11 16:25:43 -0700395 mock_minijail.o \
Paul Stewart8c116a92012-05-02 18:30:03 -0700396 mock_modem_info.o \
Darin Petkov3c5e4dc2012-04-02 14:44:27 +0200397 mock_nss.o \
Paul Stewartc681fa02012-03-02 19:40:04 -0800398 mock_portal_detector.o \
Gary Morainac1bdb42012-02-16 17:42:29 -0800399 mock_power_manager.o \
Darin Petkov394b7d42011-11-03 15:48:02 +0100400 mock_power_manager_proxy.o \
Darin Petkov5a850472012-06-06 15:44:24 +0200401 mock_process_killer.o \
Chris Masone7aa5f902011-07-11 11:13:35 -0700402 mock_profile.o \
Darin Petkovef34f182011-08-26 14:14:40 -0700403 mock_property_store.o \
Thieu Lefb46caf2012-03-08 11:57:15 -0800404 mock_proxy_factory.o \
Darin Petkoveac68e62011-08-26 16:24:51 -0700405 mock_resolver.o \
406 mock_routing_table.o \
Darin Petkovef34f182011-08-26 14:14:40 -0700407 mock_rtnl_handler.o \
Chris Masonea82b7112011-05-25 15:16:29 -0700408 mock_service.o \
Darin Petkovef34f182011-08-26 14:14:40 -0700409 mock_sockets.o \
Darin Petkoveac68e62011-08-26 16:24:51 -0700410 mock_store.o \
mukesh agrawalb20776f2012-02-10 16:00:36 -0800411 mock_supplicant_bss_proxy.o \
Darin Petkovef34f182011-08-26 14:14:40 -0700412 mock_supplicant_interface_proxy.o \
Paul Stewart835934a2012-12-06 19:27:09 -0800413 mock_supplicant_network_proxy.o \
Darin Petkovef34f182011-08-26 14:14:40 -0700414 mock_supplicant_process_proxy.o \
Paul Stewartc2350ee2011-10-19 12:28:40 -0700415 mock_time.o \
Ben Chanb061f892013-02-27 17:46:55 -0800416 mock_traffic_monitor.o \
Paul Stewart8c116a92012-05-02 18:30:03 -0700417 mock_vpn_provider.o \
mukesh agrawal7a4e4002011-09-06 11:26:05 -0700418 mock_wifi.o \
Paul Stewart3c504012013-01-17 17:49:58 -0800419 mock_wifi_provider.o \
mukesh agrawal7ec71312011-11-10 02:08:26 +0000420 mock_wifi_service.o \
Ben Chanc07362b2012-05-12 10:54:11 -0700421 mock_wimax.o \
Darin Petkov096b3472012-05-15 10:26:22 +0200422 mock_wimax_device_proxy.o \
423 mock_wimax_manager_proxy.o \
Darin Petkov9893d9c2012-05-17 15:27:31 -0700424 mock_wimax_network_proxy.o \
Darin Petkove4b27022012-05-16 13:28:50 +0200425 mock_wimax_provider.o \
Ben Chanc07362b2012-05-12 10:54:11 -0700426 mock_wimax_service.o \
Darin Petkov887f2982011-07-14 16:10:17 -0700427 modem_info_unittest.o \
mukesh agrawaldc42bb32011-07-28 10:40:26 -0700428 nice_mock_control.o \
Darin Petkov3c5e4dc2012-04-02 14:44:27 +0200429 nss_unittest.o \
Paul Stewarte6927402012-01-23 16:11:30 -0800430 portal_detector_unittest.o \
Gary Morain43bc6272012-01-30 14:01:15 -0800431 power_manager_unittest.o \
Darin Petkov5a850472012-06-06 15:44:24 +0200432 process_killer_unittest.o \
Paul Stewart0756db92012-01-27 08:34:47 -0800433 profile_dbus_property_exporter_unittest.o \
Darin Petkova4766822011-07-07 10:42:22 -0700434 profile_unittest.o \
Chris Masone27bf1032011-06-28 17:02:01 -0700435 property_accessor_unittest.o \
Chris Masoneb925cc82011-06-22 15:39:57 -0700436 property_store_unittest.o \
Paul Stewartb6063942011-08-05 10:17:29 -0700437 resolver_unittest.o \
Paul Stewart75e89d22011-08-01 10:00:02 -0700438 routing_table_unittest.o \
Darin Petkova9b1fed2012-02-29 11:49:05 +0100439 rpc_task_unittest.o \
Darin Petkove0a312e2011-07-20 13:45:28 -0700440 rtnl_handler_unittest.o \
Darin Petkovca432fc2011-07-08 15:56:57 -0700441 rtnl_listener_unittest.o \
Paul Stewartdd7df792011-07-15 11:09:50 -0700442 rtnl_message_unittest.o \
Ben Chanbc49ac72012-04-10 19:59:45 -0700443 scope_logger_unittest.o \
Chris Masone6515aab2011-10-12 16:19:09 -0700444 service_under_test.o \
Chris Masone3bd3c8c2011-06-13 08:20:26 -0700445 service_unittest.o \
Darin Petkove02b3ca2011-05-31 16:00:44 -0700446 shill_unittest.o \
Darin Petkovd9050bb2012-09-26 16:02:52 +0200447 shims/certificates_unittest.o \
Paul Stewart1c9a5662013-02-12 09:41:33 -0800448 shims/netfilter_queue_processor_unittest.o \
Paul Stewart1062d9d2012-04-27 10:42:27 -0700449 static_ip_parameters_unittest.o \
Ben Chanc12cf662012-04-05 14:47:18 -0700450 technology_unittest.o \
Ben Chanb061f892013-02-27 17:46:55 -0800451 traffic_monitor_unittest.o \
Chris Masone853b81b2011-06-24 14:11:41 -0700452 testrunner.o \
mukesh agrawal6e277772011-09-29 15:04:23 -0700453 wifi_endpoint_unittest.o \
Paul Stewart21f2aae2013-01-17 17:10:08 -0800454 wifi_provider_unittest.o \
Chris Masone34af2182011-08-22 11:59:36 -0700455 wifi_service_unittest.o \
Darin Petkov5236a8e2012-02-21 10:26:55 +0100456 wifi_unittest.o \
Darin Petkovb72b62e2012-05-15 16:55:36 +0200457 wimax_provider_unittest.o \
Ben Chanc07362b2012-05-12 10:54:11 -0700458 wimax_service_unittest.o \
459 wimax_unittest.o \
Paul Stewart0654ece2013-03-26 15:21:26 -0700460 wpa_supplicant_unittest.o \
Darin Petkov5236a8e2012-02-21 10:26:55 +0100461 )
Chris Masone96832c32011-05-03 12:23:18 -0700462
Christopher Wiley0d05c112013-03-19 17:49:38 -0700463CRYPTO_UTIL_MAIN_OBJ = $(BUILD_SHIMS_DIR)/crypto_util.o
464CRYPTO_UTIL_BIN = $(BUILD_SHIMS_DIR)/crypto-util
465
Darin Petkovbd0dcc82012-11-29 10:51:12 +0100466NET_DIAGS_UPLOAD_MAIN_OBJ = $(BUILD_SHIMS_DIR)/net_diags_upload.o
467NET_DIAGS_UPLOAD_BIN = $(BUILD_SHIMS_DIR)/net-diags-upload
468
Paul Stewart1c9a5662013-02-12 09:41:33 -0800469NETFILTER_QUEUE_HELPER_OBJS = $(BUILD_SHIMS_DIR)/netfilter_queue_processor.o
470NETFILTER_QUEUE_HELPER_MAIN_OBJ = $(BUILD_SHIMS_DIR)/netfilter_queue_helper.o
Paul Stewart3cb0adb2013-02-15 12:58:38 -0800471NETFILTER_QUEUE_HELPER_BIN = $(BUILD_SHIMS_DIR)/netfilter-queue-helper
Paul Stewart1c9a5662013-02-12 09:41:33 -0800472
Darin Petkovd9050bb2012-09-26 16:02:52 +0200473NSS_GET_CERT_OBJS = $(BUILD_SHIMS_DIR)/certificates.o
474NSS_GET_CERT_MAIN_OBJ = $(BUILD_SHIMS_DIR)/nss_get_cert.o
475NSS_GET_CERT_BIN = $(BUILD_SHIMS_DIR)/nss-get-cert
Darin Petkovc90fe522011-07-15 13:59:47 -0700476
Darin Petkov75f201f2013-03-19 13:01:28 +0100477WPA_SUPPLICANT_CONF = $(BUILD_SHIMS_DIR)/wpa_supplicant.conf
478
479# If SHILL_CELLULAR=0, don't build cellular support into shill.
480ifeq ($(SHILL_CELLULAR), 0)
481
482CPPFLAGS += -DDISABLE_CELLULAR
483
484else
485
486CELLULAR_PC_DEPS = ModemManager
487SET_APN_HELPER_PC_DEPS = dbus-1
488
489INCLUDE_DIRS += \
490 $(shell $(PKG_CONFIG) --cflags \
491 $(CELLULAR_PC_DEPS) \
492 $(SET_APN_HELPER_PC_DEPS))
493
494SET_APN_HELPER_LIBS = $(shell $(PKG_CONFIG) --libs $(SET_APN_HELPER_PC_DEPS))
495
496SHILL_LIBS += \
497 -lmobile-provider \
498 $(shell $(PKG_CONFIG) --libs $(CELLULAR_PC_DEPS))
499
500SHILL_OBJS += $(addprefix $(BUILDDIR)/, \
501 cellular.o \
502 cellular_capability.o \
503 cellular_capability_cdma.o \
504 cellular_capability_classic.o \
505 cellular_capability_gsm.o \
506 cellular_capability_universal.o \
Darin Petkovbd9f33a2013-03-20 10:38:07 +0100507 cellular_error.o \
Darin Petkov75f201f2013-03-19 13:01:28 +0100508 cellular_operator_info.o \
509 cellular_service.o \
Darin Petkovbd9f33a2013-03-20 10:38:07 +0100510 dbus_objectmanager_proxy.o \
Darin Petkov75f201f2013-03-19 13:01:28 +0100511 mm1_bearer_proxy.o \
512 mm1_modem_location_proxy.o \
513 mm1_modem_modem3gpp_proxy.o \
514 mm1_modem_modemcdma_proxy.o \
515 mm1_modem_proxy.o \
516 mm1_modem_simple_proxy.o \
517 mm1_modem_time_proxy.o \
518 mm1_sim_proxy.o \
519 modem.o \
520 modem_1.o \
521 modem_cdma_proxy.o \
522 modem_classic.o \
523 modem_gobi_proxy.o \
524 modem_gsm_card_proxy.o \
525 modem_gsm_network_proxy.o \
526 modem_manager.o \
527 modem_manager_1.o \
528 modem_manager_proxy.o \
529 modem_proxy.o \
530 modem_simple_proxy.o \
531 )
532
533TEST_OBJS += $(addprefix $(BUILDDIR)/, \
534 cellular_capability_cdma_unittest.o \
535 cellular_capability_classic_unittest.o \
536 cellular_capability_gsm_unittest.o \
537 cellular_capability_universal_unittest.o \
538 cellular_operator_info_unittest.o \
539 cellular_service_unittest.o \
540 cellular_unittest.o \
541 mock_cellular.o \
542 mock_mm1_bearer_proxy.o \
543 mock_mm1_modem_location_proxy.o \
544 mock_mm1_modem_modemcdma_proxy.o \
545 mock_mm1_modem_modem3gpp_proxy.o \
546 mock_mm1_modem_proxy.o \
547 mock_mm1_modem_simple_proxy.o \
548 mock_mm1_modem_time_proxy.o \
549 mock_mm1_sim_proxy.o \
550 mock_modem.o \
551 mock_modem_cdma_proxy.o \
552 mock_modem_gobi_proxy.o \
553 mock_modem_gsm_card_proxy.o \
554 mock_modem_gsm_network_proxy.o \
555 mock_modem_manager_proxy.o \
556 mock_modem_proxy.o \
557 mock_modem_simple_proxy.o \
558 mock_cellular_operator_info.o \
559 mock_cellular_service.o \
560 modem_1_unittest.o \
561 modem_manager_unittest.o \
562 modem_unittest.o \
563 )
564
Darin Petkovc3505a52013-03-18 15:13:29 +0100565SET_APN_HELPER_MAIN_OBJ = $(BUILD_SHIMS_DIR)/set_apn_helper.o
566SET_APN_HELPER_BIN = $(BUILD_SHIMS_DIR)/set-apn-helper
567
Darin Petkov75f201f2013-03-19 13:01:28 +0100568$(SET_APN_HELPER_BIN): $(SET_APN_HELPER_MAIN_OBJ)
569 $(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(SET_APN_HELPER_LIBS) -o $@
570
571endif # SHILL_CELLULAR=0
Darin Petkovc3505a52013-03-18 15:13:29 +0100572
573# If SHILL_VPN=0, don't build VPN support into shill.
574ifeq ($(SHILL_VPN), 0)
575
576CPPFLAGS += -DDISABLE_VPN
577
578else
579
580OPENVPN_SCRIPT_PC_DEPS = $(COMMON_PC_DEPS) dbus-c++-1
581PPPD_PLUGIN_PC_DEPS = $(COMMON_PC_DEPS) dbus-c++-1
582
583INCLUDE_DIRS += \
584 $(shell $(PKG_CONFIG) --cflags \
585 $(OPENVPN_SCRIPT_PC_DEPS) \
586 $(PPPD_PLUGIN_PC_DEPS))
587
588OPENVPN_SCRIPT_LIBS = $(shell $(PKG_CONFIG) --libs $(OPENVPN_SCRIPT_PC_DEPS))
589PPPD_PLUGIN_LIBS = $(shell $(PKG_CONFIG) --libs $(PPPD_PLUGIN_PC_DEPS))
590
Darin Petkov804e8d02012-10-10 16:44:36 +0200591OPENVPN_SCRIPT_OBJS = $(addprefix $(BUILD_SHIMS_DIR)/, \
592 environment.o \
593 task_proxy.o \
594 )
595OPENVPN_SCRIPT_MAIN_OBJ = $(BUILD_SHIMS_DIR)/openvpn_script.o
596OPENVPN_SCRIPT_BIN = $(BUILD_SHIMS_DIR)/openvpn-script
597
Darin Petkov16f63492012-10-23 11:12:58 +0200598PPPD_PLUGIN_OBJS = $(addprefix $(BUILD_SHIMS_DIR)/, \
Darin Petkov374b5ee2012-11-06 11:20:04 +0100599 c_ppp.pic.o \
600 environment.pic.o \
601 ppp.pic.o \
602 pppd_plugin.pic.o \
603 task_proxy.pic.o \
Darin Petkov16f63492012-10-23 11:12:58 +0200604 )
605PPPD_PLUGIN_SO = $(BUILD_SHIMS_DIR)/shill-pppd-plugin.so
606
Darin Petkovc3505a52013-03-18 15:13:29 +0100607SHILL_OBJS += $(addprefix $(BUILDDIR)/, \
608 l2tp_ipsec_driver.o \
609 openvpn_driver.o \
610 openvpn_management_server.o \
611 )
Darin Petkov16f63492012-10-23 11:12:58 +0200612
Darin Petkovc3505a52013-03-18 15:13:29 +0100613TEST_OBJS += $(addprefix $(BUILDDIR)/, \
614 l2tp_ipsec_driver_unittest.o \
615 mock_openvpn_driver.o \
616 mock_openvpn_management_server.o \
617 mock_vpn.o \
618 mock_vpn_driver.o \
619 mock_vpn_service.o \
620 openvpn_driver_unittest.o \
621 openvpn_management_server_unittest.o \
622 shims/environment_unittest.o \
623 vpn_driver_unittest.o \
624 vpn_provider_unittest.o \
625 vpn_service_unittest.o \
626 vpn_unittest.o \
627 )
628
629$(OPENVPN_SCRIPT_OBJS): $(DBUS_PROXY_BINDINGS)
630$(OPENVPN_SCRIPT_MAIN_OBJ): $(DBUS_PROXY_BINDINGS)
631
632$(OPENVPN_SCRIPT_BIN): $(OPENVPN_SCRIPT_MAIN_OBJ) $(OPENVPN_SCRIPT_OBJS)
633 $(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(OPENVPN_SCRIPT_LIBS) -o $@
634
635$(PPPD_PLUGIN_OBJS): $(DBUS_PROXY_BINDINGS)
636
637$(PPPD_PLUGIN_SO): $(PPPD_PLUGIN_OBJS)
638 $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $^ $(PPPD_PLUGIN_LIBS) -o $@
639
640endif # SHILL_VPN=0
Darin Petkov4c2aa332012-10-17 10:33:52 +0200641
Darin Petkovd9050bb2012-09-26 16:02:52 +0200642OBJS = \
Christopher Wiley0d05c112013-03-19 17:49:38 -0700643 $(CRYPTO_UTIL_MAIN_OBJ) \
Darin Petkovbd0dcc82012-11-29 10:51:12 +0100644 $(NET_DIAGS_UPLOAD_MAIN_OBJ) \
Paul Stewart1c9a5662013-02-12 09:41:33 -0800645 $(NETFILTER_QUEUE_HELPER_MAIN_OBJ) \
646 $(NETFILTER_QUEUE_HELPER_OBJS) \
Darin Petkovd9050bb2012-09-26 16:02:52 +0200647 $(NSS_GET_CERT_MAIN_OBJ) \
648 $(NSS_GET_CERT_OBJS) \
Darin Petkov804e8d02012-10-10 16:44:36 +0200649 $(OPENVPN_SCRIPT_MAIN_OBJ) \
650 $(OPENVPN_SCRIPT_OBJS) \
Darin Petkove6ca3202012-10-19 14:49:56 +0200651 $(PPPD_PLUGIN_OBJS) \
Darin Petkov16f63492012-10-23 11:12:58 +0200652 $(SET_APN_HELPER_MAIN_OBJ) \
Darin Petkovd9050bb2012-09-26 16:02:52 +0200653 $(SHILL_MAIN_OBJ) \
654 $(SHILL_OBJS) \
655 $(TEST_OBJS)
656
Gaurav Shahc8934572013-03-25 19:02:52 -0700657GTEST_LIBS := $(shell gmock-config --libs) $(shell gtest-config --libs)
Darin Petkov75f201f2013-03-19 13:01:28 +0100658TEST_LIBS = $(SHILL_LIBS) $(NSS_GET_CERT_LIBS) $(NETFILTER_QUEUE_HELPER_LIBS) \
Gaurav Shahc8934572013-03-25 19:02:52 -0700659 $(GTEST_LIBS)
Darin Petkov75f201f2013-03-19 13:01:28 +0100660
Darin Petkovd9050bb2012-09-26 16:02:52 +0200661.PHONY: all clean shims
662
663all: $(SHILL_BIN) $(TEST_BIN) shims
664
Darin Petkove6ca3202012-10-19 14:49:56 +0200665shims: \
Christopher Wiley0d05c112013-03-19 17:49:38 -0700666 $(CRYPTO_UTIL_BIN) \
Darin Petkovbd0dcc82012-11-29 10:51:12 +0100667 $(NET_DIAGS_UPLOAD_BIN) \
Paul Stewart1c9a5662013-02-12 09:41:33 -0800668 $(NETFILTER_QUEUE_HELPER_BIN) \
Darin Petkove6ca3202012-10-19 14:49:56 +0200669 $(NSS_GET_CERT_BIN) \
670 $(OPENVPN_SCRIPT_BIN) \
671 $(PPPD_PLUGIN_SO) \
Darin Petkov16f63492012-10-23 11:12:58 +0200672 $(SET_APN_HELPER_BIN) \
Darin Petkove6ca3202012-10-19 14:49:56 +0200673 $(WPA_SUPPLICANT_CONF)
Darin Petkov804e8d02012-10-10 16:44:36 +0200674
675$(BUILD_DBUS_BINDINGS_SHIMS_DIR)/flimflam-task.xml: \
676 $(BUILD_DBUS_BINDINGS_DIR)/flimflam-task.xml
677 cp $< $@
Chris Masone96832c32011-05-03 12:23:18 -0700678
Darin Petkov5236a8e2012-02-21 10:26:55 +0100679$(BUILD_DBUS_BINDINGS_DIR)/%.xml: $(DBUS_BINDINGS_DIR)/%.xml
680 cp $< $@
681
Darin Petkov4a09b6b2011-07-19 12:52:06 -0700682$(DBUS_PROXY_BINDINGS): %.h: %.xml
Darin Petkov005aa382011-11-17 14:26:21 +0100683 $(DBUSXX_XML2CPP) $< --proxy=$@ --sync --async
Chris Masone413a3192011-05-09 17:10:05 -0700684
Darin Petkov4a09b6b2011-07-19 12:52:06 -0700685$(DBUS_ADAPTOR_BINDINGS): %.h: %.xml
Chris Masone14de6e52011-05-09 09:20:59 -0700686 $(DBUSXX_XML2CPP) $< --adaptor=$@
687
Daniel Erat0818cca2012-12-14 10:16:21 -0800688$(PROTO_BINDINGS_H): %.h: %.cc ;
689
Christopher Wiley5a3f23a2013-02-20 17:29:57 -0800690$(SYSTEM_PROTO_BINDINGS_CC): \
Daniel Erat0818cca2012-12-14 10:16:21 -0800691 $(BUILD_PROTO_BINDINGS_DIR)/%.pb.cc: $(SYSTEM_API_PROTO_PATH)/%.proto
692 $(PROTOC) --proto_path=$(SYSTEM_API_PROTO_PATH) \
693 --cpp_out=$(BUILD_PROTO_BINDINGS_DIR) $<
694
Christopher Wiley5a3f23a2013-02-20 17:29:57 -0800695$(SHIM_PROTO_BINDINGS_CC): \
696 $(BUILD_PROTO_BINDINGS_DIR)/%.pb.cc: %.proto
697 $(PROTOC) --proto_path=./ --cpp_out=$(BUILD_PROTO_BINDINGS_DIR) $<
698
Darin Petkove6ca3202012-10-19 14:49:56 +0200699$(BUILDDIR)/%.o: %.c
700 $(CC) $(CPPFLAGS) $(CFLAGS) $(INCLUDE_DIRS) -MMD -c $< -o $@
701
Daniel Erat0818cca2012-12-14 10:16:21 -0800702$(PROTO_BINDINGS_OBJS): INCLUDE_DIRS += -iquote $(BUILD_PROTO_BINDINGS_DIR)
703
Darin Petkov5236a8e2012-02-21 10:26:55 +0100704$(BUILDDIR)/%.o: %.cc
mukesh agrawal837bb562011-11-23 01:06:01 +0000705 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDE_DIRS) -MMD -c $< -o $@
Chris Masone96832c32011-05-03 12:23:18 -0700706
Darin Petkov374b5ee2012-11-06 11:20:04 +0100707$(BUILDDIR)/%.pic.o: %.c
708 $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC $(INCLUDE_DIRS) -MMD -c $< -o $@
709
710$(BUILDDIR)/%.pic.o: %.cc
711 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -fPIC $(INCLUDE_DIRS) -MMD -c $< -o $@
712
Daniel Erat0818cca2012-12-14 10:16:21 -0800713$(SHILL_OBJS): \
714 $(DBUS_ADAPTOR_BINDINGS) \
715 $(DBUS_PROXY_BINDINGS) \
716 $(PROTO_BINDINGS_H)
Chris Masone14de6e52011-05-09 09:20:59 -0700717
Darin Petkovd9050bb2012-09-26 16:02:52 +0200718$(SHILL_LIB): $(SHILL_OBJS)
719 $(AR) rcs $@ $^
720
721$(SHILL_BIN): $(SHILL_MAIN_OBJ) $(SHILL_LIB)
722 $(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(SHILL_LIBS) -o $@
723
Christopher Wiley0d05c112013-03-19 17:49:38 -0700724$(CRYPTO_UTIL_BIN): $(CRYPTO_UTIL_MAIN_OBJ) $(CRYPTO_UTIL_PROTO_BINDINGS_OBJS)
725 $(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(CRYPTO_UTIL_LIBS) -o $@
726
Darin Petkovbd0dcc82012-11-29 10:51:12 +0100727$(NET_DIAGS_UPLOAD_BIN): $(NET_DIAGS_UPLOAD_MAIN_OBJ)
Darin Petkovfac01f02012-12-06 12:44:07 +0100728 $(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(NET_DIAGS_UPLOAD_LIBS) -o $@
Darin Petkovbd0dcc82012-11-29 10:51:12 +0100729
Paul Stewart1c9a5662013-02-12 09:41:33 -0800730$(NETFILTER_QUEUE_HELPER_BIN): \
731 $(NETFILTER_QUEUE_HELPER_MAIN_OBJ) \
732 $(NETFILTER_QUEUE_HELPER_OBJS)
733 $(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(NETFILTER_QUEUE_HELPER_LIBS) -o $@
734
Darin Petkovd9050bb2012-09-26 16:02:52 +0200735$(NSS_GET_CERT_BIN): $(NSS_GET_CERT_MAIN_OBJ) $(NSS_GET_CERT_OBJS) $(SHILL_LIB)
736 $(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(NSS_GET_CERT_LIBS) -o $@
Chris Masone96832c32011-05-03 12:23:18 -0700737
Darin Petkov4c2aa332012-10-17 10:33:52 +0200738$(WPA_SUPPLICANT_CONF): shims/wpa_supplicant.conf.in
739 sed s,@libdir@,$(LIBDIR), $^ > $@
740
Paul Stewart291a4732012-03-14 19:19:02 -0700741$(TEST_BIN): CPPFLAGS += -DUNIT_TEST -DSYSROOT=\"$(SYSROOT)\"
Darin Petkov804e8d02012-10-10 16:44:36 +0200742$(TEST_BIN): \
743 $(TEST_OBJS) \
Paul Stewart1c9a5662013-02-12 09:41:33 -0800744 $(NETFILTER_QUEUE_HELPER_OBJS) \
Darin Petkov804e8d02012-10-10 16:44:36 +0200745 $(NSS_GET_CERT_OBJS) \
746 $(OPENVPN_SCRIPT_OBJS) \
747 $(SHILL_LIB)
Darin Petkovd9050bb2012-09-26 16:02:52 +0200748 $(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(TEST_LIBS) -o $@
Chris Masone96832c32011-05-03 12:23:18 -0700749
750clean:
Darin Petkove604f702011-07-28 15:51:17 -0700751 rm -rf \
Darin Petkov5236a8e2012-02-21 10:26:55 +0100752 $(BUILDDIR) \
Darin Petkove604f702011-07-28 15:51:17 -0700753 $(SHILL_BIN) \
754 $(TEST_BIN)
mukesh agrawal837bb562011-11-23 01:06:01 +0000755
Darin Petkovd9050bb2012-09-26 16:02:52 +0200756-include $(OBJS:.o=.d)