forked from routedbits/dn42-peers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (27 loc) · 812 Bytes
/
Makefile
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
VENVDIR ?= venv
VENV ?= $(VENVDIR)/bin
VENV_MARKER := .makefile_venv
PY := python3
default: peering
.PHONY: venv
venv: $(VENVDIR)/$(VENV_MARKER)
.PHONY: venv-clean
venv-clean:
-rm -rf "$(VENVDIR)"
$(VENV):
$(PY) -m venv $(VENVDIR)
$(VENVDIR)/$(VENV_MARKER): requirements.txt | $(VENV)
$(VENV)/pip install -r requirements.txt
touch $(VENVDIR)/$(VENV_MARKER)
SHELL:=/bin/bash
##
# TASKS
##
.PHONY: peering
peering: venv ## make peering # Interactively create a new peerng
@. venv/bin/activate; python interactive.py
.PHONY: validate
validate: venv ## make validate # Validate the peering configurations
@. venv/bin/activate; python validate_config.py
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'