-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7c8aea
commit df6f908
Showing
1 changed file
with
23 additions
and
25 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 |
---|---|---|
@@ -1,38 +1,36 @@ | ||
# Makefile for ssz project | ||
|
||
# Go parameters | ||
GOCMD=go | ||
GOBUILD=$(GOCMD) build | ||
GOCLEAN=$(GOCMD) clean | ||
GOTEST=$(GOCMD) test | ||
GOGET=$(GOCMD) get | ||
GOMOD=$(GOCMD) mod | ||
BINARY_NAME=ssz | ||
|
||
# Git parameters | ||
GITCMD=git | ||
|
||
# Build targets | ||
all: test build | ||
|
||
test: | ||
@if [ -z "$(shell ls -A tests/testdata/consensus-spec-tests)" ]; then \ | ||
echo "Consensus spec tests directory is empty. Running setup..."; \ | ||
$(MAKE) setup; \ | ||
fi | ||
$(GOTEST) -v ./... | ||
default: all | ||
|
||
all: setup build test | ||
|
||
build: check_consensus_tests | ||
@echo "Building project..." | ||
@go build -v ./... | ||
|
||
test: check_consensus_tests | ||
@echo "Running tests..." | ||
@go test ./... | ||
|
||
tidy: | ||
$(GOMOD) tidy | ||
@echo "Tidying go modules..." | ||
@go mod tidy | ||
|
||
generate: | ||
$(GOCMD) generate ./... | ||
@echo "Generating code..." | ||
@go generate ./... | ||
|
||
setup: | ||
@mkdir -p coverage | ||
@echo "Downloading consensus tests... This may take a while due to the large repository size." | ||
@$(GITCMD) submodule update --init --recursive --depth=1 | ||
@git submodule update --init --recursive --depth=1 | ||
@echo "Consensus tests download completed." | ||
|
||
check_consensus_tests: | ||
@if [ -z "$(shell ls -A tests/testdata/consensus-spec-tests)" ]; then \ | ||
echo "Consensus spec tests directory is empty. Running setup..."; \ | ||
$(MAKE) setup; \ | ||
fi | ||
|
||
# Phony targets | ||
.PHONY: all build test clean run deps tidy generate coverage submodules | ||
.PHONY: all build test tidy generate setup check_consensus_tests |