blob: 0d2a8b39e811fe278d8a531be8a80f54af797610 [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
Ethan Yonkerea4efc62017-12-12 16:24:28 -060075LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. system/core/adb
bigbiffd58ba182020-03-23 10:02:29 -040076LOCAL_SHARED_LIBRARIES := libadbd libbase liblog libcutils libc
77#LOCAL_STATIC_LIBRARIES := libbase liblog libcutils libc
78
79ifeq ($shell test $(PLATFORM_SDK_VERSION) -lt 29; echo $$?),0)
80 LOCAL_C_INCLUDES += $(LOCAL_PATH)/../fuse_sideload28/
81else
82 LOCAL_C_INCLUDES += $(LOCAL_PATH)/../fuse_sideload/include
83endif
Ethan Yonkerea4efc62017-12-12 16:24:28 -060084
85ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
86 LOCAL_C_INCLUDES += $(LOCAL_PATH)/libmincrypt/includes
87 LOCAL_SHARED_LIBRARIES += libmincrypttwrp
88 LOCAL_CFLAGS += -DUSE_MINCRYPT
89else
90 LOCAL_SHARED_LIBRARIES += libcrypto \
91 $(if $(WITH_CRYPTO_UTILS),libcrypto_utils)
Ethan Yonker58f21322018-08-24 11:17:36 -050092 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 27; echo $$?),0)
93 # Needed in Android 9.0
94 LOCAL_WHOLE_STATIC_LIBRARIES += libasyncio
95 endif
Ethan Yonkerea4efc62017-12-12 16:24:28 -060096endif
97
98include $(BUILD_STATIC_LIBRARY)
99
Tao Bao99f0d9e2016-10-13 12:46:38 -0700100# minadbd_test (native test)
101# ===============================
bigbiffd58ba182020-03-23 10:02:29 -0400102# include $(CLEAR_VARS)
Ethan Yonkerea4efc62017-12-12 16:24:28 -0600103
bigbiffd58ba182020-03-23 10:02:29 -0400104# LOCAL_MODULE := minadbd_test
105# LOCAL_COMPATIBILITY_SUITE := device-tests
106# LOCAL_SRC_FILES := fuse_adb_provider_test.cpp
107# LOCAL_CFLAGS := $(minadbd_cflags)
108# LOCAL_C_INCLUDES := $(LOCAL_PATH) system/core/adb
109# LOCAL_STATIC_LIBRARIES := \
110# libBionicGtestMain \
111# libminadbd
112# LOCAL_SHARED_LIBRARIES := \
113# liblog \
114# libbase \
115# libcutils
Dan Albertffd6c312015-02-26 15:33:00 -0800116
bigbiffd58ba182020-03-23 10:02:29 -0400117# include $(BUILD_NATIVE_TEST)