forked from taihegames/libpitaya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (67 loc) · 2.73 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
ANDROID_TOOLCHAIN_FILE = temp/android-ndk-r17b/build/cmake/android.toolchain.cmake
setup-mac:
@brew install ninja
setup-android-mac:
@mkdir -p temp
@curl https://dl.google.com/android/repository/android-ndk-r17b-darwin-x86_64.zip -o temp/android-ndk-r17b.zip
@unzip -qo temp/android-ndk-r17b.zip -d temp/
setup-android-linux:
@mkdir -p temp
@curl https://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip -o temp/android-ndk-r17b.zip
@unzip -qo temp/android-ndk-r17b.zip -d temp/
build-android:
@rm -rf _builds/android
@cmake -GNinja -H. -B_builds/android -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_TOOLCHAIN_FILE} \
-DANDROID_ABI=armeabi-v7a
@cmake --build _builds/android
build-android-64:
@rm -rf _builds/android64
@cmake -GNinja -H. -B_builds/android64 -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_TOOLCHAIN_FILE} \
-DANDROID_ABI=arm64-v8a
@cmake --build _builds/android64
build-mac:
@rm -rf _builds/mac
@cmake -H. -B_builds/mac -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_MACOS_BUNDLE=ON
@cmake --build _builds/mac
build-mac-xcode:
@rm -rf _builds/mac-xcode
@cmake -H. -B_builds/mac-xcode -GXcode -DBUILD_MACOS_BUNDLE=ON
@cmake --build _builds/mac-xcode --config Release
build-linux:
@rm -rf _builds/linux
@cmake -H. -B_builds/linux -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON
@cmake --build _builds/linux
build-linux-debug:
@rm -rf _builds/linux-debug
@cmake -H. -B_builds/linux-debug -GNinja -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON
@cmake --build _builds/linux-debug
build-ios:
@rm -rf _builds/ios
@cmake -H. -B_builds/ios -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../cmake/ios.toolchain.cmake
@cmake --build _builds/ios
build-mac-tests:
@rm -rf _builds/mac-tests
@cmake -GNinja -H. -B_builds/mac-tests -DCMAKE_BUILD_TYPE=Release
@cmake --build _builds/mac-tests
clean-docker-container:
@if [[ `docker ps -aqf "name=libpitaya"` != "" ]]; then \
docker rm `docker ps -aqf "name=libpitaya"` ; \
fi
build-linux-docker: clean-docker-container
@docker build -t libpitaya .
@mkdir -p _builds
@docker run -v $(shell pwd):/app/ --name libpitaya libpitaya:latest
@$(MAKE) clean-docker-container
.PHONY: build
create-out-folder:
@rm -rf out
@mkdir -p out
build-servers-linux: create-out-folder
@cd pitaya-servers/json-server && GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o ../../out/json_server_linux
@cd pitaya-servers/protobuf-server && GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o ../../out/protobuf_server_linux
docker-build: build-servers-linux
@docker build -t libpitaya-test-servers .
generate-xcode:
@cmake -H. -B_builds/xcode -GXcode -DBUILD_TESTING=ON