forked from rime/librime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.thirdparty
64 lines (54 loc) · 2.12 KB
/
Makefile.thirdparty
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
# a minimal build for static linking
SRC_DIR=thirdparty/src
.PHONY: all clean-src glog leveldb marisa opencc yaml-cpp gtest
all: glog leveldb marisa opencc yaml-cpp gtest
# note: this won't clean output files under include/, lib/ and bin/.
clean-src:
cd $(SRC_DIR)/glog; make distclean || true
rm -r $(SRC_DIR)/gtest/build || true
cd $(SRC_DIR)/leveldb; make clean || true
cd $(SRC_DIR)/kyotocabinet; make distclean || true
cd $(SRC_DIR)/marisa-trie; make distclean || true
rm -r $(SRC_DIR)/opencc/build || true
rm -r $(SRC_DIR)/yaml-cpp/build || true
glog:
cd $(SRC_DIR)/glog; ./configure --disable-dependency-tracking --enable-static --disable-shared && make
cp -R $(SRC_DIR)/glog/src/glog thirdparty/include/
cp $(SRC_DIR)/glog/.libs/libglog.a thirdparty/lib/
leveldb:
cd $(SRC_DIR)/leveldb; make
cp -R $(SRC_DIR)/leveldb/include/leveldb thirdparty/include/
cp $(SRC_DIR)/leveldb/libleveldb.a thirdparty/lib/
marisa:
cd $(SRC_DIR)/marisa-trie; ./configure --disable-debug --disable-dependency-tracking --enable-static && make
cp -R $(SRC_DIR)/marisa-trie/lib/marisa thirdparty/include/
cp $(SRC_DIR)/marisa-trie/lib/marisa.h thirdparty/include/
cp $(SRC_DIR)/marisa-trie/lib/.libs/libmarisa.a thirdparty/lib/
opencc:
cd $(SRC_DIR)/opencc; mkdir -p build && \
cd build && cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS:BOOL=OFF \
.. && \
make
mkdir -p thirdparty/include/opencc
cp $(SRC_DIR)/opencc/src/*.h* thirdparty/include/opencc/
cp $(SRC_DIR)/opencc/build/src/libopencc.a thirdparty/lib/
mkdir -p thirdparty/data/opencc
cp $(SRC_DIR)/opencc/data/config/*.json thirdparty/data/opencc/
cp $(SRC_DIR)/opencc/build/data/*.ocd thirdparty/data/opencc/
yaml-cpp:
cd $(SRC_DIR)/yaml-cpp; mkdir -p build && \
cd build && cmake \
-DCMAKE_BUILD_TYPE=Release \
.. && \
make
cp -R $(SRC_DIR)/yaml-cpp/include/yaml-cpp thirdparty/include/
cp $(SRC_DIR)/yaml-cpp/build/libyaml-cpp.a thirdparty/lib/
gtest:
cd $(SRC_DIR)/gtest; mkdir -p build && \
cd build && cmake .. && \
make
cp -R $(SRC_DIR)/gtest/include/gtest thirdparty/include/
cp $(SRC_DIR)/gtest/build/libgtest*.a thirdparty/lib/