mirror of
https://github.com/naruxde/revpimodio2.git
synced 2025-11-08 22:03:53 +01:00
47 lines
903 B
Makefile
47 lines
903 B
Makefile
SHELL := bash
|
|
MAKEFLAGS = --no-print-directory --no-builtin-rules
|
|
.DEFAULT_GOAL = all
|
|
|
|
# Variables
|
|
PACKAGE = revpimodio2
|
|
|
|
# If virtualenv exists, use it. If not, use PATH to find, except python3
|
|
SYSTEM_PYTHON = /usr/bin/python3
|
|
PYTHON = $(or $(wildcard venv/bin/python), $(SYSTEM_PYTHON))
|
|
|
|
all: build docs
|
|
|
|
.PHONY: all
|
|
|
|
## Environment
|
|
venv:
|
|
$(SYSTEM_PYTHON) -m venv venv
|
|
source venv/bin/activate && \
|
|
python3 -m pip install --upgrade pip && \
|
|
python3 -m pip install -r requirements.txt
|
|
exit 0
|
|
|
|
.PHONY: venv
|
|
|
|
## Build, install
|
|
build:
|
|
$(PYTHON) -m setup sdist
|
|
$(PYTHON) -m setup bdist_wheel
|
|
|
|
install: build
|
|
$(PYTHON) -m pip install dist/$(PACKAGE)-*.whl
|
|
|
|
docs:
|
|
$(PYTHON) -m sphinx.cmd.build -b html docs docs/_build/html
|
|
|
|
.PHONY: build docs install
|
|
|
|
## Clean
|
|
clean:
|
|
rm -rf build docs/_build dist src/*.egg-info *.spec
|
|
|
|
clean-all: clean
|
|
rm -R venv
|
|
|
|
.PHONY: clean clean-all
|