-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (53 loc) · 1.67 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
# Makefile for the inLimbo Project
# Variables
BUILD_DIR := build
BUILD_DBG_ASAN_DIR := build-dbg-asan
BUILD_DBG_TSAN_DIR :- build-dbg-tsan
EXECUTABLE := inLimbo
CMAKE := cmake
CMAKE_BUILD_TYPE := Release
SCRIPT := ./init.sh
VERBOSE_FLAG := VERBOSE=1
# Targets
.PHONY: all build clean rebuild build-all init asan tsan global_build
all: build-all
build-all:
@echo "==> Running initialization script..."
$(SCRIPT)
$(MAKE) build
build:
@echo "==> Fresh Building inLimbo with $(CMAKE_BUILD_TYPE)..."
$(CMAKE) -S . -B build $(BUILD_DIR)
$(CMAKE) --build $(BUILD_DIR)
rebuild:
@echo "==> Rebuilding inLimbo with $(CMAKE_BUILD_TYPE)..."
$(CMAKE) --build $(BUILD_DIR)
asan:
@echo "==> Building in AddressSanitizer mode..."
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && $(CMAKE) -DCMAKE_BUILD_TYPE=Debug-ASan .. && $(NINJA)
asan_run: asan
@echo "==> Running AddressSanitizer build..."
$(BUILD_DIR)/inLimbo-DBG-Asan
tsan:
@echo "==> Building in ThreadSanitizer mode..."
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && $(CMAKE) -DCMAKE_BUILD_TYPE=Debug-TSan .. && $(NINJA)
tsan_run: tsan
@echo "==> Running ThreadSanitizer build..."
$(BUILD_DIR)/inLimbo-DBG-TSan
clean:
@echo "==> Cleaning build directory..."
rm -rf $(BUILD_DIR)
init:
@echo "==> Running initialization script..."
$(SCRIPT)
global_build:
@echo "==> Building globally and installing..."
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && $(CMAKE) -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) -DBUILD_GLOBAL=ON .. && $(NINJA)
cd $(BUILD_DIR) && sudo ninja install
verbose:
@echo "==> Building with verbose output..."
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && $(CMAKE) -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) .. && $(NINJA) $(VERBOSE_FLAG)