-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (61 loc) · 1.96 KB
/
Makefile
File metadata and controls
74 lines (61 loc) · 1.96 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
72
73
74
.PHONY= git solidity-deps build-forge-all build-forge-all-concurrent clean-node-modules clean-solidity-out clean_dcipher $(addprefix run_,$(DIRS))
DCIPHER_MODULE_DIRS := onlyswaps-verifier dsigner
SOLIDITY_DIRS := $(wildcard modules/*-solidity/)
git:
@git submodule update --init --recursive --verbose --progress -j 8
install_solidity_node_deps:
@npm install
generate_rust_bindings:
./generate-bindings.sh;
build_forge_all:
@echo $(SOLIDITY_DIRS)
@for dir in $(SOLIDITY_DIRS); do \
(cd $$dir && npm run build:forge) \
done; \
wait
build_forge_all_concurrent:
@for dir in $(SOLIDITY_DIRS); do \
(cd $$dir && npm run build:forge) & \
done; \
wait
build_cargo: deps
cargo build
build_binaries: deps
cargo build --release --workspace --bins --examples
# Helper to determine binary path for Docker builds
# Usage: make build_docker_randomness-agent
build_docker_%: build_binaries
@if [ -f "target/release/$*" ]; then \
BINARY_PATH="target/release/$*"; \
BINARY_NAME="$*"; \
elif [ -f "target/release/examples/$*" ]; then \
BINARY_PATH="target/release/examples/$*"; \
BINARY_NAME="$*"; \
else \
echo "Error: Binary not found for $*"; \
exit 1; \
fi; \
docker build \
--build-arg BINARY_PATH=$$BINARY_PATH \
--build-arg BINARY_NAME=$$BINARY_NAME \
-t dcipher-$* \
-f Dockerfile .
# If you want to pass args run
# make run_onlyswaps-verifier ARGS="-v"
run_%: deps
cargo run --bin $* -- $(ARGS)
clean_dcipher:
@rm -rf ./target
clean_generated:
@rm -rf ./crates/generated/src/blocklock;
@rm -rf ./crates/generated/src/randomness;
@rm -rf ./crates/generated/src/onlyswaps;
clean_solidity_out:
@for dir in $(SOLIDITY_DIRS); do \
(cd $$dir && find . -name 'out' -type d -prune -exec rm -rf '{}' +) \
done;
clean_node_modules:
@find . -name node_modules -maxdepth 2 -exec rm -rf {} \;
clean: clean_node_modules clean_solidity_out clean_dcipher clean_generated
deps: install_solidity_node_deps build_forge_all generate_rust_bindings
all: git deps build_cargo