boring_backup/Makefile

32 lines
852 B
Makefile
Raw Normal View History

2022-05-14 00:20:02 +03:00
src_dir := ./src
docs_dir := ./docs
tests_dir := ./tests
build_dir := ./build
docs_build_dir := ./build/docs
.PHONY: help tests docs
help:
@echo Usage: make TARGET
@echo
@echo Available targets:
@echo
@echo 'help print this help message'
@echo 'tests run tests from $(tests_dir)'
@echo 'docs build documentation from $(docs_dir)'
@echo
2022-05-14 01:07:01 +03:00
@echo See README.rst for more info.
2022-05-14 00:20:02 +03:00
tests:
# See bats(1), https://bats-core.readthedocs.io/en/latest/index.html
for test in $(tests_dir)/*.bats; do bats --verbose-run --print-output-on-failure "$$@" "$$test"; done
docs: builddir
# See rst2man(1), rst2html(1), https://docutils.sourceforge.io/docs/index.html
rst2man $(docs_dir)/baf.1.rst | gzip -9 > $(docs_build_dir)/baf.1
rst2html $(docs_dir)/baf.1.rst > $(docs_build_dir)/baf.1.html
builddir:
mkdir -p $(build_dir)
mkdir -p $(docs_build_dir)