home » zplus/dokk.git
ID: a6b90163bf7c9549a1989106a5b4c6fca6abddca
59 lines — 1K — View raw


SHELL = /bin/bash

REPOSITORY = https://github.com/python-websockets/websockets.git

check_env_vars:
ifdef OUTPUT_PATH
OUTPUT_PATH := ${OUTPUT_PATH}/python-websockets
else
	$(error OUTPUT_PATH is undefined)
endif

venv-3.10:
	export PYENV_VERSION=3.10
	python3 -m venv venv

venv-3.7:
	export PYENV_VERSION=3.7
	python3 -m venv venv

repository:
	git clone ${REPOSITORY} repository

10.4 11.0.3 12.0: check_env_vars venv-3.10 repository
	source venv/bin/activate
	cd repository
	git checkout tags/$@
	pip install -r docs/requirements.txt
	cd docs
	make clean
	make dirhtml
	mkdir --parents "${OUTPUT_PATH}"
	cp --recursive _build/dirhtml "${OUTPUT_PATH}/$@"

8.1 9.1: check_env_vars venv-3.7 repository
	source venv/bin/activate
	cd repository
	git checkout tags/$@
	pip install -r docs/requirements.txt
	cd docs
	make clean
	make dirhtml
	mkdir --parents "${OUTPUT_PATH}"
	cp --recursive _build/dirhtml "${OUTPUT_PATH}/$@"

5.0.1 6.0 7.0: check_env_vars venv-3.7 repository
	source venv/bin/activate
	cd repository
	git checkout tags/$@
	pip install "sphinx < 6"
	cd docs
	make clean
	make dirhtml
	mkdir --parents "${OUTPUT_PATH}"
	cp --recursive _build/dirhtml "${OUTPUT_PATH}/$@"

.ONESHELL:
.SUFFIXES:
.PHONY:
.DELETE_ON_ERROR: