Skip to content

Commit

Permalink
bet
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdevbear committed Aug 7, 2024
1 parent c7c8aea commit df6f908
Showing 1 changed file with 23 additions and 25 deletions.
48 changes: 23 additions & 25 deletions Makefile
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

0 comments on commit df6f908

Please sign in to comment.