-
Notifications
You must be signed in to change notification settings - Fork 41
/
Makefile
55 lines (44 loc) · 1.52 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
.PHONY: debug clean
debug: build-debug
(cd build-debug; meson configure -Dbuild_tests=false)
meson compile -C build-debug
cp build-debug/paintown .
clang:
test -d build-debug || (mkdir build-debug && CXX=clang++ CC=clang CXXFLAGS=-stdlib=libc++ meson setup build-debug)
(cd build-debug; meson configure -Dbuild_tests=false)
meson compile -C build-debug
cp build-debug/paintown .
build-debug:
mkdir build-debug
meson setup build-debug
release: build-release
(cd build-release; meson configure -Dbuild_tests=false -Drelease=true -Doptimization=2)
meson compile -C build-release
cp build-release/paintown .
strip paintown
build-release:
mkdir build-release
meson setup build-release
test: build-debug
(cd build-debug; meson configure -Dbuild_tests=true)
meson compile -C build-debug
mingw: build-mingw
(cd build-mingw; meson configure -Dbuild_tests=false)
meson compile -C build-mingw
build-mingw: ensure-mingw
mkdir build-mingw
misc/mingw-environment.sh
meson setup --cross-file misc/windows/mingw_x86_64.txt build-mingw
testmingw: build-mingw
(cd build-mingw; meson configure -Dbuild_tests=true)
meson compile -C build-mingw
mkdir -p mingw-bin
cp build-mingw/paintown.exe mingw-bin
find build-mingw/src/test -type f -name \*.exe -exec sh -c "cp {} mingw-bin" \;
ensure-mingw:
@echo "Testing for mingw cross compiler..."
@x86_64-w64-mingw32-gcc-posix --version > /dev/null || { exit 1; }
@x86_64-w64-mingw32-g++-posix --version > /dev/null || { exit 1; }
@echo "Ok."
clean:
rm -rf build-debug build-release build-mingw