2023-02-14 13:20:59 +00:00
|
|
|
ifeq ($(shell uname),Darwin)
|
2022-01-03 13:50:19 +00:00
|
|
|
EXT := dylib
|
|
|
|
else
|
|
|
|
EXT := so
|
|
|
|
endif
|
|
|
|
|
2019-06-04 09:09:58 +00:00
|
|
|
source_files := $(wildcard src/*.rs)
|
|
|
|
|
2023-02-14 13:20:59 +00:00
|
|
|
all: format lint build test
|
2019-06-04 09:09:58 +00:00
|
|
|
|
|
|
|
PHONY: test format
|
|
|
|
|
2023-02-14 13:20:59 +00:00
|
|
|
lint:
|
|
|
|
cargo clippy
|
|
|
|
|
2022-01-03 13:50:19 +00:00
|
|
|
test: tantivy/tantivy.$(EXT)
|
2019-06-04 09:09:58 +00:00
|
|
|
python3 -m pytest
|
|
|
|
|
|
|
|
format:
|
2023-02-14 13:20:59 +00:00
|
|
|
cargo fmt
|
|
|
|
|
|
|
|
build:
|
|
|
|
maturin build --interpreter python3.7 python3.8 python3.9 python3.10 python3.11
|
2019-06-04 09:09:58 +00:00
|
|
|
|
2022-01-03 13:50:19 +00:00
|
|
|
tantivy/tantivy.$(EXT): target/debug/libtantivy.$(EXT)
|
|
|
|
cp target/debug/libtantivy.$(EXT) tantivy/tantivy.so
|
2019-06-04 09:09:58 +00:00
|
|
|
|
2022-01-03 13:50:19 +00:00
|
|
|
target/debug/libtantivy.$(EXT): $(source_files)
|
2019-06-04 09:09:58 +00:00
|
|
|
cargo build
|