-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
41 lines (34 loc) · 1.12 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
# Variables
BUILD_DIR = build
BIN_DIR = bin
CMAKE_FLAGS = -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=$(CURDIR)/$(BIN_DIR)
CORES ?= 1
# Default target
all: release
# Release build
release:
@mkdir -p $(BUILD_DIR)
@cd $(BUILD_DIR) && cmake $(CMAKE_FLAGS) -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=ON ..
@$(MAKE) -C $(BUILD_DIR) -j$(CORES)
# Source build
source:
@mkdir -p $(BUILD_DIR)
@cd $(BUILD_DIR) && cmake $(CMAKE_FLAGS) -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=ON -DBABYLON_BUILD_SOURCE=ON ..
@$(MAKE) -C $(BUILD_DIR) -j$(CORES)
# android build
android:
@mkdir -p $(BUILD_DIR)
@cd $(BUILD_DIR) && cmake $(CMAKE_FLAGS) -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$(ANDROID_NDK)/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-21 ..
@$(MAKE) -C $(BUILD_DIR) -j$(CORES)
# Debug build
debug:
@mkdir -p $(BUILD_DIR)
@cd $(BUILD_DIR) && cmake $(CMAKE_FLAGS) -DCMAKE_BUILD_TYPE=Debug ..
@$(MAKE) -C $(BUILD_DIR) -j$(CORES)
# Clean build directory
clean:
@$(RM) -r $(BUILD_DIR)
@$(RM) -r $(BIN_DIR)
@$(RM) -r $(CURDIR)/lib
@$(RM) -r $(CURDIR)/download
.PHONY: all release source debug clean