-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
26 lines (20 loc) · 894 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
TESTS = $(patsubst %,%/success,$(shell find tests -mindepth 1 -maxdepth 1 -type d))
FFISHIM_SRC = $(shell find ffishim ffishim_derive -type f)
all: $(TESTS)
@echo "-----------------------------"
@echo "--- All tests successful! ---"
@echo "-----------------------------"
tests/%/success: tests/%/expected_output tests/%/actual_output
diff $^
touch $@
tests/%/actual_output: tests/%/a.out
valgrind --error-exitcode=1 --leak-check=full $< | tee $@
tests/%/a.out: tests/%/main.c target/debug/lib%.a tests/helpers.h
$(CC) $(CFLAGS) -o $@ $(word 1,$^) $(word 2,$^) -ldl -lm -pthread
target/debug/lib%.a: tests/%/src/lib.rs tests/%/Cargo.toml $(FFISHIM_SRC)
cargo build --package $(patsubst target/debug/lib%.a,%,$@)
clean:
# Anything that needs cleaning can be listed in the
# .gitignore file. The `git clean -fdX` call removes all
# files listed in the .gitignore.
git clean -fdX