forked from egraphs-good/extraction-gym
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (34 loc) · 838 Bytes
/
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
FEATURES ?=
FLAGS=--release --features=$(FEATURES)
EXTRACTORS=$(shell cargo run -q $(FLAGS) -- --extractor=print)
PROGRAM=target/release/extraction-gym
SRC=$(shell find . -name '.rs') Cargo.toml Cargo.lock
DATA=$(shell find data -name '*.json')
TARGETS=
.PHONY: all
all: test nits bench
define run-extraction
TARGETS += $(1:data/%=output/%)-$(2).json
$(1:data/%=output/%)-$(2).json: $(1)
@mkdir -p $$(dir $$@)
$(PROGRAM) $$< --extractor=$(2) --out=$$@
endef
$(foreach ext,$(EXTRACTORS),\
$(foreach data,$(DATA),\
$(eval $(call run-extraction,$(data),$(ext)))\
)\
)
.PHONY: bench
bench: plot.py $(TARGETS)
./$^
$(PROGRAM): $(SRC)
cargo build $(FLAGS)
.PHONY: test
test:
cargo test --release
.PHONY: nits
nits:
rustup component add rustfmt clippy
cargo fmt -- --check
cargo clean --doc
cargo clippy --tests