1 # 2 # Copyright (C) 2009 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 # This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS 20 # which varies depending on what is being built. 21 define keystore_proto_include 22 $(call local-generated-sources-dir)/proto/$(LOCAL_PATH) 23 endef 24 25 include $(CLEAR_VARS) 26 ifeq ($(USE_32_BIT_KEYSTORE), true) 27 LOCAL_MULTILIB := 32 28 endif 29 LOCAL_CFLAGS := -Wall -Wextra -Werror -Wunused 30 LOCAL_SRC_FILES := \ 31 auth_token_table.cpp \ 32 blob.cpp \ 33 entropy.cpp \ 34 key_store_service.cpp \ 35 keyblob_utils.cpp \ 36 keystore.cpp \ 37 keystore_main.cpp \ 38 keystore_utils.cpp \ 39 operation.cpp \ 40 permissions.cpp \ 41 user_state.cpp 42 LOCAL_SHARED_LIBRARIES := \ 43 libbinder \ 44 libcutils \ 45 libcrypto \ 46 libhardware \ 47 libkeystore_binder \ 48 liblog \ 49 libsoftkeymaster \ 50 libutils \ 51 libselinux \ 52 libsoftkeymasterdevice \ 53 libkeymaster_messages \ 54 libkeymaster1 55 LOCAL_MODULE := keystore 56 LOCAL_MODULE_TAGS := optional 57 LOCAL_INIT_RC := keystore.rc 58 LOCAL_C_INCLUES := system/keymaster/ 59 LOCAL_CLANG := true 60 LOCAL_SANITIZE := integer 61 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 62 include $(BUILD_EXECUTABLE) 63 64 include $(CLEAR_VARS) 65 ifeq ($(USE_32_BIT_KEYSTORE), true) 66 LOCAL_MULTILIB := 32 67 endif 68 LOCAL_CFLAGS := -Wall -Wextra -Werror 69 LOCAL_SRC_FILES := keystore_cli.cpp 70 LOCAL_SHARED_LIBRARIES := libcutils libcrypto libkeystore_binder libutils liblog libbinder 71 LOCAL_MODULE := keystore_cli 72 LOCAL_MODULE_TAGS := debug 73 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 74 include $(BUILD_EXECUTABLE) 75 76 include $(CLEAR_VARS) 77 ifeq ($(USE_32_BIT_KEYSTORE), true) 78 LOCAL_MULTILIB := 32 79 endif 80 LOCAL_CFLAGS := -Wall -Wextra -Werror -Wno-unused-parameter -DKEYMASTER_NAME_TAGS 81 LOCAL_SRC_FILES := keystore_cli_v2.cpp 82 LOCAL_SHARED_LIBRARIES := \ 83 libchrome \ 84 libkeymaster_messages \ 85 libkeystore_binder 86 LOCAL_MODULE := keystore_cli_v2 87 LOCAL_MODULE_TAGS := debug 88 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include external/gtest/include 89 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 90 include $(BUILD_EXECUTABLE) 91 92 # Library for keystore clients 93 include $(CLEAR_VARS) 94 ifeq ($(USE_32_BIT_KEYSTORE), true) 95 LOCAL_MULTILIB := 32 96 endif 97 LOCAL_CFLAGS := -Wall -Wextra -Werror 98 LOCAL_SRC_FILES := \ 99 IKeystoreService.cpp \ 100 keyblob_utils.cpp \ 101 keystore_client.proto \ 102 keystore_client_impl.cpp \ 103 keystore_get.cpp 104 LOCAL_SHARED_LIBRARIES := \ 105 libbinder \ 106 libkeymaster_messages \ 107 liblog \ 108 libprotobuf-cpp-lite \ 109 libsoftkeymasterdevice \ 110 libutils 111 LOCAL_MODULE_CLASS := SHARED_LIBRARIES 112 LOCAL_MODULE := libkeystore_binder 113 LOCAL_MODULE_TAGS := optional 114 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(call keystore_proto_include) 115 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include 116 LOCAL_CLANG := true 117 LOCAL_SANITIZE := integer 118 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 119 include $(BUILD_SHARED_LIBRARY) 120 121 # Library for unit tests 122 include $(CLEAR_VARS) 123 ifeq ($(USE_32_BIT_KEYSTORE), true) 124 LOCAL_MULTILIB := 32 125 endif 126 LOCAL_CFLAGS := -Wall -Wextra -Werror 127 LOCAL_SRC_FILES := auth_token_table.cpp 128 LOCAL_MODULE := libkeystore_test 129 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include 130 LOCAL_STATIC_LIBRARIES := libgtest_main 131 LOCAL_SHARED_LIBRARIES := libkeymaster_messages 132 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include 133 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 134 include $(BUILD_STATIC_LIBRARY) 135