Minor changes

This commit is contained in:
ge 2022-08-21 21:11:07 +03:00
parent a4e420337b
commit 4ac1b6e5a7

View File

@ -1,10 +1,10 @@
src_dir := ./src SRC_DIR := ./src
docs_dir := ./docs DOCS_DIR := ./docs
tests_dir := ./tests TESTS_DIR := ./tests
build_dir := ./build BUILD_DIR := ./build
docs_build_dir := ./build/docs DOCS_BUILD_DIR := ./build/docs
.PHONY: help tests docs .PHONY: help tests docs man install uninstall
all: man all: man
@ -14,35 +14,42 @@ help:
@echo Available targets: @echo Available targets:
@echo @echo
@echo 'help print this help message' @echo 'help print this help message'
@echo 'test run tests from $(tests_dir)' @echo 'tests run tests from $(TESTS_DIR)'
@echo 'lint run shellcheck' @echo 'lint run shellcheck'
@echo 'man build manual pages from $(docs_dir)' @echo 'man build manual pages from $(DOCS_DIR)'
@echo @echo
@echo See README.md for more info. @echo See README.md for more info.
test: tests:
# See bats(1), https://bats-core.readthedocs.io/en/latest/index.html # See bats(1), https://bats-core.readthedocs.io/en/latest/index.html
for test in $(tests_dir)/*.bats; do \ for test in $(TESTS_DIR)/*.bats; do \
bats --verbose-run --print-output-on-failure "$$test"; \ bats --verbose-run --print-output-on-failure "$$test"; \
done done
lint: lint:
shellcheck $(src_dir)/boring-backup shellcheck $(SRC_DIR)/boring-backup
shellcheck $(src_dir)/lib/*.sh shellcheck $(SRC_DIR)/lib/*.sh
shellcheck $(src_dir)/lib/handlers/sources/*.sh shellcheck $(SRC_DIR)/lib/handlers/sources/*.sh
shellcheck $(src_dir)/lib/handlers/targets/*.sh shellcheck $(SRC_DIR)/lib/handlers/targets/*.sh
man: build_dir man: build_dir
# See rst2man(1), rst2html(1), # See rst2man(1), rst2html(1),
# https://docutils.sourceforge.io/docs/index.html # https://docutils.sourceforge.io/docs/index.html
rst2man $(docs_dir)/boring-backup.ru.1.rst \ rst2man $(DOCS_DIR)/boring-backup.ru.1.rst \
> $(docs_build_dir)/boring-backup.ru.1 > $(DOCS_BUILD_DIR)/boring-backup.ru.1
sed -e 's/.SH NAME/.SH ИМЯ/' \ sed -e 's/.SH NAME/.SH ИМЯ/' \
-e 's/.SH AUTHOR/.SH АВТОРЫ/' \ -e 's/.SH AUTHOR/.SH АВТОРЫ/' \
-e 's/.SH COPYRIGHT/.SH АВТОРСКИЕ ПРАВА/' \ -e 's/.SH COPYRIGHT/.SH АВТОРСКИЕ ПРАВА/' \
-i $(docs_build_dir)/boring-backup.ru.1 -i $(DOCS_BUILD_DIR)/boring-backup.ru.1
gzip -9 $(docs_build_dir)/boring-backup.ru.1 gzip -9 $(DOCS_BUILD_DIR)/boring-backup.ru.1
build_dir: build_dir:
mkdir -p $(build_dir) mkdir -p $(BUILD_DIR)
mkdir -p $(docs_build_dir) mkdir -p $(DOCS_BUILD_DIR)
install:
# install
uninstall:
# uninstall