David Zeuthen | 21e9526 | 2016-07-27 17:58:40 -0400 | [diff] [blame] | 1 | # |
David Zeuthen | c612e2e | 2016-09-16 16:44:08 -0400 | [diff] [blame] | 2 | # Copyright 2016, The Android Open Source Project |
David Zeuthen | 21e9526 | 2016-07-27 17:58:40 -0400 | [diff] [blame] | 3 | # |
David Zeuthen | c612e2e | 2016-09-16 16:44:08 -0400 | [diff] [blame] | 4 | # Permission is hereby granted, free of charge, to any person |
| 5 | # obtaining a copy of this software and associated documentation |
| 6 | # files (the "Software"), to deal in the Software without |
| 7 | # restriction, including without limitation the rights to use, copy, |
| 8 | # modify, merge, publish, distribute, sublicense, and/or sell copies |
| 9 | # of the Software, and to permit persons to whom the Software is |
| 10 | # furnished to do so, subject to the following conditions: |
David Zeuthen | 21e9526 | 2016-07-27 17:58:40 -0400 | [diff] [blame] | 11 | # |
David Zeuthen | c612e2e | 2016-09-16 16:44:08 -0400 | [diff] [blame] | 12 | # The above copyright notice and this permission notice shall be |
| 13 | # included in all copies or substantial portions of the Software. |
David Zeuthen | 21e9526 | 2016-07-27 17:58:40 -0400 | [diff] [blame] | 14 | # |
David Zeuthen | c612e2e | 2016-09-16 16:44:08 -0400 | [diff] [blame] | 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 16 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 17 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 18 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 19 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 20 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 21 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | # SOFTWARE. |
David Zeuthen | 21e9526 | 2016-07-27 17:58:40 -0400 | [diff] [blame] | 23 | # |
| 24 | |
| 25 | LOCAL_PATH := $(my-dir) |
| 26 | |
| 27 | avb_common_cflags := \ |
| 28 | -D_FILE_OFFSET_BITS=64 \ |
| 29 | -D_POSIX_C_SOURCE=199309L \ |
| 30 | -Wa,--noexecstack \ |
| 31 | -Werror \ |
| 32 | -Wall \ |
| 33 | -Wextra \ |
| 34 | -Wformat=2 \ |
| 35 | -Wno-psabi \ |
| 36 | -Wno-unused-parameter \ |
| 37 | -ffunction-sections \ |
| 38 | -fstack-protector-strong \ |
| 39 | -fvisibility=hidden |
| 40 | avb_common_cppflags := \ |
| 41 | -Wnon-virtual-dtor \ |
| 42 | -fno-strict-aliasing |
| 43 | avb_common_ldflags := \ |
| 44 | -Wl,--gc-sections |
| 45 | |
| 46 | include $(CLEAR_VARS) |
| 47 | LOCAL_SRC_FILES := avbtool |
| 48 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 49 | LOCAL_IS_HOST_MODULE := true |
| 50 | LOCAL_MODULE := avbtool |
| 51 | include $(BUILD_PREBUILT) |
| 52 | |
| 53 | # Build for the target (for e.g. fs_mgr usage). |
| 54 | include $(CLEAR_VARS) |
| 55 | LOCAL_MODULE := libavb |
| 56 | LOCAL_MODULE_HOST_OS := linux |
| 57 | LOCAL_EXPORT_C_INDLUDE_DIRS := $(LOCAL_PATH)/libavb |
| 58 | LOCAL_CLANG := true |
| 59 | LOCAL_CFLAGS := $(avb_common_cflags) -fno-stack-protector -DAVB_ENABLE_DEBUG -DAVB_COMPILATION |
| 60 | LOCAL_LDFLAGS := $(avb_common_ldflags) |
| 61 | LOCAL_C_INCLUDES := |
| 62 | LOCAL_SRC_FILES := \ |
David Zeuthen | 8b6973b | 2016-09-20 12:39:49 -0400 | [diff] [blame^] | 63 | libavb/avb_ab_flow.c \ |
David Zeuthen | 21e9526 | 2016-07-27 17:58:40 -0400 | [diff] [blame] | 64 | libavb/avb_chain_partition_descriptor.c \ |
David Zeuthen | 8b6973b | 2016-09-20 12:39:49 -0400 | [diff] [blame^] | 65 | libavb/avb_crc32.c \ |
David Zeuthen | 21e9526 | 2016-07-27 17:58:40 -0400 | [diff] [blame] | 66 | libavb/avb_crypto.c \ |
| 67 | libavb/avb_descriptor.c \ |
| 68 | libavb/avb_footer.c \ |
| 69 | libavb/avb_hash_descriptor.c \ |
| 70 | libavb/avb_hashtree_descriptor.c \ |
| 71 | libavb/avb_kernel_cmdline_descriptor.c \ |
| 72 | libavb/avb_property_descriptor.c \ |
| 73 | libavb/avb_rsa.c \ |
| 74 | libavb/avb_sha256.c \ |
| 75 | libavb/avb_sha512.c \ |
| 76 | libavb/avb_slot_verify.c \ |
| 77 | libavb/avb_sysdeps_posix.c \ |
| 78 | libavb/avb_util.c \ |
| 79 | libavb/avb_vbmeta_image.c |
| 80 | include $(BUILD_SHARED_LIBRARY) |
| 81 | |
| 82 | # Build for the host (for unit tests). |
| 83 | include $(CLEAR_VARS) |
| 84 | LOCAL_MODULE := libavb_host |
| 85 | LOCAL_MODULE_HOST_OS := linux |
| 86 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 87 | LOCAL_CLANG := true |
| 88 | LOCAL_CFLAGS := $(avb_common_cflags) -fno-stack-protector -DAVB_ENABLE_DEBUG -DAVB_COMPILATION |
| 89 | LOCAL_LDFLAGS := $(avb_common_ldflags) |
| 90 | LOCAL_C_INCLUDES := |
| 91 | LOCAL_SRC_FILES := \ |
David Zeuthen | 8b6973b | 2016-09-20 12:39:49 -0400 | [diff] [blame^] | 92 | libavb/avb_ab_flow.c \ |
David Zeuthen | 21e9526 | 2016-07-27 17:58:40 -0400 | [diff] [blame] | 93 | libavb/avb_chain_partition_descriptor.c \ |
David Zeuthen | 8b6973b | 2016-09-20 12:39:49 -0400 | [diff] [blame^] | 94 | libavb/avb_crc32.c \ |
David Zeuthen | 21e9526 | 2016-07-27 17:58:40 -0400 | [diff] [blame] | 95 | libavb/avb_crypto.c \ |
| 96 | libavb/avb_descriptor.c \ |
| 97 | libavb/avb_footer.c \ |
| 98 | libavb/avb_hash_descriptor.c \ |
| 99 | libavb/avb_hashtree_descriptor.c \ |
| 100 | libavb/avb_kernel_cmdline_descriptor.c \ |
| 101 | libavb/avb_property_descriptor.c \ |
| 102 | libavb/avb_rsa.c \ |
| 103 | libavb/avb_sha256.c \ |
| 104 | libavb/avb_sha512.c \ |
| 105 | libavb/avb_slot_verify.c \ |
| 106 | libavb/avb_util.c \ |
| 107 | libavb/avb_vbmeta_image.c |
| 108 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 109 | |
| 110 | include $(CLEAR_VARS) |
| 111 | LOCAL_MODULE := libavb_host_sysdeps |
| 112 | LOCAL_MODULE_HOST_OS := linux |
| 113 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 114 | LOCAL_CLANG := true |
| 115 | LOCAL_CFLAGS := $(avb_common_cflags) -DAVB_ENABLE_DEBUG -DAVB_COMPILATION |
| 116 | LOCAL_LDFLAGS := $(avb_common_ldflags) |
| 117 | LOCAL_C_INCLUDES := |
| 118 | LOCAL_SRC_FILES := \ |
| 119 | libavb/avb_sysdeps_posix.c |
| 120 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 121 | |
| 122 | include $(CLEAR_VARS) |
| 123 | LOCAL_MODULE := libavb_host_unittest |
David Zeuthen | a4fee8b | 2016-08-22 15:20:43 -0400 | [diff] [blame] | 124 | LOCAL_REQUIRED_MODULES := simg2img img2simg |
David Zeuthen | 21e9526 | 2016-07-27 17:58:40 -0400 | [diff] [blame] | 125 | LOCAL_MODULE_HOST_OS := linux |
| 126 | LOCAL_CPP_EXTENSION := .cc |
| 127 | LOCAL_CLANG := true |
| 128 | LOCAL_CFLAGS := $(avb_common_cflags) -DAVB_ENABLE_DEBUG -DAVB_COMPILATION |
| 129 | LOCAL_CPPFLAGS := $(avb_common_cppflags) |
| 130 | LOCAL_LDFLAGS := $(avb_common_ldflags) |
| 131 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/libavb external/gtest/include |
| 132 | LOCAL_STATIC_LIBRARIES := \ |
| 133 | libavb_host \ |
| 134 | libavb_host_sysdeps \ |
| 135 | libgmock_host \ |
| 136 | libgtest_host |
| 137 | LOCAL_SHARED_LIBRARIES := \ |
| 138 | libchrome |
| 139 | LOCAL_SRC_FILES := \ |
David Zeuthen | 8b6973b | 2016-09-20 12:39:49 -0400 | [diff] [blame^] | 140 | test/avb_ab_flow_unittest.cc \ |
David Zeuthen | 21e9526 | 2016-07-27 17:58:40 -0400 | [diff] [blame] | 141 | test/avb_slot_verify_unittest.cc \ |
| 142 | test/avb_util_unittest.cc \ |
| 143 | test/avb_vbmeta_image_unittest.cc \ |
David Zeuthen | 8b6973b | 2016-09-20 12:39:49 -0400 | [diff] [blame^] | 144 | test/avbtool_unittest.cc \ |
| 145 | test/fake_avb_ops.cc |
David Zeuthen | 21e9526 | 2016-07-27 17:58:40 -0400 | [diff] [blame] | 146 | LOCAL_LDLIBS_linux := -lrt |
| 147 | include $(BUILD_HOST_NATIVE_TEST) |
| 148 | |
| 149 | include $(CLEAR_VARS) |
David Zeuthen | 8b6973b | 2016-09-20 12:39:49 -0400 | [diff] [blame^] | 150 | LOCAL_MODULE := bootctrl.avb |
| 151 | LOCAL_MODULE_RELATIVE_PATH := hw |
| 152 | LOCAL_REQUIRED_MODULES := libavb |
| 153 | LOCAL_SRC_FILES := \ |
| 154 | boot_control/boot_control_avb.c \ |
| 155 | boot_control/avb_ops_device.c \ |
| 156 | libavb/avb_sysdeps_posix.c |
| 157 | LOCAL_CLANG := true |
| 158 | LOCAL_CFLAGS := $(avb_common_cflags) -DAVB_COMPILATION |
| 159 | LOCAL_LDFLAGS := $(avb_common_ldflags) |
| 160 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/libavb |
| 161 | LOCAL_SHARED_LIBRARIES := libcutils |
| 162 | LOCAL_STATIC_LIBRARIES := libfs_mgr |
| 163 | include $(BUILD_SHARED_LIBRARY) |
| 164 | |
| 165 | include $(CLEAR_VARS) |
David Zeuthen | 21e9526 | 2016-07-27 17:58:40 -0400 | [diff] [blame] | 166 | LOCAL_SRC_FILES := libavb_host_symbols_test |
| 167 | LOCAL_MODULE_TAGS := debug |
| 168 | LOCAL_ADDITIONAL_DEPENDENCIES := libavb_host |
| 169 | include $(BUILD_HOST_PREBUILT) |