-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
35 lines (25 loc) · 935 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
.PHONY: check-venv check-not-venv usage resources
usage:
@echo "usage: make <target>"
@echo "venv: Create a Python virtual environment and install requirements"
@echo "pinout: Build the website HTML"
pinout: build check-venv
python build.py
cp -r resources build
resources: build
cp -r resources/* build/resources/
build:
mkdir build
mkdir build/resources
venv: check-not-venv requirements.txt
python -m virtualenv venv
. venv/bin/activate; printf "Entering Virtual Environment: $$VIRTUAL_ENV\n"; pip install -r requirements.txt
@echo "Virtual Environment prepared, use \"source venv/bin/activate\" to activate."
check-venv:
ifndef VIRTUAL_ENV
$(error Not currently running in a Python Virtual Environment, run "source ./venv/bin/activate" first)
endif
check-not-venv:
ifdef VIRTUAL_ENV
$(error Currently running a Python Virtual Environment, run "deactivate" first)
endif