-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (47 loc) · 1.72 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
SHELL := /bin/bash
.PHONY: all help requirements
TMPDIR := ./.tmp
LOCALBIN := ~/.local/bin
HOSTCTL_RELEASE := 1.1.1
HOSTCTLGET := wget -q -c --directory-prefix=./.tmp
HOSTCTLTARGET := $(TMPDIR)/hostctl$(HOSTCTL_RELEASE)
HOSTCTLUNARCHIVE :=
HOSTCTLCOPY :=
MKDIR_P :=
ifeq ($(OS),Windows_NT)
HOSTCTLGET += https://github.com/guumaster/hostctl/releases/download/v$(HOSTCTL_RELEASE)/hostctl_$(HOSTCTL_RELEASE)_windows_64-bit.zip
HOSTCTLGET += -O $(HOSTCTLTARGET)
HOSTCTLUNARCHIVE += unzip $(HOSTCTLTARGET)
HOSTCTLCOPY += copy $(TMPDIR)/hostctl.exe $(LOCALBIN)
MKDIR_P += md
else
UNAME_S := $(shell uname -s)
MKDIR_P += mkdir -p
ifeq ($(UNAME_S),Linux)
HOSTCTLGET += https://github.com/guumaster/hostctl/releases/download/v$(HOSTCTL_RELEASE)/hostctl_$(HOSTCTL_RELEASE)_linux_64-bit.tar.gz
HOSTCTLGET += -O $(HOSTCTLTARGET)
HOSTCTLUNARCHIVE += tar -xzf $(HOSTCTLTARGET) -C $(TMPDIR) --wildcards hostctl*
HOSTCTLCOPY += cp $(TMPDIR)/hostctl $(LOCALBIN)
endif
ifeq ($(UNAME_S),Darwin)
HOSTCTLGET += https://github.com/guumaster/hostctl/releases/download/v$(HOSTCTL_RELEASE)/hostctl_$(HOSTCTL_RELEASE)_macOS_64-bit.tar.gz
HOSTCTLGET += -O $(HOSTCTLTARGET)
HOSTCTLUNARCHIVE += tar -xzf $(HOSTCTLTARGET) -C $(TMPDIR) --wildcards hostctl*
HOSTCTLCOPY += cp $(TMPDIR)/hostctl $(LOCALBIN)
endif
endif
help:
@echo "Make commands"
@echo " requirements install all requirements"
requirements:
ifneq ($(OS),Windows_NT)
ifeq ("$(wildcard $(TMPDIR))", "")
$(MKDIR_P) $(TMPDIR)
endif
ifeq ("$(wildcard $(LOCALBIN))", "")
$(MKDIR_P) $(LOCALBIN)
endif
python3 -m pip install -r s3-backup/requirements.txt
python3 -m pip install -r sct/requirements.txt
python3 -m pip install -r dbcmetrics/requirements.txt
endif