This repository has been archived by the owner on May 14, 2024. It is now read-only.
forked from rime/squirrel
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
94 lines (67 loc) · 2.49 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
.PHONY: all install deps release debug
all: release
install: install-release
# Change to `xcode/dist-with-icu` if boost is linked to icu libraries.
RIME_DIST_TARGET = xcode/dist
RIME_BIN_DIR = librime/dist/bin
RIME_LIB_DIR = librime/dist/lib
RIME_LIBRARY_FILE_NAME = librime.1.dylib
RIME_LIBRARY = lib/$(RIME_LIBRARY_FILE_NAME)
RIME_DEPS = librime/thirdparty/lib/libmarisa.a \
librime/thirdparty/lib/libleveldb.a \
librime/thirdparty/lib/libyaml-cpp.a
DEPS_CHECK = $(RIME_LIBRARY)
INSTALL_NAME_TOOL = $(shell xcrun -find install_name_tool)
INSTALL_NAME_TOOL_ARGS = -add_rpath @loader_path/../Frameworks
.PHONY: librime copy-rime-binaries
$(RIME_LIBRARY):
$(MAKE) librime
$(RIME_DEPS):
$(MAKE) -C librime xcode/thirdparty
librime: $(RIME_DEPS)
$(MAKE) -C librime $(RIME_DIST_TARGET)
$(MAKE) copy-rime-binaries
copy-rime-binaries:
cp -L $(RIME_LIB_DIR)/$(RIME_LIBRARY_FILE_NAME) lib/
cp $(RIME_BIN_DIR)/rime_deployer bin/
cp $(RIME_BIN_DIR)/rime_dict_manager bin/
$(INSTALL_NAME_TOOL) $(INSTALL_NAME_TOOL_ARGS) bin/rime_deployer
$(INSTALL_NAME_TOOL) $(INSTALL_NAME_TOOL_ARGS) bin/rime_dict_manager
deps: librime
release: $(DEPS_CHECK)
bash package/add_data_files
xcodebuild -project ThoanTaigi.xcodeproj -configuration Release build
debug: $(DEPS_CHECK)
bash package/add_data_files
xcodebuild -project ThoanTaigi.xcodeproj -configuration Debug build | grep -v setenv | tee build.log
.PHONY: package archive sign-archive
package: release
bash package/make_package
archive: package
bash package/make_archive
sign-archive:
[ -n "${checksum}" ] || (echo >&2 'ERROR: $$checksum not specified.'; false)
bash package/make_archive
DSTROOT = /Library/Input Methods
SQUIRREL_APP_ROOT = $(DSTROOT)/ThoanTaigi.app
.PHONY: permission-check install-debug install-release
permission-check:
[ -w "$(DSTROOT)" ] && [ -w "$(SQUIRREL_APP_ROOT)" ] || sudo chown -R ${USER} "$(DSTROOT)"
install-debug: debug permission-check
rm -rf "$(SQUIRREL_APP_ROOT)"
cp -R build/Debug/ThoanTaigi.app "$(DSTROOT)"
DSTROOT="$(DSTROOT)" RIME_NO_PREBUILD=1 bash scripts/postinstall
install-release: release permission-check
rm -rf "$(SQUIRREL_APP_ROOT)"
cp -R build/Release/ThoanTaigi.app "$(DSTROOT)"
DSTROOT="$(DSTROOT)" bash scripts/postinstall
.PHONY: clean clean-deps
clean:
rm -rf build > /dev/null 2>&1 || true
rm build.log > /dev/null 2>&1 || true
rm bin/* > /dev/null 2>&1 || true
rm lib/* > /dev/null 2>&1 || true
rm data/plum/* > /dev/null 2>&1 || true
clean-deps:
$(MAKE) -C plum clean
$(MAKE) -C librime xcode/clean