-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
57 lines (47 loc) · 1.68 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir := $(dir $(mkfile_path))
BUILD_TYPE ?= Debug
grpc_with_submodules := grpc/third_party/protobuf/README.md
grpc_cpp_plugin_executable := native/${BUILD_TYPE}/bin/grpc_cpp_plugin
protoc_executable := native/${BUILD_TYPE}/bin/protoc
include local.mk
.PHONY: all
all: android native
.PHONY: android
android: android_24_arm64-v8a
# Platform = android
# MinSDK = 24
# ABI = arm64-v8a
# NDK Version = ${ndk_version}
# Build Type = ${BUILD_TYPE}
.PHONY: android_24_arm64-v8a
android_24_arm64-v8a: ${grpc_with_submodules} \
${grpc_cpp_plugin_executable} \
${protoc_executable}
cmake \
-B build/android/24/arm64-v8a/${ndk_version}/${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=${mkfile_dir}android/24/arm64-v8a/${ndk_version}/${BUILD_TYPE} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_TOOLCHAIN_FILE=${ndk_dir}/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-24 \
-D_gRPC_CPP_PLUGIN=${grpc_cpp_plugin_executable} \
-D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${protoc_executable} \
-GNinja \
./grpc
cmake --build build/android/24/arm64-v8a/${ndk_version}/${BUILD_TYPE}
cmake --install build/android/24/arm64-v8a/${ndk_version}/${BUILD_TYPE}
${grpc_cpp_plugin_executable}: native
${protoc_executable}: native
.PHONY: native
native: ${grpc_with_submodules}
cmake \
-B build/native/${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=${mkfile_dir}native/${BUILD_TYPE} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-GNinja \
./grpc
cmake --build build/native/${BUILD_TYPE}
cmake --install build/native/${BUILD_TYPE}
${grpc_with_submodules}:
$(error Please clone submodules of grpc)