Peter Qiu | 7a420d3 | 2015-09-22 11:25:15 -0700 | [diff] [blame] | 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 | |
| 17 | LOCAL_PATH := $(call my-dir) |
| 18 | |
| 19 | # Definitions applying to all targets. Be sure to $(eval) this last. |
| 20 | define 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 |
| 44 | endef |
| 45 | |
| 46 | ifeq ($(HOST_OS),linux) |
| 47 | |
| 48 | # === libapmanager-client (shared library) === |
| 49 | include $(CLEAR_VARS) |
| 50 | LOCAL_MODULE := libapmanager-client |
| 51 | LOCAL_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 |
| 57 | LOCAL_DBUS_PROXY_PREFIX := apmanager |
| 58 | include $(BUILD_SHARED_LIBRARY) |
| 59 | |
| 60 | # === libapmanager (static library) === |
| 61 | include $(CLEAR_VARS) |
| 62 | LOCAL_MODULE := libapmanager |
| 63 | LOCAL_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)) |
| 86 | include $(BUILD_STATIC_TEST_LIBRARY) |
| 87 | |
| 88 | # === apmanager === |
| 89 | include $(CLEAR_VARS) |
| 90 | LOCAL_MODULE := apmanager |
Peter Qiu | 8070c3a | 2015-09-28 14:26:25 -0700 | [diff] [blame] | 91 | LOCAL_INIT_RC := apmanager.rc |
Peter Qiu | 7a420d3 | 2015-09-22 11:25:15 -0700 | [diff] [blame] | 92 | LOCAL_SRC_FILES := \ |
| 93 | main.cc |
| 94 | LOCAL_STATIC_LIBRARIES := libapmanager |
| 95 | LOCAL_C_INCLUDES += external/gtest/include |
| 96 | $(eval $(apmanager_common)) |
| 97 | include $(BUILD_EXECUTABLE) |
| 98 | |
Peter Qiu | 7a420d3 | 2015-09-22 11:25:15 -0700 | [diff] [blame] | 99 | # === unittest === |
| 100 | include $(CLEAR_VARS) |
| 101 | LOCAL_MODULE := apmanager_unittest |
| 102 | LOCAL_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 |
| 121 | LOCAL_STATIC_LIBRARIES := libapmanager libgmock |
| 122 | $(eval $(apmanager_common)) |
| 123 | include $(BUILD_NATIVE_TEST) |
| 124 | |
| 125 | endif # HOST_OS == linux |