• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright (C) 2015 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17LOCAL_PATH := $(call my-dir)
18
19# Definitions applying to all targets. Be sure to $(eval) this last.
20define apmanager_common
21  LOCAL_CPP_EXTENSION := .cc
22  LOCAL_CLANG := true
23  LOCAL_SHARED_LIBRARIES += \
24      libbrillo \
25      libbrillo-dbus \
26      libbrillo-minijail \
27      libchrome \
28      libchrome-dbus \
29      libdbus \
30      libfirewalld-client \
31      libminijail \
32      libshill-client \
33      libshill-net
34  LOCAL_C_INCLUDES += \
35      $(LOCAL_PATH)/.. \
36      external/cros/system_api    # D-Bus service constants.
37  LOCAL_CFLAGS += -Wall -Werror -Wno-unused-parameter
38  # -Wno-non-virtual-dtor: for generated D-Bus adaptors.
39  # -Wno-missing-field-initializers: for LAZY_INSTANCE_INITIALIZER.
40  LOCAL_CPPFLAGS += \
41      -Wno-sign-promo \
42      -Wno-non-virtual-dtor \
43      -Wno-missing-field-initializers
44endef
45
46# === libapmanager-client (shared library) ===
47include $(CLEAR_VARS)
48LOCAL_MODULE := libapmanager-client
49LOCAL_SRC_FILES := \
50    dbus_bindings/dbus-service-config.json \
51    dbus_bindings/org.chromium.apmanager.Config.dbus-xml \
52    dbus_bindings/org.chromium.apmanager.Device.dbus-xml \
53    dbus_bindings/org.chromium.apmanager.Manager.dbus-xml \
54    dbus_bindings/org.chromium.apmanager.Service.dbus-xml
55LOCAL_DBUS_PROXY_PREFIX := apmanager
56include $(BUILD_SHARED_LIBRARY)
57
58# === libapmanager (static library) ===
59include $(CLEAR_VARS)
60LOCAL_MODULE := libapmanager
61LOCAL_SRC_FILES := \
62    dbus_bindings/dbus-service-config.json \
63    dbus_bindings/org.chromium.apmanager.Config.dbus-xml \
64    dbus_bindings/org.chromium.apmanager.Device.dbus-xml \
65    dbus_bindings/org.chromium.apmanager.Manager.dbus-xml \
66    dbus_bindings/org.chromium.apmanager.Service.dbus-xml \
67    config.cc \
68    daemon.cc \
69    dbus/config_dbus_adaptor.cc \
70    dbus/dbus_control.cc \
71    dbus/device_dbus_adaptor.cc \
72    dbus/firewalld_dbus_proxy.cc \
73    dbus/manager_dbus_adaptor.cc \
74    dbus/service_dbus_adaptor.cc \
75    dbus/shill_dbus_proxy.cc \
76    device.cc \
77    device_info.cc \
78    dhcp_server.cc \
79    dhcp_server_factory.cc \
80    error.cc \
81    event_dispatcher.cc \
82    file_writer.cc \
83    firewall_manager.cc \
84    hostapd_monitor.cc \
85    manager.cc \
86    process_factory.cc \
87    service.cc \
88    shill_manager.cc
89$(eval $(apmanager_common))
90include $(BUILD_STATIC_TEST_LIBRARY)
91
92# === apmanager ===
93include $(CLEAR_VARS)
94LOCAL_MODULE := apmanager
95LOCAL_INIT_RC := apmanager.rc
96LOCAL_SRC_FILES := \
97    main.cc
98LOCAL_STATIC_LIBRARIES := libapmanager
99LOCAL_C_INCLUDES += external/gtest/include
100$(eval $(apmanager_common))
101include $(BUILD_EXECUTABLE)
102
103# === apmanager_test ===
104include $(CLEAR_VARS)
105LOCAL_MODULE := apmanager_test
106ifdef BRILLO
107  LOCAL_MODULE_TAGS := eng
108endif # BRILLO
109LOCAL_SRC_FILES := \
110    config_unittest.cc \
111    device_info_unittest.cc \
112    device_unittest.cc \
113    dhcp_server_unittest.cc \
114    error_unittest.cc \
115    fake_config_adaptor.cc \
116    fake_device_adaptor.cc \
117    hostapd_monitor_unittest.cc \
118    manager_unittest.cc \
119    mock_config.cc \
120    mock_control.cc \
121    mock_device.cc \
122    mock_dhcp_server.cc \
123    mock_dhcp_server_factory.cc \
124    mock_event_dispatcher.cc \
125    mock_file_writer.cc \
126    mock_hostapd_monitor.cc \
127    mock_manager.cc \
128    mock_process_factory.cc \
129    mock_service.cc \
130    mock_service_adaptor.cc \
131    service_unittest.cc \
132    run_all_tests.cc
133LOCAL_STATIC_LIBRARIES := libapmanager libgmock
134$(eval $(apmanager_common))
135include $(BUILD_NATIVE_TEST)
136