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

redistribute .PHONY declarations

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