forked from ThomasGerstenberg/blatann
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (37 loc) · 1.07 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
# Suspend command echo for non-verbose builds
ifeq ("$(VERBOSE)","1")
NO_ECHO :=
else
NO_ECHO := @
endif
# Set up project-relative source paths
BUILD_PATH := $(abspath ./build_tools)
BUILD_OUTPUTS := $(abspath ./dist) $(abspath ./build)
SETUP_SCRIPT := $(abspath ./setup.py)
TEST_ROOT := $(abspath ./tests)
TEST_VERBOSE := -v
REQUIREMENTS = requirements.txt
# Utility commands
RM := $(NO_ECHO)rm -rf
CD := $(NO_ECHO)cd
CP := $(NO_ECHO)cp
TOUCH := $(NO_ECHO)touch
AWK := $(NO_ECHO)gawk
MKDIR := $(NO_ECHO)mkdir
CAT := $(NO_ECHO)cat
# Python-based commands
PYTHON := $(NO_ECHO)python3
PIP := $(PYTHON) -m pip
VENV := $(PYTHON) -m virtualenv
COVERAGE := $(PYTHON) -m coverage
# Target Definitions
.PHONY: all binaries clean run-tests setup-dev
all: binaries
binaries:
$(PYTHON) setup.py bdist_wheel sdist
clean:
$(RM) $(BUILD_OUTPUTS)
setup-dev:
$(PIP) install -r $(REQUIREMENTS)
run-tests:
$(PYTHON) -m unittest discover $(TEST_VERBOSE) -s $(TEST_ROOT) -t $(TEST_ROOT)