-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (39 loc) · 1.77 KB
/
Makefile
File metadata and controls
51 lines (39 loc) · 1.77 KB
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
PYSRC = src/rcs_fr3
CPPSRC = src
COMPILE_MODE = Release
# CPP
cppcheckformat:
clang-format --dry-run -Werror -i $(shell find ${CPPSRC} -name '*.cpp' -o -name '*.cc' -o -name '*.h')
cppformat:
clang-format -Werror -i $(shell find ${CPPSRC} -name '*.cpp' -o -name '*.cc' -o -name '*.h')
cpplint:
clang-tidy -p=build --warnings-as-errors='*' $(shell find ${CPPSRC} -name '*.cpp' -o -name '*.cc' -name '*.h')
gcccompile:
cmake -DCMAKE_BUILD_TYPE=${COMPILE_MODE} -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -B build -G Ninja
cmake --build build --target _core
clangcompile:
cmake -DCMAKE_BUILD_TYPE=${COMPILE_MODE} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -B build -G Ninja
cmake --build build --target _core
# Auto generation of CPP binding stub files
stubgen:
pybind11-stubgen -o src --numpy-array-use-type-var --sort-by topological rcs_fr3
find ./${PYSRC} -name '*.pyi' -print | xargs sed -i '1s/^/# ATTENTION: auto generated from C++ code, use `make stubgen` to update!\n/'
find ./${PYSRC} -not -path "./${PYSRC}/_core/*" -name '*.pyi' -delete
find ./${PYSRC}/_core -name '*.pyi' -print | xargs sed -i 's/tuple\[typing\.Literal\[\([0-9]\+\)\], typing\.Literal\[1\]\]/tuple\[typing\.Literal[\1]\]/g'
find ./${PYSRC}/_core -name '*.pyi' -print | xargs sed -i 's/tuple\[\([M|N]\), typing\.Literal\[1\]\]/tuple\[\1\]/g'
ruff check --fix ${PYSRC}/_core
isort ${PYSRC}/_core
black ${PYSRC}/_core
# Python
pycheckformat:
isort --check-only ${PYSRC}
black --check ${PYSRC}
pyformat:
isort ${PYSRC}
black ${PYSRC}
pylint: ruff mypy
ruff:
ruff check ${PYSRC}
mypy:
mypy ${PYSRC} --install-types --non-interactive --no-namespace-packages --exclude 'build'
.PHONY: cppcheckformat cppformat cpplint gcccompile clangcompile stubgen pycheckformat pyformat pylint ruff mypy