forked from LostArtefacts/TR1X
-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
55 lines (45 loc) · 1.83 KB
/
justfile
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
CWD := `pwd`
HOST_USER_UID := `id -u`
HOST_USER_GID := `id -g`
default: (build-win "debug")
_docker_build dockerfile tag force="0":
#!/usr/bin/env sh
docker images | grep {{tag}} >/dev/null
if [ $? -eq 0 ] && [ "{{force}}" = "0" ]; then
echo "Docker image {{dockerfile}} is already built"
else
echo "Building Docker image: {{dockerfile}} → {{tag}}"
docker build \
--progress plain \
. \
-f {{dockerfile}} \
-t {{tag}}
fi
_docker_run *args:
@echo "Running docker image: {{args}}"
docker run \
--rm \
--user \
{{HOST_USER_UID}}:{{HOST_USER_GID}} \
--network host \
-v {{CWD}}:/app/ \
{{args}}
image-win force="1": (_docker_build "docker/game-win/Dockerfile" "rrdash/tr1x" force)
image-linux force="1": (_docker_build "docker/game-linux/Dockerfile" "rrdash/tr1x-linux" force)
image-config force="1": (_docker_build "docker/config/Dockerfile" "rrdash/tr1x-config" force)
image-installer force="1": (_docker_build "docker/installer/Dockerfile" "rrdash/tr1x-installer" force)
build-win target='debug': (image-win "0") (_docker_run "-e" "TARGET="+target "rrdash/tr1x")
build-linux target='debug': (image-linux "0") (_docker_run "-e" "TARGET="+target "rrdash/tr1x-linux")
build-config: (image-config "0") (_docker_run "rrdash/tr1x-config")
build-installer: (image-installer "0") (_docker_run "rrdash/tr1x-installer")
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:
#!/usr/bin/env bash
shopt -s globstar
clang-format -i **/*.{c,h}
lint: (lint-imports) (lint-format)