This repository has been archived by the owner on May 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdefault.mk
73 lines (62 loc) · 1.96 KB
/
default.mk
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Copyright (C) 2021 Serghei Iakovlev <egrep@protonmail.ch>
#
# This file is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this file. If not, see <https://www.gnu.org/licenses/>.
# Run “make build” by default
.DEFAULT_GOAL = build
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
PKG_NAME = branch
ifneq ($(TERM),)
GREEN := $(shell tput setaf 2)
RESET := $(shell tput sgr0)
CS = "${GREEN}~~~ "
CE = " ~~~${RESET}"
else
CS = "~~~ "
CE = " ~~~"
endif
COV =
REQUIREMENTS = requirements/requirements.txt requirements/requirements-dev.txt
PYTEST_FLAGS ?= --color=yes -v
PYLINT_FLAGS ?= --load-plugins=pylint_django --django-settings-module=$(PKG_NAME).settings
FLAKE8_FLAGS ?= --show-source --statistics
VENV_ROOT = .venv
# PYTHON will used to create venv
ifeq ($(OS),Windows_NT)
NPM ?= npm.exe
PYTHON ?= python.exe
VENV_BIN = $(VENV_ROOT)/Scripts
else
NPM ?= npm
PYTHON ?= python3
VENV_BIN = $(VENV_ROOT)/bin
endif
VENV_PYTHON = $(VENV_BIN)/python
VENV_PIP = $(VENV_PYTHON) -m pip
export PATH := $(VENV_BIN):$(PATH)
LOCAL_PORT = 8001
# Program availability
ifndef PYTHON
$(error "Python is not available please install Python")
else
ifneq ($(OS),Windows_NT)
HAVE_PYTHON := $(shell sh -c "command -v $(PYTHON)")
HAVE_NPM := $(shell sh -c "command -v $(NPM)")
ifndef HAVE_PYTHON
$(error "Python is not available. Please install Python.")
endif
ifndef HAVE_NPM
$(error "npm is not available. Please install npm.")
endif
endif
endif