From e73b957161483892618475cd4fe0be3b0d81f8c8 Mon Sep 17 00:00:00 2001 From: ge Date: Thu, 29 Sep 2022 23:46:44 +0300 Subject: [PATCH] Makefile for management --- Makefile | 48 ++++++++++++++---------------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index be7d8fd..f0d4022 100644 --- a/Makefile +++ b/Makefile @@ -1,36 +1,16 @@ -CONTENTDIR = content -STATICDIR = static -BUILDDIR = build +build: + # Build Python package + test -d build/ && rm -rf build/ || true + test -d dist/ && rm -rf dist/ || true + test -d *.egg-info/ && rm -rf *.egg-info/ || true +# python setup.py sdist bdist_wheel + python -m build -all: html +install: + # Install package from built tarball + pip install dist/*.tar.gz -help: - @echo 'Build site' - @echo - @echo 'Available targets:' - @echo - @echo ' html render HTML' - @echo ' serve serve site' - @echo ' css generate Pygments stylesheet' - @echo - @echo 'Run without target to build html' - -html: - test -d $(BUILDDIR) && rm -rf $(BUILDDIR) || true - python rstw - -serve: - if hash http-server; \ - then \ - http-server $(BUILDDIR)/; \ - else \ - python3 -m http.server --directory $(BUILDDIR)/; \ - fi - -css: - mkdir -pv $(STATICDIR)/css/pygments - pygmentize -f html -S $(filter-out $@,$(MAKECMDGOALS)) -a .highlight \ - > $(STATICDIR)/css/pygments/$(filter-out $@,$(MAKECMDGOALS)).css - -%: - @: +dist: + # Copy package to site downloads dir + mkdir -p docs/static/downloads + cp dist/*.tar.gz docs/static/downloads/