Commit bc1eb528 authored by Nicolas "Norswap" Laurent's avatar Nicolas "Norswap" Laurent Committed by norswap

redistribute .PHONY declarations

parent 5fc4c66b
SHELL := /bin/bash SHELL := /bin/bash
build: submodules unicorn minigeth_mips minigeth_default_arch mipsevm contracts build: submodules unicorn minigeth_mips minigeth_default_arch mipsevm contracts
.PHONY: build
# Approximation, use `make unicorn_rebuild` to force. # Approximation, use `make unicorn_rebuild` to force.
unicorn/build: unicorn/CMakeLists.txt unicorn/build: unicorn/CMakeLists.txt
...@@ -12,10 +13,12 @@ unicorn: unicorn/build ...@@ -12,10 +13,12 @@ unicorn: unicorn/build
# The Go linker / runtime expects these to be there! # The Go linker / runtime expects these to be there!
cp unicorn/build/libunicorn.so.1 unicorn cp unicorn/build/libunicorn.so.1 unicorn
cp unicorn/build/libunicorn.so.2 unicorn cp unicorn/build/libunicorn.so.2 unicorn
.PHONY: unicorn
unicorn_rebuild: unicorn_rebuild:
touch unicorn/CMakeLists.txt touch unicorn/CMakeLists.txt
make unicorn make unicorn
.PHONY: unicorn_rebuild
submodules: submodules:
# CI will checkout submodules on its own (and fails on these commands) # CI will checkout submodules on its own (and fails on these commands)
...@@ -23,18 +26,23 @@ submodules: ...@@ -23,18 +26,23 @@ submodules:
git submodule init; \ git submodule init; \
git submodule update; \ git submodule update; \
fi fi
.PHONY: submodules
minigeth_mips: minigeth_mips:
cd mipigo && ./build.sh cd mipigo && ./build.sh
.PHONY: minigeth_mips
minigeth_default_arch: minigeth_default_arch:
cd minigeth && go build cd minigeth && go build
.PHONY: minigeth_default_arch
mipsevm: mipsevm:
cd mipsevm && go build cd mipsevm && go build
.PHONY: mipsevm
contracts: nodejs contracts: nodejs
npx hardhat compile npx hardhat compile
.PHONY: contracts
nodejs: nodejs:
if [ -x "$(command -v pnpm)" ]; then \ if [ -x "$(command -v pnpm)" ]; then \
...@@ -42,6 +50,7 @@ nodejs: ...@@ -42,6 +50,7 @@ nodejs:
else \ else \
npm install; \ npm install; \
fi fi
.PHONY: nodejs
# Must be a definition and not a rule, otherwise it gets only called once and # Must be a definition and not a rule, otherwise it gets only called once and
# not before each test as we wish. # not before each test as we wish.
...@@ -52,6 +61,7 @@ endef ...@@ -52,6 +61,7 @@ endef
clear_cache: clear_cache:
$(call clear_cache) $(call clear_cache)
.PHONY: clear_cache
test_challenge: test_challenge:
$(call clear_cache) $(call clear_cache)
...@@ -61,6 +71,7 @@ test_challenge: ...@@ -61,6 +71,7 @@ test_challenge:
# block 13284469. # block 13284469.
mipsevm/mipsevm && mipsevm/mipsevm 13284469 mipsevm/mipsevm && mipsevm/mipsevm 13284469
npx hardhat test test/challenge_test.js npx hardhat test test/challenge_test.js
.PHONY: test_challenge
test_mipsevm: test_mipsevm:
$(call clear_cache) $(call clear_cache)
...@@ -68,6 +79,7 @@ test_mipsevm: ...@@ -68,6 +79,7 @@ test_mipsevm:
minigeth/go-ethereum 13284469 minigeth/go-ethereum 13284469
minigeth/go-ethereum 13284491 minigeth/go-ethereum 13284491
cd mipsevm && go test -v cd mipsevm && go test -v
.PHONY: test_mipsevm
test_minigeth: test_minigeth:
$(call clear_cache) $(call clear_cache)
...@@ -80,12 +92,15 @@ test_minigeth: ...@@ -80,12 +92,15 @@ test_minigeth:
minigeth/go-ethereum 13284053 minigeth/go-ethereum 13284053
# run block 13303075 (uncles) # run block 13303075 (uncles)
minigeth/go-ethereum 13303075 minigeth/go-ethereum 13303075
.PHONY: test_minigeth
test_contracts: test_contracts:
$(call clear_cache) $(call clear_cache)
npx hardhat test npx hardhat test
.PHONY: test_contracts
test: test_challenge test_mipsevm test_minigeth test: test_challenge test_mipsevm test_minigeth
.PHONY: test
clean: clean:
rm -f minigeth/go-ethereum rm -f minigeth/go-ethereum
...@@ -93,12 +108,10 @@ clean: ...@@ -93,12 +108,10 @@ clean:
rm -f mipigo/minigeth.bin rm -f mipigo/minigeth.bin
rm -f mipsevm/mipsevm rm -f mipsevm/mipsevm
rm -rf artifacts rm -rf artifacts
.PHONY: clean
mrproper: clean mrproper: clean
rm -rf cache rm -rf cache
rm -rf node_modules rm -rf node_modules
rm -rf mipigo/venv rm -rf mipigo/venv
.PHONY: mrproper
.PHONY: build unicorn submodules minigeth_mips minigeth_default_arch mipsevm contracts \
nodejs clean mrproper test_challenge test_mipsevm test_minigeth test
clear_cache unicorn_rebuild
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment