-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathxcode.mk
More file actions
68 lines (52 loc) · 1.64 KB
/
xcode.mk
File metadata and controls
68 lines (52 loc) · 1.64 KB
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
RIME_ROOT = $(CURDIR)
RIME_DIST_DIR = $(RIME_ROOT)/dist
RIME_COMPILER_OPTIONS = CC=clang CXX=clang++ \
CXXFLAGS="-stdlib=libc++" LDFLAGS="-stdlib=libc++"
.PHONY: all release debug clean distclean test thirdparty
all: release
release:
cmake . -Bbuild -GXcode \
-DBUILD_STATIC=ON \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DCMAKE_INSTALL_PREFIX="$(RIME_DIST_DIR)"
cmake --build build --config Release
release-with-icu:
cmake . -Bbuild -GXcode \
-DBUILD_STATIC=ON \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DCMAKE_INSTALL_PREFIX="$(RIME_DIST_DIR)" \
-DBUILD_WITH_ICU=ON \
-DCMAKE_PREFIX_PATH=/usr/local/opt/icu4c
cmake --build build --config Release
debug:
cmake . -Bdebug -GXcode \
-DBUILD_STATIC=ON \
-DBUILD_SEPARATE_LIBS=ON
cmake --build debug --config Debug
debug-with-icu:
cmake . -Bdebug -GXcode \
-DBUILD_STATIC=ON \
-DBUILD_SEPARATE_LIBS=ON \
-DBUILD_WITH_ICU=ON \
-DCMAKE_PREFIX_PATH=/usr/local/opt/icu4c
cmake --build debug --config Debug
clean:
rm -rf build > /dev/null 2>&1 || true
rm -rf debug > /dev/null 2>&1 || true
rm build.log > /dev/null 2>&1 || true
rm -f thirdparty/lib/* > /dev/null 2>&1 || true
make -f thirdparty.mk clean-src
dist: release
cmake --build build --config Release --target install
dist-with-icu: release-with-icu
cmake --build build --config Release --target install
distclean: clean
rm -rf "$(RIME_DIST)" > /dev/null 2>&1 || true
test: release
(cd build/test; LD_LIBRARY_PATH=../lib/Release Release/rime_test)
test-debug: debug
(cd debug/test; Debug/rime_test)
thirdparty:
$(RIME_COMPILER_OPTIONS) make -f thirdparty.mk
thirdparty/%:
$(RIME_COMPILER_OPTIONS) make -f thirdparty.mk $(@:thirdparty/%=%)