Skip to content

Commit

Permalink
build: make clean build=build_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
lotem committed Feb 29, 2024
1 parent 888e638 commit 6bc0afa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -52,7 +52,7 @@ deps/%:
$(MAKE) -f deps.mk $(@:deps/%=%)

clean:
rm -Rf build debug
rm -r $(build) || true

librime: release

Expand Down
15 changes: 6 additions & 9 deletions deps.mk
Expand Up @@ -9,20 +9,17 @@ endif

build ?= build

rime_deps = glog gtest leveldb marisa opencc yaml-cpp
rime_deps = glog googletest leveldb marisa-trie opencc yaml-cpp

.PHONY: all clean-src $(rime_deps)

all: $(rime_deps)

# note: this won't clean output files under include/, lib/ and bin/.
clean-src:
rm -r $(src_dir)/glog/build || true
rm -r $(src_dir)/googletest/build || true
rm -r $(src_dir)/leveldb/build || true
rm -r $(src_dir)/marisa-trie/build || true
rm -r $(src_dir)/opencc/build || true
rm -r $(src_dir)/yaml-cpp/build || true
for dep in $(rime_deps); do \
rm -r $(src_dir)/$${dep}/$(build) || true; \
done

glog:
cd $(src_dir)/glog; \
Expand All @@ -34,7 +31,7 @@ glog:
-DCMAKE_INSTALL_PREFIX:PATH="$(rime_root)" \
&& cmake --build $(build) --target install

gtest:
googletest:
cd $(src_dir)/googletest; \
cmake . -B$(build) \
-DBUILD_GMOCK:BOOL=OFF \
Expand All @@ -51,7 +48,7 @@ leveldb:
-DCMAKE_INSTALL_PREFIX:PATH="$(rime_root)" \
&& cmake --build $(build) --target install

marisa:
marisa-trie:
cd $(src_dir)/marisa-trie; \
cmake . -B$(build) \
-DCMAKE_BUILD_TYPE:STRING="Release" \
Expand Down

0 comments on commit 6bc0afa

Please sign in to comment.