blob: 49598a63017dc585bc4731251b25f2562f7a0939 [file] [log] [blame]
Peter Qiu7a420d32015-09-22 11:25:15 -07001#
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_RTTI_FLAG := -frtti
23 LOCAL_CLANG := true
24 LOCAL_SHARED_LIBRARIES += \
25 libchrome \
26 libchrome-dbus \
27 libchromeos \
28 libchromeos-dbus \
29 libchromeos-minijail \
30 libdbus \
31 libfirewalld-client \
32 libminijail \
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
46ifeq ($(HOST_OS),linux)
47
48# === libapmanager-client (shared library) ===
49include $(CLEAR_VARS)
50LOCAL_MODULE := libapmanager-client
51LOCAL_SRC_FILES := \
52 dbus_bindings/dbus-service-config.json \
53 dbus_bindings/org.chromium.apmanager.Config.dbus-xml \
54 dbus_bindings/org.chromium.apmanager.Device.dbus-xml \
55 dbus_bindings/org.chromium.apmanager.Manager.dbus-xml \
56 dbus_bindings/org.chromium.apmanager.Service.dbus-xml
57LOCAL_DBUS_PROXY_PREFIX := apmanager
58include $(BUILD_SHARED_LIBRARY)
59
60# === libapmanager (static library) ===
61include $(CLEAR_VARS)
62LOCAL_MODULE := libapmanager
63LOCAL_SRC_FILES := \
64 dbus_bindings/dbus-service-config.json \
65 dbus_bindings/org.chromium.apmanager.Config.dbus-xml \
66 dbus_bindings/org.chromium.apmanager.Device.dbus-xml \
67 dbus_bindings/org.chromium.apmanager.Manager.dbus-xml \
68 dbus_bindings/org.chromium.apmanager.Service.dbus-xml \
69 config.cc \
70 daemon.cc \
71 device.cc \
72 device_info.cc \
73 dhcp_server.cc \
74 dhcp_server_factory.cc \
75 event_dispatcher.cc \
76 file_writer.cc \
77 firewall_manager.cc \
78 firewalld_dbus_proxy.cc \
79 hostapd_monitor.cc \
80 manager.cc \
81 process_factory.cc \
82 service.cc \
83 shill_manager.cc \
84 shill_stub_proxy.cc
85$(eval $(apmanager_common))
86include $(BUILD_STATIC_TEST_LIBRARY)
87
88# === apmanager ===
89include $(CLEAR_VARS)
90LOCAL_MODULE := apmanager
Peter Qiu8070c3a2015-09-28 14:26:25 -070091LOCAL_INIT_RC := apmanager.rc
Peter Qiu7a420d32015-09-22 11:25:15 -070092LOCAL_SRC_FILES := \
93 main.cc
94LOCAL_STATIC_LIBRARIES := libapmanager
95LOCAL_C_INCLUDES += external/gtest/include
96$(eval $(apmanager_common))
97include $(BUILD_EXECUTABLE)
98
Peter Qiu7a420d32015-09-22 11:25:15 -070099# === unittest ===
100include $(CLEAR_VARS)
101LOCAL_MODULE := apmanager_unittest
102LOCAL_SRC_FILES := \
103 config_unittest.cc \
104 device_info_unittest.cc \
105 device_unittest.cc \
106 dhcp_server_unittest.cc \
107 hostapd_monitor_unittest.cc \
108 manager_unittest.cc \
109 mock_config.cc \
110 mock_device.cc \
111 mock_dhcp_server.cc \
112 mock_dhcp_server_factory.cc \
113 mock_event_dispatcher.cc \
114 mock_file_writer.cc \
115 mock_hostapd_monitor.cc \
116 mock_manager.cc \
117 mock_process_factory.cc \
118 mock_service.cc \
119 service_unittest.cc \
120 run_all_tests.cc
121LOCAL_STATIC_LIBRARIES := libapmanager libgmock
122$(eval $(apmanager_common))
123include $(BUILD_NATIVE_TEST)
124
125endif # HOST_OS == linux