File: Makefile.thirdparty

package info (click to toggle)
librime 1.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 20,608 kB
  • ctags: 25,041
  • sloc: cpp: 119,202; sh: 21,794; ansic: 7,346; python: 4,372; makefile: 863; perl: 288; ruby: 50
file content (60 lines) | stat: -rw-r--r-- 2,051 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
# a minimal build for static linking

SRC_DIR=thirdparty/src

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

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

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 \
	-DENABLE_GETTEXT:BOOL=OFF \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	.. && \
	make
	mkdir -p thirdparty/include/opencc/ && \
	cp $(SRC_DIR)/opencc/src/opencc*.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/