Update Makefile for project

This commit is contained in:
2022-12-13 01:13:07 +01:00
parent c7fdb92845
commit 8c55980564
2 changed files with 10 additions and 14 deletions

3
.gitignore vendored
View File

@@ -133,4 +133,5 @@ cfimdlp.cpp
cmake-build-debug
cmake-build-debug/**
**/lcoverage/**
**/x/*
**/x/*
**/*.so

View File

@@ -4,37 +4,32 @@ SHELL := /bin/bash
clean: ## Clean up
rm -rf build dist *.egg-info
if [ -f fimdlp/cfimdlp.cpp ]; then rm fimdlp/cfimdlp.cpp; fi;
if [ -f fimdlp/cppfimdlp.cpython-310-darwin.so ]; then rm fimdlp/cppfimdlp.cpython-310-darwin.so; fi;
if [ -d fimdlp/testcpp/build ]; then rm -fr fimdlp/testcpp/build/* ; fi;
if [ -d fimdlp/testcpp/lcoverage ]; then rm -fr fimdlp/testcpp/lcoverage/* ; fi;
if [ -f src/fimdlp/cfimdlp.cpp ]; then rm src/fimdlp/cfimdlp.cpp; fi;
for file in src/fimdlp/*.so; do \
if [ -f $${file} ]; then rm $${file}; fi; \
done
test:
coverage run -m unittest -v fimdlp.tests
coverage run -m unittest discover -v -s src
coverage:
make test
coverage report -m
lint: ## Lint and static-check
black fimdlp
flake8 fimdlp
black src
flake8 src
push: ## Push code with tags
git push && git push --tags
build: ## Build package
rm -fr dist/*
rm -fr build/*
make clean
python -m build --wheel
buildext: ## Build extension
rm -fr dist/*
rm -fr build/*
make clean
python setup.py build_ext
echo "Build extension success"
if [ -f build/lib.macosx-12-x86_64-cpython-310/cppfimdlp.cpython-310-darwin.so ] ; then mv build/lib.macosx-12-x86_64-cpython-310/cppfimdlp.cpython-310-darwin.so fimdlp; fi
if [ -f build/lib.macosx-10.9-universal2-3.10/cppfimdlp.cpython-310-darwin.so ] ; then mv build/lib.macosx-10.9-universal2-3.10/cppfimdlp.cpython-310-darwin.so fimdlp; fi
audit: ## Audit pip
pip-audit