-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathMakefile
57 lines (48 loc) · 1.64 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Goal of the makefile is to simplify managing and operating application
# You need to install GNU Make on your operating system in order to call `make` command.
# Windows: http://gnuwin32.sourceforge.net/packages/make.htm (make sure path to make.exe is added to PATH)
# Ubuntu: make is already installed
# Call `make help` to see list of available commands
# Important: when editing use *tabs* (not spaces) otherwise Makefile won't work!
# Important: each line runs in *separated subprocess*. if you need to chain commands use: cmd1 && cmd2
# ---------
# Variables
# ---------
# Project root directory
PROJ_DIR=.
# Path to requirements
REQ=requirements.txt
# Python executable
PYTHON=python
# Pip executable
PIP=pip
# -------
# Targets
# -------
all: help
help:
@echo Following commands helps to operate the project.
@echo Make sure you are in project root directory and venv is active.
@echo ----------------------------- OPS-------------------------------------
@echo ' make build'
@echo ' Installs pip dependecies.'
@echo ' make doc'
@echo ' Builds documentation.'
@echo ' make serve'
@echo ' Starts build-in web server to preview doc.'
@echo ''
# ensures virtual env is activated
virtual_env_set:
ifndef VIRTUAL_ENV
$(error Virtual environment $(VENV) is not active. Type `workon $(VENV)` to activate it)
endif
# builds project from scratch
# installs or upgrades dependencies using pip
build: virtual_env_set $(REQ)
$(PIP) install --upgrade -r $(REQ)
# starts build-in web server that previews the doc
serve: virtual_env_set mkdocs.yml
mkdocs serve
# builds documentation
doc: virtual_env_set mkdocs.yml
mkdocs build --clean