rSW/Makefile

37 lines
690 B
Makefile
Raw Normal View History

2022-09-29 07:53:42 +03:00
CONTENTDIR = content
STATICDIR = static
BUILDDIR = build
all: html
help:
@echo 'Build site'
@echo
@echo 'Available targets:'
@echo
@echo ' html render HTML'
@echo ' serve serve site'
@echo ' css <theme> 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
%:
@: