-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
100 lines (71 loc) · 2.26 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
BASE_IMAGE?=debian:12.8-slim
BUILD_DIR=build-debian-12
# Your video directory
VIDEO_DIR?=$(PWD)
# 11: bullseye
config-debian-bullseye:
$(eval BASE_IMAGE=debian:bullseye)
$(eval BUILD_DIR=build-debian-bullseye)
# 12: bookworm
config-debian-bookworm:
$(eval BASE_IMAGE=debian:bookworm)
$(eval BUILD_DIR=build-debian-bookworm)
# 22.04: jammy
config-ubuntu-jammy:
$(eval BASE_IMAGE=ubuntu:22.04)
$(eval BUILD_DIR=build-ubuntu-jammy)
# 24.04: noble
config-ubuntu-noble:
$(eval BASE_IMAGE=ubuntu:24.04)
$(eval BUILD_DIR=build-ubuntu-noble)
all: debian ubuntu
run: build-gpx2video run-gpx2video
# Debian
debian: debian-bullseye debian-bookworm
debian-bullseye: config-debian-bullseye build-docker build-gpx2video
debian-bookworm: config-debian-bullseye build-docker build-gpx2video
# Ubuntu
ubuntu: ubuntu-jammy ubuntu-noble
ubuntu-jammy: config-ubuntu-jammy build-docker build-gpx2video
ubuntu-noble: config-ubuntu-noble build-docker build-gpx2video
# Build
build-debian-bullseye: config-debian-bullseye build-gpx2video
build-debian-bookworm: config-debian-bullseye build-gpx2video
build-ubuntu-jammy: config-ubuntu-jammy build-gpx2video
build-ubuntu-noble: config-ubuntu-noble build-gpx2video
# Exec
run-debian-bullseye: config-debian-bullseye run-gpx2video
run-debian-bookworm: config-debian-bullseye run-gpx2video
run-ubuntu-jammy: config-ubuntu-jammy run-gpx2video
run-ubuntu-noble: config-ubuntu-noble run-gpx2video
build-docker:
docker build --build-arg BASE_IMAGE=$(BASE_IMAGE) \
-t "gpx2video-$(BASE_IMAGE)" \
-f docker/Dockerfile .
build-gpx2video:
mkdir -p $(BUILD_DIR)
docker run --rm -it \
-u $(shell id -u):$(shell id -g) \
-v $(PWD)/$(BUILD_DIR):/app/build \
-v $(PWD):/app \
--workdir=/app/build \
gpx2video-$(BASE_IMAGE) \
/bin/bash -c \
"cmake -DBUILD_GTK=ON .. \
&& $(MAKE) -j"
run-gpx2video:
mkdir -p $(BUILD_DIR)
docker run --rm -it \
-e XDG_RUNTIME_DIR=/tmp \
-e WAYLAND_DISPLAY=$(WAYLAND_DISPLAY) \
-v $(XDG_RUNTIME_DIR)/$(WAYLAND_DISPLAY):/tmp/$(WAYLAND_DISPLAY) \
-u $(shell id -u):$(shell id -g) \
-v $(PWD)/$(BUILD_DIR):/app/build \
-v $(PWD)/assets:/app/build/assets \
-v $(VIDEO_DIR):/data \
--workdir=/app/build \
--name=gpx2video \
gpx2video-$(BASE_IMAGE) \
/bin/bash
clean:
rm -rf ./$(BUILD_DIR)