-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (23 loc) · 1.28 KB
/
Makefile
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
# bash sell to correctly interpret the double brackets in the conditions below
SHELL=/bin/bash
# https://www.gnu.org/software/make/manual/html_node/One-Shell.html
# Required to prevent having to use "conda init"
# all the lines in a recipe are passed to a single invocation of the shell.
.ONESHELL:
# list of all phony targets, alphabetically sorted
.PHONY: all clean docs help
help:
# this nifty perl one-liner collects all commnents headed by the double "#" symbols next to each target and recycles them as comments
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}'
docs: ## create HTML docs under docs/_build/html/. Requires activation of the drtsans conda environment
# this will fail on a warning
@cd docs&& make html SPHINXOPTS="-W --keep-going -n" && echo -e "##########\n DOCS point your browser to file://$$(pwd)/_build/html/index.html\n##########"
.PHONY: clean
clean: ## Delete some cruft from builds/testing/etc.
rm -rf `find . -name __pycache__ -o -name "*.egg-info"` \
`find . -type f -name '*.py[co]'` \
`find . -maxdepth 1 -type f -name 'BIOSANS_*.nxs' -o -name '*_Definition.xml'` \
docs/_build \
debug/ test_output/ \
.coverage build dist \
.pytest_cache .ruff_cache