Infra: Declare Makefile targets as phony (#2841)

This commit is contained in:
Hugo van Kemenade 2022-10-22 09:43:53 +02:00 committed by GitHub
parent c0b28dab5b
commit 18b3870e3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -6,27 +6,35 @@ JOBS=8
OUTPUT_DIR=build
RENDER_COMMAND=$(VENVDIR)/bin/python3 build.py -j $(JOBS) -o $(OUTPUT_DIR)
.PHONY: render
render: venv
$(RENDER_COMMAND)
.PHONY: pages
pages: venv rss
$(RENDER_COMMAND) --build-dirs
.PHONY: fail-warning
fail-warning: venv
$(RENDER_COMMAND) --fail-on-warning
.PHONY: check-links
check-links: venv
$(RENDER_COMMAND) --check-links
.PHONY: rss
rss: venv
$(VENVDIR)/bin/python3 generate_rss.py
.PHONY: clean
clean: clean-venv
-rm -rf build topic
.PHONY: clean-venv
clean-venv:
rm -rf $(VENVDIR)
.PHONY: venv
venv:
@if [ -d $(VENVDIR) ] ; then \
echo "venv already exists."; \
@ -38,13 +46,16 @@ venv:
echo "The venv has been created in the $(VENVDIR) directory"; \
fi
.PHONY: lint
lint: venv
$(VENVDIR)/bin/python3 -m pre_commit --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install pre-commit
$(VENVDIR)/bin/python3 -m pre_commit run --all-files
.PHONY: test
test: venv
$(VENVDIR)/bin/python3 -bb -X dev -W error -m pytest
.PHONY: spellcheck
spellcheck: venv
$(VENVDIR)/bin/python3 -m pre_commit --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install pre-commit
$(VENVDIR)/bin/python3 -m pre_commit run --all-files --hook-stage manual codespell