forked from LostArtefacts/TRX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (63 loc) · 1.8 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
CWD = $(shell pwd)
HOST_USER_UID = $(shell id -u)
HOST_USER_GID = $(shell id -g)
define build
$(eval TARGET := $(1))
mkdir -p build
docker run --rm \
--user $(HOST_USER_UID):$(HOST_USER_GID) \
--entrypoint /app/docker/game-win/entrypoint.sh \
-e TARGET="$(TARGET)" \
-v $(CWD):/app/ \
rrdash/tr1x:latest
endef
define build-linux
$(eval TARGET := $(1))
mkdir -p build
docker run --rm \
--user $(HOST_USER_UID):$(HOST_USER_GID) \
--entrypoint /app/docker/game-linux/entrypoint.sh \
-e TARGET="$(TARGET)" \
-v $(CWD):/app/ \
rrdash/tr1x-linux:latest
endef
debug:
$(call build,debug)
debugopt:
$(call build,debugoptimized)
release:
$(call build,release)
build-docker-image:
docker build --progress plain . -f docker/game-win/Dockerfile -t rrdash/tr1x
build-docker-image-linux:
docker build --progress plain . -f docker/game-linux/Dockerfile -t rrdash/tr1x-linux
debug-linux:
$(call build-linux,debug)
debugopt-linux:
$(call build-linux,debugoptimized)
release-linux:
$(call build-linux,release)
clean:
-find build/ -type f -delete
-find tools/ -type f \( -ipath '*/out/*' -or -ipath '*/bin/*' -or -ipath '*/obj/*' \) -delete
-find . -mindepth 1 -empty -type d -delete
lint_imports:
tools/sort_imports
lint_format:
bash -c 'shopt -s globstar; clang-format -i **/*.c **/*.h'
lint: lint_format lint_imports
installer:
docker build . -f docker/installer/Dockerfile -t rrdash/tr1x_installer
docker run --rm \
--user $(HOST_USER_UID):$(HOST_USER_GID) \
--network host \
-v $(CWD):/app/ \
rrdash/tr1x_installer
config:
docker build . -f docker/config/Dockerfile -t rrdash/tr1x_config
docker run --rm \
--user $(HOST_USER_UID):$(HOST_USER_GID) \
--network host \
-v $(CWD):/app/ \
rrdash/tr1x_config
.PHONY: debug debugopt release clean lint_imports lint_format lint installer config