Skip to content

Commit fcf36bc

Browse files
committed
refactor(Makefile): rename makefiles and change build directories
1 parent 2cacc69 commit fcf36bc

10 files changed

+227
-153
lines changed

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
build/
22
build-static/
3-
debug-build/
4-
xbuild/
5-
xdebug/
3+
debug/
64
build.log
75
data/*
86
thirdparty/include/*

Makefile

+32-12
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,73 @@ RIME_ROOT = $(CURDIR)
33
sharedir = $(DESTDIR)/usr/share
44
bindir = $(DESTDIR)/usr/bin
55

6-
.PHONY: all thirdparty clean librime librime-static install-librime uninstall-librime release install uninstall debug install-debug uninstall-debug test
6+
.PHONY: all thirdparty xcode clean\
7+
librime librime-static install-librime uninstall-librime \
8+
release debug test install uninstall install-debug uninstall-debug
79

810
all: release
911

1012
thirdparty:
11-
make -f Makefile.thirdparty
13+
make -f thirdparty.mk
1214

1315
thirdparty/%:
14-
make -f Makefile.thirdparty $(@:thirdparty/%=%)
16+
make -f thirdparty.mk $(@:thirdparty/%=%)
17+
18+
xcode:
19+
make -f xcode.mk
20+
21+
xcode/%:
22+
make -f xcode.mk $(@:xcode/%=%)
1523

1624
clean:
17-
rm -Rf build build-static debug-build
25+
rm -Rf build build-static debug
1826

1927
librime: release
2028
install-librime: install
2129
uninstall-librime: uninstall
2230

2331
librime-static:
24-
cmake . -Bbuild-static -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON -DBUILD_SHARED_LIBS=OFF
32+
cmake . -Bbuild-static \
33+
-DCMAKE_INSTALL_PREFIX=/usr \
34+
-DCMAKE_BUILD_TYPE=Release \
35+
-DBUILD_STATIC=ON \
36+
-DBUILD_SHARED_LIBS=OFF
2537
cmake --build build-static
2638

2739
release:
28-
cmake . -Bbuild -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_MERGED_PLUGINS=OFF
40+
cmake . -Bbuild \
41+
-DCMAKE_INSTALL_PREFIX=/usr \
42+
-DCMAKE_BUILD_TYPE=Release \
43+
-DBUILD_MERGED_PLUGINS=OFF
2944
cmake --build build
3045

3146
merged-plugins:
32-
cmake . -Bbuild -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_MERGED_PLUGINS=ON
47+
cmake . -Bbuild \
48+
-DCMAKE_INSTALL_PREFIX=/usr \
49+
-DCMAKE_BUILD_TYPE=Release \
50+
-DBUILD_MERGED_PLUGINS=ON
3351
cmake --build build
3452

3553
debug:
36-
cmake . -Bdebug-build -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug
37-
cmake --build debug-build
54+
cmake . -Bdebug \
55+
-DCMAKE_INSTALL_PREFIX=/usr \
56+
-DCMAKE_BUILD_TYPE=Debug
57+
cmake --build debug
3858

3959
install:
4060
cmake --build build --target install
4161

4262
install-debug:
43-
cmake --build debug-build --target install
63+
cmake --build debug --target install
4464

4565
uninstall:
4666
cmake --build build --target uninstall
4767

4868
uninstall-debug:
49-
cmake --build debug-build --target uninstall
69+
cmake --build debug --target uninstall
5070

5171
test: release
5272
(cd build/test; ./rime_test)
5373

5474
test-debug: debug
55-
(cd debug-build/test; ./rime_test)
75+
(cd debug/test; ./rime_test)

Makefile.thirdparty

-65
This file was deleted.

Makefile.xcode

-33
This file was deleted.

README-mac.md

+47-27
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
Rime with Mac
2-
===
1+
# Rime with Mac
32

4-
Preparation
5-
---
3+
## Preparation
64

75
Install Xcode with command line tools.
86

97
Install other build tools:
8+
109
``` sh
11-
brew install cmake
12-
brew install git
10+
brew install cmake git
1311
```
1412

15-
Install Boost:
13+
Install Boost C++ libraries:
14+
1615
``` sh
1716
brew install boost@1.60
1817
brew link --force boost@1.60
@@ -33,45 +32,66 @@ brew link --force boost@1.60
3332
When you manually download and build Boost libraries from source code, set shell
3433
variable `BOOST_ROOT` to its top level directory prior to building librime.
3534

36-
Get the code
37-
---
35+
## Get the code
36+
3837
``` sh
3938
git clone --recursive https://github.com/rime/librime.git
4039
```
4140
or [download from GitHub](https://github.com/rime/librime).
4241

43-
Build third-party libraries
44-
---
42+
## Build third-party libraries
43+
4544
``` sh
4645
cd librime
47-
make -f Makefile.xcode thirdparty
46+
make xcode/thirdparty
4847
```
49-
This builds dependent libraries in `thirdparty/src/*`, and copies artifacts to `thirdparty/lib` and `thirdparty/bin`.
48+
49+
This builds dependent libraries in `thirdparty/src/*`, and copies artifacts to
50+
`thirdparty/lib` and `thirdparty/bin`.
5051

5152
You can build an individual library, eg. opencc, with:
53+
54+
``` sh
55+
make xcode/thirdparty/opencc
56+
```
57+
58+
## Build librime
59+
5260
``` sh
53-
make -f Makefile.xcode thirdparty/opencc
61+
make xcode
5462
```
63+
This creates `build/lib/Release/librime.dylib` and command line tools
64+
`build/bin/Release/rime_*`.
65+
66+
Or, create a debug build:
67+
68+
``` sh
69+
make xcode/debug
70+
```
71+
72+
## Run unit tests
5573

56-
Build librime
57-
---
5874
``` sh
59-
make -f Makefile.xcode
75+
make xcode/test
6076
```
61-
This creates `xbuild/lib/Release/librime.dylib` and command line tools `xbuild/bin/Release/rime_*`.
6277

63-
Or, make a debug build. This also creates a test in `xdebug/test/`.
78+
Or, test the debug build:
79+
6480
``` sh
65-
make -f Makefile.xcode debug
66-
# run the test
67-
(cd xdebug/test; ./Debug/rime_test)
81+
make xcode/test-debug
6882
```
6983

70-
Try it in the console
71-
---
84+
## Try it in the console
85+
7286
``` sh
73-
(cd xdebug/bin; echo "congmingdeRime{space}shurufa" | Debug/rime_api_console)
87+
(
88+
cd debug/bin;
89+
echo "congmingdeRime{space}shurufa" | Debug/rime_api_console
90+
)
91+
```
7492

75-
# REPL, quit with Control+d
76-
(cd xdebug/bin; ./Debug/rime_api_console)
93+
Use it as REPL, quit with <kbd>Control+d</kbd>:
94+
95+
``` sh
96+
(cd debug/bin; ./Debug/rime_api_console)
7797
```

README.md

+18-10
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RIME: Rime Input Method Engine
77
[![GitHub release](https://img.shields.io/github/release/rime/librime.svg)](https://github.com/rime/librime/releases)
88
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
99

10-
rimes with your keystrokes.
10+
Rime with your keystrokes.
1111

1212
Project home
1313
---
@@ -19,11 +19,16 @@ License
1919

2020
Features
2121
===
22-
- A modular, extensible input method engine in cross-platform C++ code, built on top of open-source technologies
23-
- Covering features found in a large variety of Chinese input methods, either shape-based or phonetic-based
24-
- Built with native support for Traditional Chinese, conversion to Simplified Chinese and other regional standards via OpenCC
25-
- Rime input schema, a DSL in YAML syntax for fast trying out innovative ideas of input method design
26-
- Spelling Algebra, a mechanism to create variant spelling, especially useful for Chinese dialects
22+
- A modular, extensible input method engine in cross-platform C++ code,
23+
built on top of open-source technologies
24+
- Covering features found in a large variety of Chinese input methods,
25+
either shape-based or phonetic-based
26+
- Built with native support for Traditional Chinese, conversion to Simplified
27+
Chinese and other regional standards via OpenCC
28+
- Rime input schema, a DSL in YAML syntax for fast trying out innovative ideas
29+
of input method design
30+
- Spelling Algebra, a mechanism to create variant spelling, especially useful
31+
for Chinese dialects
2732
- Support for chord-typing with a generic Qwerty keyboard
2833

2934
Install
@@ -77,14 +82,17 @@ Third-party:
7782

7883
Plugins
7984
===
80-
- [librime-legacy](https://github.com/rime/librime-legacy) Legacy module with GPL-licensed code
85+
- [librime-legacy](https://github.com/rime/librime-legacy) Legacy module with
86+
GPL-licensed code
8187

8288
Related works
8389
===
84-
- [plum](https://github.com/rime/plum): Rime configuration manager and input schema repository
85-
- [Combo Pinyin](https://github.com/rime/home/wiki/ComboPinyin): an innovative chord-typing practice to input Pinyin
90+
- [plum](https://github.com/rime/plum): Rime configuration manager and input
91+
schema repository
92+
- [Combo Pinyin](https://github.com/rime/home/wiki/ComboPinyin): an innovative
93+
chord-typing practice to input Pinyin
8694
- essay: the vocabulary and language model for Rime
87-
- [SCU](https://github.com/neolee/SCU/): Squirrel Configuration Utilities
95+
- [SCU](https://github.com/neolee/SCU): Squirrel Configuration Utilities
8896

8997
Credits
9098
===

0 commit comments

Comments
 (0)