Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (52 loc) · 2.02 KB
/
Copy pathMakefile
File metadata and controls
71 lines (52 loc) · 2.02 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.PHONY: all build rebuild build-bench test-all test-c test-python test-go bench bench-light bench-full clean
BUILD_DIR := build
TEST_BIN := $(BUILD_DIR)/test/c/Test
BENCH_LIGHT := $(BUILD_DIR)/src/benchmark/Benchmark_LIGHT
BENCH_FULL := $(BUILD_DIR)/src/benchmark/Benchmark_FULL
# ---------------------------------------------------------------------------
# Build targets
# ---------------------------------------------------------------------------
# Stamp file: touched by build.sh on success to track freshness.
$(BUILD_DIR)/.built: $(shell find src -name '*.c' -o -name '*.h' -o -name '*.cpp') \
ethash.go ethashc.go compat.go go.mod CMakeLists.txt
./build.sh
@touch $(BUILD_DIR)/.built
build: $(BUILD_DIR)/.built
$(BENCH_LIGHT) $(BENCH_FULL): $(BUILD_DIR)/.built
cd $(BUILD_DIR) && make Benchmark_LIGHT Benchmark_FULL
build-bench: $(BENCH_LIGHT) $(BENCH_FULL)
# ---------------------------------------------------------------------------
# Test targets (each depends only on the build it actually needs)
# ---------------------------------------------------------------------------
test-c: $(BUILD_DIR)/.built
./test/c/test.sh
test-python:
./test/python/test.sh
test-go: $(BUILD_DIR)/.built
go test -timeout 9999s
test-all: $(BUILD_DIR)/.built
./test/test.sh
# ---------------------------------------------------------------------------
# Benchmark targets
# ---------------------------------------------------------------------------
bench-light: $(BENCH_LIGHT)
cd $(BUILD_DIR) && ./src/benchmark/Benchmark_LIGHT
bench-full: $(BENCH_FULL)
cd $(BUILD_DIR) && ./src/benchmark/Benchmark_FULL
bench: bench-light bench-full
# ---------------------------------------------------------------------------
# Convenience
# ---------------------------------------------------------------------------
all: test-all bench
rebuild: clean build
clean:
rm -rf \
$(BUILD_DIR)/ \
test/c/build/ \
test/python/python-virtual-env/ \
test/python/*.pyc \
*.so \
pyethash.so \
pyethash.egg-info/ \
dist/ \
MANIFEST