Makefile 827 Bytes
Newer Older
1
.PHONY: tree ln submodule install build clean rebuild test format
2
3

tree:
4
	@tree --prune -I "__pycache__|*.egg-info|*.so|build|3rdparty|dist"
5

6
7
submodule:
	@git submodule update --init --recursive
8

9
10
11
12
ln: submodule
	@rm -rf build && bear python3 setup.py build

install: submodule
13
14
	@pip install -e .

15
build: submodule
16
	@rm -rf dist/* || true && export MAX_JOBS=$(nproc) && python3 setup.py bdist_wheel && pip3 install dist/*whl --force-reinstall --no-deps
17
18
19
20

clean:
	@rm -rf build dist *.egg-info

21
22
23
rebuild: clean submodule build
	@echo "Succeed to rebuild"

24
test:
25
	@find tests -name "test_*.py" | xargs -n 1 python3
26
27

format:
28
	@find src tests -name '*.cc' -o -name '*.cu' -o -name '*.cuh' -o -name '*.h' -o -name '*.hpp' | xargs clang-format -i && find src tests -name '*.py' | xargs isort && find src tests -name '*.py' | xargs black