Files
obikmer/Makefile
T

65 lines
1.8 KiB
Makefile
Raw Normal View History

2026-04-16 22:38:20 +02:00
VENV := .venv
PYTHON := $(VENV)/bin/python
PIP := $(VENV)/bin/pip
MKDOCS := $(VENV)/bin/mkdocs
CARGO_DIR := src
DOC_DIR := docmd
DOC_FILE := mkdocs.yml
DOC_SITE := doc
DOC_PORT := 8001
# ── virtualenv ────────────────────────────────────────────────────────────────
$(VENV)/bin/activate:
python3 -m venv $(VENV)
$(MKDOCS): $(VENV)/bin/activate
$(PIP) install --quiet --upgrade pip
$(PIP) install --quiet \
livereload watchdog \
mkdocs mkdocs-material \
mkdocs-mermaid2-plugin \
mkdocs-bibtex
# ── obikmer binary ───────────────────────────────────────────────────────────
2026-04-27 20:17:06 +02:00
PROFILE_FILE := profile.pb
PPROF_PORT := 8081
2026-04-16 22:38:20 +02:00
.PHONY: obikmer
obikmer:
cargo build --release --manifest-path $(CARGO_DIR)/Cargo.toml --bin obikmer
2026-04-27 20:17:06 +02:00
.PHONY: debug
2026-04-16 22:38:20 +02:00
debug:
cargo build --manifest-path $(CARGO_DIR)/Cargo.toml --bin obikmer
2026-04-27 20:17:06 +02:00
.PHONY: profile-build
profile-build:
cargo build --release --manifest-path $(CARGO_DIR)/Cargo.toml \
--bin obikmer --features obikmer/profiling
.PHONY: profile-view
profile-view:
go tool pprof -http=127.0.0.1:$(PPROF_PORT) $(PROFILE_FILE)
2026-04-16 22:38:20 +02:00
# ── documentation ─────────────────────────────────────────────────────────────
.PHONY: doc
doc: $(MKDOCS)
$(MKDOCS) build -f $(DOC_FILE)
.PHONY: doc-serve
doc-serve: $(MKDOCS)
$(MKDOCS) serve -f $(DOC_FILE) \
--dev-addr=127.0.0.1:$(DOC_PORT) \
--livereload
.PHONY: clean-doc
clean-doc:
rm -rf $(DOC_SITE)/
.PHONY: clean
clean: clean-doc
rm -rf $(VENV)