-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmakefile
More file actions
52 lines (42 loc) · 1.83 KB
/
Copy pathmakefile
File metadata and controls
52 lines (42 loc) · 1.83 KB
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
DEPS_DRIVERSHUB := $(shell find src/ -type f -not -path "src/bannergen/*" -not -path "src/languages/*")
DEPS_BANNERGEN := $(shell find src/bannergen/ -type f)
BUILD_DIR := build
DIST_DIR := dist
RELEASE_DIR := releases
VENV_DIR := .venv-build
.PHONY: release build install install-system install-python clean
release: build
tar -czf $(RELEASE_DIR)/drivershub.tar.gz -C $(DIST_DIR) ./
build: $(DIST_DIR)/drivershub $(DIST_DIR)/bannergen
cp -r src/languages/ $(DIST_DIR)/languages/ && \
cp -r src/bannergen/fonts $(DIST_DIR)/fonts/ && \
mkdir -p $(DIST_DIR)/config && \
cp config_sample.json $(DIST_DIR)/config/ && \
cp openapi.json $(DIST_DIR)/
$(DIST_DIR)/drivershub: $(DEPS_DRIVERSHUB)
. $(VENV_DIR)/bin/activate && \
python3 -m nuitka src/main.py --output-dir=$(BUILD_DIR)/drivershub --output-filename=drivershub \
--standalone --include-package=websockets,tzdata --include-package-data=tzdata \
--show-progress --prefer-source-code
mkdir -p $(DIST_DIR)
cp -r $(BUILD_DIR)/drivershub/main.dist/* $(DIST_DIR)/
$(DIST_DIR)/bannergen: $(DEPS_BANNERGEN)
. $(VENV_DIR)/bin/activate && \
python3 -m nuitka src/bannergen/main.py --output-dir=$(BUILD_DIR)/bannergen \
--output-filename=bannergen --standalone --include-package=websockets \
--show-progress --prefer-source-code
mkdir -p $(DIST_DIR)
cp -r $(BUILD_DIR)/bannergen/main.dist/* $(DIST_DIR)/
install: install-system install-python
install-system:
# note: g++ is needed for cysimdjson
apt update
apt install -y gcc g++ ccache patchelf python3-dev python3-venv
apt install -y libmariadb-dev python3-simplejson python3-numpy python3-nacl python3-markupsafe
install-python:
# note: if using podman, dev-use venv is not mounted from host
python3 -m venv $(VENV_DIR)
. $(VENV_DIR)/bin/activate && \
pip3 install -r requirements.txt
clean:
rm -rf $(BUILD_DIR)/* $(DIST_DIR)/* $(VENV_DIR)