-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from flashbots/add-makefile
Add makefile for rollup boost
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Heavily inspired by Lighthouse: https://github.com/sigp/lighthouse/blob/stable/Makefile | ||
# and Reth: https://github.com/paradigmxyz/reth/blob/main/Makefile | ||
.DEFAULT_GOAL := help | ||
|
||
GIT_VER ?= $(shell git describe --tags --always --dirty="-dev") | ||
GIT_TAG ?= $(shell git describe --tags --abbrev=0) | ||
|
||
FEATURES ?= | ||
|
||
##@ Help | ||
.PHONY: help | ||
help: ## Display this help. | ||
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
|
||
.PHONY: v | ||
v: ## Show the current version | ||
@echo "Version: ${GIT_VER}" | ||
|
||
##@ Build | ||
|
||
.PHONY: clean | ||
clean: ## Clean up | ||
cargo clean | ||
|
||
.PHONY: build | ||
build: ## Build (debug version) | ||
cargo build --features "$(FEATURES)" | ||
|
||
.PHONY: docker-image | ||
docker-image: ## Build a rollup-boost Docker image | ||
docker build --platform linux/amd64 --build-arg FEATURES="$(FEATURES)" . -t rollup-boost | ||
|
||
##@ Dev | ||
|
||
.PHONY: lint | ||
lint: ## Run the linters | ||
cargo fmt -- --check | ||
cargo clippy --features "$(FEATURES)" -- -D warnings | ||
|
||
.PHONY: test | ||
test: ## Run the tests for rollup-boost | ||
cargo test --verbose --features "$(FEATURES)" | ||
|
||
.PHONY: test-integration | ||
test-integration: ## Run the integration tests for rollup-boost | ||
cargo test --verbose --features integration -- integration::integration_test::tests | ||
|
||
.PHONY: lt | ||
lt: lint test ## Run "lint" and "test" | ||
|
||
.PHONY: fmt | ||
fmt: ## Format the code | ||
cargo fmt | ||
cargo fix --allow-staged | ||
cargo clippy --features "$(FEATURES)" --fix --allow-staged |