Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (40 loc) · 2.02 KB
/
Copy pathMakefile
File metadata and controls
59 lines (40 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.DEFAULT_GOAL := build
.PHONY: help all install test dev coverage clean gc build archive release cloc
PROJECT_NAME := mountin
MOUNTIN_BUILD_PLATFORM ?= $(shell ./scripts/canonical_arch.sh)-linux
REGISTRY ?= localhost
LEVEL ?= patch
export MOUNTIN_BUILD_PLATFORM
export REGISTRY
all: .venv/.installed-dev ## build all locally buildable output platforms
.venv/bin/mountin-build outputs --all-platforms | xargs -r .venv/bin/mountin-build build
install: .venv/.installed ## install the venv and project packages
dev: .venv/.installed-dev ## prepare local repo and venv for dev
test: ## run the project's tests with the existing Python environment
.venv/bin/python -m pytest .
coverage: .venv/.installed-dev scripts/coverage.sh ## build the html coverage report
scripts/coverage.sh $(PROJECT_NAME)
build: .venv/.installed-dev scripts/build.sh ## build host-compatible outputs
scripts/build.sh
clean: ## delete caches and the venv
scripts/clean.sh
gc: .venv/.installed-dev ## collect obsolete mountin build state
.venv/bin/mountin-build gc
archive: scripts/archive.sh scripts/Dockerfile.archive scripts/archive-build.sh scripts/registries.archive.conf scripts/TIME_CAPSULE.md ## build complete archive in container
scripts/archive.sh
release: ## test, bump, tag and push a release (LEVEL=patch|minor|major)
scripts/release.sh "$(LEVEL)"
# Python project infrastructure
.venv/.installed: pyproject.toml .venv/bin/activate scripts/install.sh $(shell find src -name '*.py')
scripts/install.sh $(PROJECT_NAME)
.venv/.installed-dev: pyproject.toml .venv/bin/activate scripts/install-dev.sh
scripts/install-dev.sh $(PROJECT_NAME)
.venv/bin/activate:
scripts/venv.sh
cloc: .venv/bin/cloc ## count lines of code
.venv/bin/cloc --vcs=git .
.venv/bin/cloc: .venv/bin/activate
curl -sL https://raw.githubusercontent.com/AlDanial/cloc/refs/heads/master/cloc -o .venv/bin/cloc
chmod +x .venv/bin/cloc
help: ## Show this help
@egrep -h '\s##\s' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'