File: Makefile.thirdparty

package info (click to toggle)
librime 1.2.9%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,720 kB
  • ctags: 26,190
  • sloc: cpp: 145,345; sh: 21,912; ansic: 5,287; python: 4,339; makefile: 1,061; perl: 288; xml: 62; ruby: 50
file content (66 lines) | stat: -rw-r--r-- 2,261 bytes parent folder | download
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
# a minimal build for static linking

SRC_DIR=thirdparty/src

.PHONY: all clean-src glog leveldb kyotocabinet marisa opencc yaml-cpp gtest

all: glog leveldb kyotocabinet 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/

kyotocabinet:
	cd $(SRC_DIR)/kyotocabinet; chmod +x configure; ./configure --disable-debug && make
	cp $(SRC_DIR)/kyotocabinet/kc*.h thirdparty/include/
	cp $(SRC_DIR)/kyotocabinet/libkyotocabinet.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/

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/