Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (42 loc) · 1.45 KB
/
Copy pathMakefile
File metadata and controls
52 lines (42 loc) · 1.45 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
SHELL := /bin/bash
PYTHONPATH := $(PWD)
ASYNC_RUST_DEBUGGER_TEMP_DIR := $(PWD)/temp
.PHONY: all env check-rust install-rust check-ddbug
all: env
env: check-rust
check-rust:
@if ! command -v rustc >/dev/null 2>&1; then \
echo "Rust not found — installing via rustup..."; \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh; \
echo "After install, run 'source $$HOME/.cargo/env' or restart your shell to have cargo in PATH."; \
else \
echo "Rust is installed: $$(rustc --version)"; \
fi
# Usage: make compile TESTCASE=<testcase-name>
# `cargo build -vv` for verbose output
# `RUSTFLAGS="-C dwarf-version=5 -C llvm-args=-emit-call-site-info -C llvm-args=-debug-entry-values"`
# doesn't work currently
compile:
@if [ -z "$(TESTCASE)" ]; then \
echo "Usage: make compile TESTCASE=<testcase-name>"; \
exit 1; \
fi
cd testcases/$(TESTCASE) && cargo build
clean:
@if [ -z "$(TESTCASE)" ]; then \
echo "Usage: make clean TESTCASE=<testcase-name>"; \
exit 1; \
fi
cd testcases/$(TESTCASE) && cargo clean
clean-all:
cd testcases/minimal && cargo clean
cd testcases/no_external_runtime && cargo clean
# Usage: make debug TESTCASE=<testcase-name>
debug:
$(MAKE) compile TESTCASE=$(TESTCASE)
$(MAKE) just-debug TESTCASE=$(TESTCASE)
just-debug:
cd testcases/$(TESTCASE) && \
PYTHONPATH=$(PYTHONPATH) \
ASYNC_RUST_DEBUGGER_TEMP_DIR=$(ASYNC_RUST_DEBUGGER_TEMP_DIR) \
gdb -ex "python import async_rust_debugger" target/debug/$(TESTCASE)