forked from elonafoobar/elonafoobar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.win
98 lines (62 loc) · 2.56 KB
/
Makefile.win
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
86
87
88
89
90
91
92
93
94
95
96
97
98
# Change this variable to point to your Boost installation.
BOOST_ROOT = E:\build\SDK\boost_1_69_0
# Change this variable to point to your OpenSSL installation.
OPENSSL_ROOT_DIR = E:\build\SDK\OpenSSL-v111-Win64
BIN_DIR = bin
CMAKE_ARGS = \
-DBOOST_ROOT="$(BOOST_ROOT)" \
-DOPENSSL_ROOT_DIR="$(OPENSSL_ROOT_DIR)" \
-G "Visual Studio 15 2017 Win64" \
$(CMAKE_ARGS)
# Utilities
MKDIR = mkdir
.PHONY: FORCE
all: $(BIN_DIR) FORCE # Build the most recently built target.
cd $(BIN_DIR) & \
cmake .. $(CMAKE_ARGS) & \
cmake --build .
run: build FORCE # Run Elona foobar (debug).
.\$(BIN_DIR)\Debug\Elona_foobar.exe
build: $(BIN_DIR) FORCE # Build Elona foobar (debug).
cd $(BIN_DIR) & \
cmake .. -DELONA_BUILD_TARGET=GAME -DCMAKE_BUILD_TYPE=Debug $(CMAKE_ARGS) & \
cmake --build . --config Debug
run_release: build_release FORCE # Run Elona foobar (release).
.\$(BIN_DIR)\Release\Elona_foobar.exe
build_release: $(BIN_DIR) FORCE # Build Elona foobar (release).
cd $(BIN_DIR) & \
cmake .. -DELONA_BUILD_TARGET=GAME -DCMAKE_BUILD_TYPE=Release $(CMAKE_ARGS) & \
cmake --build . --config Release
launcher: FORCE # Build Elona foobar Launcher (debug)
cd $(BIN_DIR) & \
cmake .. -DELONA_BUILD_TARGET=LAUNCHER -DCMAKE_BUILD_TYPE=Debug $(CMAKE_ARGS) & \
cmake --build . --config Debug
launcher_release: FORCE # Build Elona foobar Launcher (release)
cd $(BIN_DIR) & \
cmake .. -DELONA_BUILD_TARGET=LAUNCHER -DCMAKE_BUILD_TYPE=Release $(CMAKE_ARGS) & \
cmake --build . --config Release
tests: test_runner FORCE # Run all tests.
cd $(BIN_DIR)\Debug & \
.\Elona_foobar.exe --durations=yes
test_runner: $(BIN_DIR) FORCE # Build test runner.
-rd /q /s .\$(BIN_DIR)\Debug\tests
cd $(BIN_DIR) & \
cmake .. -DELONA_BUILD_TARGET=TESTS -DCMAKE_BUILD_TYPE=Debug $(CMAKE_ARGS) & \
cmake --build . --config Debug
bench: bench_runner FORCE # Run benchmark.
cd $(BIN_DIR)\Release & \
.\Elona_foobar
bench_runner: $(BIN_DIR) FORCE # Build benchmark runner.
cd $(BIN_DIR) & \
cmake .. -DELONA_BUILD_TARGET=BENCH -DCMAKE_BUILD_TYPE=Release $(CMAKE_ARGS) & \
cmake --build . --config Release
$(BIN_DIR):
$(MKDIR) $(BIN_DIR)
clean: FORCE # Clean up built products.
-rd /q /s $(BIN_DIR)
# Format src/*.{hpp,cpp} except under src/thirdparty.
format: FORCE # Format all C++ source files.
powershell -Command "Get-ChildItem src -Include *.cpp,*.hpp -Recurs | Where {$$_.FullName -notlike '*\src\thirdparty\*'} | Foreach {clang-format -i $$_.FullName; Write-Host $$_.Name}"
git diff
rebuild: clean build FORCE # Clean and build Elona.
FORCE: