-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
46 lines (34 loc) · 1.61 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
SEMANTICS_FILES ::= $(shell find rust-semantics/ -type f -a '(' -name '*.md' -or -name '*.k' ')')
RUST_KOMPILED ::= .build/rust-kompiled
RUST_TIMESTAMP ::= $(RUST_KOMPILED)/timestamp
SYNTAX_INPUT_DIR ::= tests/syntax
SYNTAX_OUTPUT_DIR ::= .build/syntax-output
EXECUTION_INPUT_DIR ::= tests/execution
EXECUTION_OUTPUT_DIR ::= .build/execution-output
SYNTAX_INPUTS ::= $(wildcard $(SYNTAX_INPUT_DIR)/*.rs)
SYNTAX_OUTPUTS ::= $(patsubst $(SYNTAX_INPUT_DIR)/%.rs,$(SYNTAX_OUTPUT_DIR)/%.rs-parsed,$(SYNTAX_INPUTS))
EXECUTION_INPUTS ::= $(wildcard $(EXECUTION_INPUT_DIR)/*.rs)
EXECUTION_OUTPUTS ::= $(patsubst $(EXECUTION_INPUT_DIR)/%.rs,$(EXECUTION_OUTPUT_DIR)/%.rs.executed.kore,$(EXECUTION_INPUTS))
INDEXING_OUTPUTS ::= $(patsubst %.rs.executed.kore,%.rs.indexed.kore,$(EXECUTION_OUTPUTS))
EXECUTION_STATUSES ::= $(patsubst %.rs.executed.kore,%.rs.status,$(EXECUTION_OUTPUTS))
.PHONY: clean build test syntax-test indexing-test
clean:
rm -r .build
build: $(RUST_TIMESTAMP)
test: syntax-test indexing-test
syntax-test: $(SYNTAX_OUTPUTS)
indexing-test: $(INDEXING_OUTPUTS)
$(RUST_TIMESTAMP): $(SEMANTICS_FILES)
$$(which kompile) rust-semantics/rust.md -o $(RUST_KOMPILED)
$(SYNTAX_OUTPUT_DIR)/%.rs-parsed: $(SYNTAX_INPUT_DIR)/%.rs $(RUST_TIMESTAMP)
mkdir -p $(SYNTAX_OUTPUT_DIR)
kast --definition $(RUST_KOMPILED) $< --sort Crate > [email protected] && mv -f [email protected] $@
$(EXECUTION_OUTPUT_DIR)/%.rs.indexed.kore: $(EXECUTION_INPUT_DIR)/%.rs $(RUST_TIMESTAMP)
mkdir -p $(EXECUTION_OUTPUT_DIR)
krun \
$< \
--definition $(RUST_KOMPILED) \
--output kore \
--output-file [email protected]
cat [email protected] | grep -q "Lbl'-LT-'k'-GT-'{}(dotk{}())"
mv -f [email protected] $@