-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathMakefile
More file actions
139 lines (107 loc) · 3.39 KB
/
Copy pathMakefile
File metadata and controls
139 lines (107 loc) · 3.39 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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
BASE_IMAGE?=debian:12.8-slim
BUILD_DIR=build-debian-12
# Your video directory
VIDEO_DIR?=$(PWD)
# 11: bullseye
config-debian-bullseye:
$(eval GTK=ON)
$(eval BASE_IMAGE=debian:bullseye)
$(eval BUILD_DIR=build-debian-bullseye)
# 12: bookworm
config-debian-bookworm:
$(eval GTK=ON)
$(eval BASE_IMAGE=debian:bookworm)
$(eval BUILD_DIR=build-debian-bookworm)
# 22.04: jammy
config-ubuntu-jammy:
$(eval GTK=OFF)
$(eval BASE_IMAGE=ubuntu:22.04)
$(eval BUILD_DIR=build-ubuntu-jammy)
# 24.04: noble
config-ubuntu-noble:
$(eval GTK=ON)
$(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-bookworm 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-bookworm 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-bookworm run-gpx2video
run-ubuntu-jammy: config-ubuntu-jammy run-gpx2video
run-ubuntu-noble: config-ubuntu-noble run-gpx2video
# Dev
dev-debian-bullseye: config-debian-bullseye dev-gpx2video
dev-debian-bookworm: config-debian-bookworm dev-gpx2video
dev-ubuntu-jammy: config-ubuntu-jammy dev-gpx2video
dev-ubuntu-noble: config-ubuntu-noble dev-gpx2video
build-docker:
-cp /etc/locale.gen docker
docker build --build-arg BASE_IMAGE=$(BASE_IMAGE) \
-t "gpx2video-$(BASE_IMAGE)" \
-f docker/$(if $(patsubst ON,,$(GTK)),DockerfileWithoutGTK,DockerfileWithGTK) .
-rm docker/locale.gen
dev-gpx2video:
mkdir -p $(BUILD_DIR)
docker run --rm -it \
-e LANG=$(LANG) \
-e LANGUAGE=$(LANG) \
-e LC_ALL=$(LANG) \
-e XDG_RUNTIME_DIR=/tmp \
-e WAYLAND_DISPLAY=$(WAYLAND_DISPLAY) \
-v /etc/timezone:/etc/timezone \
-v /etc/localtime:/etc/localtime \
-v /etc/locale.gen:/etc/locale.gen \
-v /etc/locale.conf:/etc/locale.conf \
-v $(XDG_RUNTIME_DIR)/$(WAYLAND_DISPLAY):/tmp/$(WAYLAND_DISPLAY) \
-u $(shell id -u):$(shell id -g) \
-v $(PWD)/$(BUILD_DIR):/app/build \
-v $(PWD):/app \
-v $(VIDEO_DIR):/data \
--workdir=/app/build \
gpx2video-$(BASE_IMAGE) \
/bin/bash
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=$(GTK) .. \
&& $(MAKE) -j"
run-gpx2video:
mkdir -p $(BUILD_DIR)
docker run --rm -it \
-e LANG=$(LANG) \
-e LC_ALL=$(LANG) \
-e XDG_RUNTIME_DIR=/tmp \
-e WAYLAND_DISPLAY=$(WAYLAND_DISPLAY) \
-v /etc/timezone:/etc/timezone \
-v /etc/localtime:/etc/localtime \
-v /etc/locale.gen:/etc/locale.gen \
-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)