forked from informagi/REL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (34 loc) · 1 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
SHELL := bash
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MKFILE_DIR := $(realpath $(dir $(MKFILE_PATH)))
########################
# PYTHON CONFIGURATION #
########################
# Executables and default options
PYTHON ?= python3
PIP ?= $(PYTHON) -m pip
VENV ?= $(PYTHON) -m virtualenv
PIP_OPTS ?=
VENV_OPTS ?=
# Project directories
VENVDIR ?= venv
# Virtualenv enabled by default, set to 0 to disable
WITH_VENV ?= 1
ifneq (0, $(WITH_VENV))
VENVACTIVATE := test -d $(VENVDIR) || $(VENV) $(VENV_OPTS) $(VENVDIR); source $(VENVDIR)/bin/activate;
endif
###########
# TARGETS #
###########
.PHONY: deps clean clean-pycache clean-venv cleanall
deps:
@$(VENVACTIVATE) $(PIP) $(PIP_OPTS) install -r requirements.txt
build:
@$(VENVACTIVATE) $(PYTHON) setup.py sdist bdist_wheel
clean:
@rm -rf build dist *.egg-info
clean-pycache:
@find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
clean-venv:
@rm -rf $(VENVDIR)
cleanall: clean clean-pycache clean-venv