forked from tcgoetz/GarminDB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
defines.mk
69 lines (44 loc) · 1.08 KB
/
defines.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
-include my-defines.mk
DIST=dist
PLATFORM=$(shell uname)
#
# Handle multiple Python installs. What python are we using?
#
ifeq ($(PLATFORM), Linux)
TIME ?= $(shell which time)
YESTERDAY = $(sehll date --date yesterday "%m/%d/%Y")
PYTHON2=$(shell which python)
PIP3=$(shell which pip3)
PYTHON3=$(shell which python3)
else ifeq ($(PLATFORM), Darwin) # MacOS
TIME ?= time
YESTERDAY = $(shell date -v-1d +"%m/%d/%Y")
PYTHON2=$(shell which python)
PIP3=$(shell which pip3)
PYTHON3=$(shell which python3)
else
TIME ?= $(shell which time)
PYTHON2=$(shell which python)
PIP3=$(shell which pip3)
PYTHON3=$(shell which python3)
endif
FLAKE8 ?= $(shell which flake8)
PYINSTALLER ?= $(shell which pyinstaller)
#PYTHON ?= ${PYTHON2}
PYTHON ?= $(PYTHON3)
PIP ?= $(PIP3)
#
# Install pip packages as user for devs and to system for pipeline runner
#
ifeq ($(USER), runner)
PIP_INSTALL_OPT ?=
else
PIP_INSTALL_OPT ?= --user
endif
ifeq ($(PYTHON),)
$(error Python not found)
endif
ifeq ($(PIP),)
$(error pip not found)
endif
export TIME PLATFORM PYTHON PIP PIP_INSTALL_OPT YESTERDAY PYINSTALLER FLAKE8