-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
64 lines (54 loc) · 1.74 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
54
55
56
57
58
59
60
61
62
63
64
#
# Google Authenticator Export Helper.
#
# 2021-∞ (c) blurryroots innovation qanat OÜ. All rights reserved.
# See license.md for details.
#
# https://think-biq.com
FILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
PROJECT_DIR := $(shell dirname $(FILE_PATH))
PROJECT_NAME := $(notdir $(patsubst %/,%,$(dir $(FILE_PATH))))
DEBUG_FLAG :=
BUILD_PATH = "${PROJECT_DIR}/build"
ifeq '$(findstring ;,$(PATH))' ';'
OS = "win"
VENV_BIN_DIR = Scripts
STD_FLAG = "/std:c++17 /EHa"
EXE_NAME = gaeh
BUILD_PATH_RELEASE = "${BUILD_PATH}/Release"
EXE_PATH_RELEASE = "${BUILD_PATH_RELEASE}/${EXE_NAME}"
BUILD_PATH_DEBUG = "${BUILD_PATH}/Debug"
EXE_PATH_DEBUG = "${BUILD_PATH_DEBUG}/${EXE_NAME}"
LLDB = lldb
PYTHON = python
PYTHON_EXECUTABLE := "${shell $(PYTHON) -c "import sys; print(sys.executable)"}"
else
OS = "unix-y"
VENV_BIN_DIR = bin
STD_FLAG = "--std=c++17"
EXE_NAME = gaeh
BUILD_PATH_RELEASE = "${BUILD_PATH}"
EXE_PATH_RELEASE = "${BUILD_PATH_RELEASE}/${EXE_NAME}"
BUILD_PATH_DEBUG = "${BUILD_PATH}"
EXE_PATH_DEBUG = "${BUILD_PATH_DEBUG}/${EXE_NAME}"
LLDB = lldb
PYTHON := python3
PYTHON_EXECUTABLE := $(shell which $(PYTHON))
endif
CMD_ACTIVATE_VENV = . "$(PROJECT_DIR)/$(VENV_BIN_DIR)/activate"
CMD_DEACTIVATE_VENV = (declare -f deactivate > /dev/null && deactivate) || true
all: prepare build-wheel install-wheel
clean:
$(CMD_DEACTIVATE_VENV)
rm -rf pyvenv.cfg build dist
prepare:
$(CMD_DEACTIVATE_VENV)
python3 -m venv .
$(CMD_ACTIVATE_VENV); pip install -r requirements.txt
build-wheel:
$(CMD_ACTIVATE_VENV); python3 setup.py bdist_wheel
install-wheel: build-wheel
$(CMD_ACTIVATE_VENV); python3 -m pip install gaeh \
--force-reinstall --no-index --find-links="$(PROJECT_DIR)/dist"
venv-session:
$(CMD_ACTIVATE_VENV); python3