Debian Codegraph @

test/jank/Makefile

raw
1 default: help
2
3 # The general philosophy and functionality of this makefile is shamelessly stolen from compiler explorer
4
5 help: # with thanks to Ben Rady
6 @grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
7
8 PODMAN=podman
9
10 data/.built: Dockerfile entry.sh
11 $(PODMAN) build -t cpptrace-container .
12 mkdir -p data
13 touch data/.built
14
15 .PHONY: build
16 build: data/.built ## build the container
17
18 .PHONY: run
19 run: data/.built data/.cloned ## run the container
20 rm -rfv data/jank/compiler+runtime/third-party/cpptrace/include
21 rm -rfv data/jank/compiler+runtime/third-party/cpptrace/src
22 cp -avp ../../include data/jank/compiler+runtime/third-party/cpptrace/include
23 cp -avp ../../src data/jank/compiler+runtime/third-party/cpptrace/src
24 cp -v ../../CMakeLists.txt data/jank/compiler+runtime/third-party/cpptrace/
25 $(PODMAN) run \
26 --user=cpptrace \
27 --cap-drop=all \
28 -v $(realpath data/jank):/opt/work/jank:rw \
29 --tmpfs /opt/work/jank/compiler+runtime/build:rw \
30 -it \
31 cpptrace-container
32
33 .PHONY: clone
34 clone: data/.cloned ## clone code
35
36 data/.cloned:
37 mkdir -p data
38 cd data && git clone --recurse-submodules https://github.com/jank-lang/jank.git && cd jank && git checkout 5668b16
39 touch data/.cloned
40
41 .PHONY: clean
42 clean: ## clean
43 rm -rf data