blob: 924106a7e9b5b3a70340a53c59826076d540a442 [file] [log] [blame]
Doug Zongker9270a202012-01-09 15:16:13 -08001# Copyright 2005 The Android Open Source Project
Tao Bao99f0d9e2016-10-13 12:46:38 -07002#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
Doug Zongker9270a202012-01-09 15:16:13 -080014
15LOCAL_PATH:= $(call my-dir)
16
Dan Albertffd6c312015-02-26 15:33:00 -080017minadbd_cflags := \
18 -Wall -Werror \
Dan Albertffd6c312015-02-26 15:33:00 -080019 -DADB_HOST=0 \
Ethan Yonker534d4e02016-08-26 10:05:03 -050020 -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
Doug Zongker9270a202012-01-09 15:16:13 -080021
Tao Baof87d2042017-11-15 11:26:06 -080022# libminadbd (static library)
Tao Bao99f0d9e2016-10-13 12:46:38 -070023# ===============================
Doug Zongker9270a202012-01-09 15:16:13 -080024include $(CLEAR_VARS)
bigbiffd58ba182020-03-23 10:02:29 -040025 # ../fuse_sideload.cpp \
Doug Zongker9270a202012-01-09 15:16:13 -080026
27LOCAL_SRC_FILES := \
Elliott Hughes20531ef2015-04-10 13:59:19 -070028 fuse_adb_provider.cpp \
Josh Gaoacb2a2f2016-08-26 18:24:34 -070029 minadbd.cpp \
Elliott Hughes24eb8a02016-06-15 15:12:17 -070030 minadbd_services.cpp \
Doug Zongker9270a202012-01-09 15:16:13 -080031
Doug Zongker9270a202012-01-09 15:16:13 -080032LOCAL_MODULE := libminadbd
Ethan Yonker58f21322018-08-24 11:17:36 -050033LOCAL_CFLAGS := $(minadbd_cflags) -Wno-unused-parameter
Dan Albertffd6c312015-02-26 15:33:00 -080034LOCAL_CONLY_FLAGS := -Wimplicit-function-declaration
bigbiffd58ba182020-03-23 10:02:29 -040035LOCAL_CFLAGS += -std=gnu++2a
Ethan Yonkerc798c9c2015-10-09 11:15:26 -050036LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. system/core/adb
bigbiffd58ba182020-03-23 10:02:29 -040037#LOCAL_WHOLE_STATIC_LIBRARIES := libadbd
38LOCAL_SHARED_LIBRARIES := libadbd libbase liblog libcutils libc
Ethan Yonker99af7662016-09-15 14:48:29 -050039
40ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
41 LOCAL_C_INCLUDES += $(LOCAL_PATH)/libmincrypt/includes
42 LOCAL_SHARED_LIBRARIES += libmincrypttwrp
43 LOCAL_CFLAGS += -DUSE_MINCRYPT
44else
D. Andrei Măceșb29a5e22016-12-22 06:19:44 -050045 LOCAL_SHARED_LIBRARIES += libcrypto \
46 $(if $(WITH_CRYPTO_UTILS),libcrypto_utils)
Ethan Yonker58f21322018-08-24 11:17:36 -050047 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 27; echo $$?),0)
48 # Needed in Android 9.0
49 LOCAL_WHOLE_STATIC_LIBRARIES += libasyncio
50 endif
Ethan Yonker99af7662016-09-15 14:48:29 -050051endif
Doug Zongker9270a202012-01-09 15:16:13 -080052
bigbiffd58ba182020-03-23 10:02:29 -040053ifeq ($shell test $(PLATFORM_SDK_VERSION) -lt 29; echo $$?),0)
54 LOCAL_C_INCLUDES += $(LOCAL_PATH)/../fuse_sideload28/
55else
56 LOCAL_C_INCLUDES += $(LOCAL_PATH)/../fuse_sideload/include
57 LOCAL_SHARED_LIBRARIES += libfusesideload
58endif
59
Dees_Troy2673cec2013-04-02 20:22:16 +000060include $(BUILD_SHARED_LIBRARY)
Dan Albertffd6c312015-02-26 15:33:00 -080061
62include $(CLEAR_VARS)
63
Ethan Yonkerea4efc62017-12-12 16:24:28 -060064LOCAL_SRC_FILES := \
65 fuse_adb_provider.cpp \
66 ../fuse_sideload.cpp \
67 minadbd.cpp \
68 minadbd_services.cpp \
69
70LOCAL_CLANG := true
71LOCAL_MODULE := libminadbd
Ethan Yonker58f21322018-08-24 11:17:36 -050072LOCAL_CFLAGS := $(minadbd_cflags) -Wno-unused-parameter
Ethan Yonkerea4efc62017-12-12 16:24:28 -060073LOCAL_CONLY_FLAGS := -Wimplicit-function-declaration
bigbiffd58ba182020-03-23 10:02:29 -040074LOCAL_CFLAGS += -std=gnu++2a
bigbiff673c7ae2020-12-02 19:44:56 -050075LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. system/core/adb $(LOCAL_PATH)/otautil/include
bigbiffd58ba182020-03-23 10:02:29 -040076LOCAL_SHARED_LIBRARIES := libadbd libbase liblog libcutils libc
77#LOCAL_STATIC_LIBRARIES := libbase liblog libcutils libc
bigbiff673c7ae2020-12-02 19:44:56 -050078LOCAL_C_INCLUDES += $(LOCAL_PATH)/../fuse_sideload/include
Ethan Yonkerea4efc62017-12-12 16:24:28 -060079
80ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
81 LOCAL_C_INCLUDES += $(LOCAL_PATH)/libmincrypt/includes
82 LOCAL_SHARED_LIBRARIES += libmincrypttwrp
83 LOCAL_CFLAGS += -DUSE_MINCRYPT
84else
85 LOCAL_SHARED_LIBRARIES += libcrypto \
86 $(if $(WITH_CRYPTO_UTILS),libcrypto_utils)
Ethan Yonker58f21322018-08-24 11:17:36 -050087 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 27; echo $$?),0)
88 # Needed in Android 9.0
89 LOCAL_WHOLE_STATIC_LIBRARIES += libasyncio
90 endif
Ethan Yonkerea4efc62017-12-12 16:24:28 -060091endif
92
93include $(BUILD_STATIC_LIBRARY)
94
Tao Bao99f0d9e2016-10-13 12:46:38 -070095# minadbd_test (native test)
96# ===============================
bigbiffd58ba182020-03-23 10:02:29 -040097# include $(CLEAR_VARS)
Ethan Yonkerea4efc62017-12-12 16:24:28 -060098
bigbiffd58ba182020-03-23 10:02:29 -040099# LOCAL_MODULE := minadbd_test
100# LOCAL_COMPATIBILITY_SUITE := device-tests
101# LOCAL_SRC_FILES := fuse_adb_provider_test.cpp
102# LOCAL_CFLAGS := $(minadbd_cflags)
103# LOCAL_C_INCLUDES := $(LOCAL_PATH) system/core/adb
104# LOCAL_STATIC_LIBRARIES := \
105# libBionicGtestMain \
106# libminadbd
107# LOCAL_SHARED_LIBRARIES := \
108# liblog \
109# libbase \
110# libcutils
Dan Albertffd6c312015-02-26 15:33:00 -0800111
bigbiffd58ba182020-03-23 10:02:29 -0400112# include $(BUILD_NATIVE_TEST)