Skip to content

Commit

Permalink
Merge pull request #102 from flashbots/add-makefile
Browse files Browse the repository at this point in the history
Add makefile for rollup boost
  • Loading branch information
avalonche authored Feb 20, 2025
2 parents 4794c88 + fdb176c commit 686d12f
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions Makefile
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

0 comments on commit 686d12f

Please sign in to comment.