-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
31 lines (25 loc) · 1000 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
PYTHON_CMD = $(shell python3 --version | grep "Python 3" > /dev/null && echo "python3" || (command -v python > /dev/null && echo "python"))
PIP_CMD = $(shell pip3 --version | grep "python 3" > /dev/null && echo "pip3" || (command -v pip > /dev/null && echo "pip"))
LANG := C.UTF-8
LC_ALL := C.UTF-8
export LANG
export LC_ALL
build:
@make assert_python_present > /dev/null
@echo "Rebuilding from templates ..."
@$(PYTHON_CMD) manage.py rebuild index
assert_python_present:
@command -v $(PYTHON_CMD) > /dev/null || ( command -v apt-get > /dev/null && apt-get install -qy python3 || ("Error: Python3 is not installed" ; exit 1 ))
init:
make assert_python_present
@echo "Installing Python dependencies ..."
$(PIP_CMD) install -r requirements.txt || $(PIP_CMD) install -r requirements.txt --user
vars:
echo $(PIP_CMD)
echo $(PYTHON_CMD)
test:
@echo "Python binary: $(PYTHON_CMD)"
@echo "Building HTML ..."
@make build
@echo "Validating HTML ..."
$(PYTHON_CMD) tests/test_valid_html.py