11.DEFAULT_GOAL := help
22
3- VERSION := $(shell git describe --tags --always --dirty 2>/dev/null | sed 's/^v//')
4- COMMIT := $(shell git log -1 --format='% H' 2>/dev/null || echo "unknown")
3+ VERSION := $(shell git describe --tags --always --dirty 2>/dev/null | sed 's/^v//')
4+ COMMIT := $(shell git log -1 --format='% H' 2>/dev/null || echo "unknown")
55TENDERMINT_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's/.* //')
66
77comma := ,
@@ -25,65 +25,60 @@ LD_FLAGS := $(ld_flags) -X github.com/cosmos/cosmos-sdk/version.BuildTags=$(BU
2525
2626build_flags = -ldflags="$(LD_FLAGS ) " -mod=readonly -tags="$(BUILD_TAGS ) " -trimpath
2727
28- IMAGE ?= sentinelhub:latest
28+ GOBIN ?= $(shell go env GOBIN)
29+ ifeq ($(GOBIN ) ,)
30+ GOBIN := $(shell go env GOPATH) /bin
31+ endif
32+
33+ IMAGE ?= sentinel-official/sentinelhub:latest
2934
3035.PHONY : help
31- help :
32- @echo " Available targets:"
33- @echo " build Build the binary (./bin/sentinelhub)"
34- @echo " install Install sentinelhub into \$ $( GOBIN) "
35- @echo " clean Remove build artifacts"
36- @echo " test Run tests"
37- @echo " test-coverage Run tests with coverage and generate report"
38- @echo " benchmark Run benchmarks"
39- @echo " go-lint Run golangci-lint with auto-fix"
40- @echo " proto-gen Generate protobuf code"
41- @echo " proto-lint Lint protobuf definitions"
42- @echo " build-image Build Docker image"
43- @echo " tools Install development tools"
36+ help : # # Show available targets
37+ @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | \
38+ awk ' BEGIN {FS = ":.*?## "}; {printf "%-20s %s\n", $$1, $$2}'
4439
4540.PHONY : build
46- build :
41+ build : # # Build the binary (./bin/sentinelhub)
4742 go build $(build_flags ) -o ./bin/sentinelhub ./cmd/sentinelhub
4843
4944.PHONY : install
50- install :
51- go build $(build_flags ) -o $$( go env GOBIN ) /sentinelhub ./cmd/sentinelhub
45+ install : # # Install the binary into $GOBIN
46+ go build $(build_flags ) -o " $( GOBIN) /sentinelhub" ./cmd/sentinelhub
5247
5348.PHONY : clean
54- clean :
55- $(RM ) -r ./bin ./vendor
49+ clean : # # Remove build artifacts
50+ $(RM ) -r ./bin ./vendor ./coverage.txt
5651
5752.PHONY : test
58- test :
53+ test : # # Run tests
5954 go test -cover -mod=readonly -v ./...
6055
6156.PHONY : test-coverage
62- test-coverage :
63- go test -covermode=atomic -coverprofile=coverage.txt -mod=readonly -timeout 15m -v ./...
57+ test-coverage : # # Run tests with coverage and generate report
58+ go test -covermode=atomic -coverprofile=coverage.txt -mod=readonly -timeout 5m -v ./...
6459
6560.PHONY : benchmark
66- benchmark :
61+ benchmark : # # Run benchmarks
6762 go test -bench -mod=readonly -v ./...
6863
6964.PHONY : go-lint
70- go-lint :
65+ go-lint : # # Run golangci-lint with auto-fix
7166 golangci-lint run --fix
7267
7368.PHONY : proto-gen
74- proto-gen :
69+ proto-gen : # # Generate protobuf code
7570 @scripts/proto-gen.sh
7671
7772.PHONY : proto-lint
78- proto-lint :
73+ proto-lint : # # Lint protobuf definitions
7974 @find proto -name * .proto -exec buf format -w {} \;
8075
8176.PHONY : build-image
82- build-image :
77+ build-image : # # Build Docker image
8378 docker build --compress --file Dockerfile --force-rm --tag $(IMAGE ) .
8479
8580.PHONY : tools
86- tools :
81+ tools : # # Install development tools
8782 go install github.com/bufbuild/buf/cmd/
[email protected] 8883 go install github.com/cosmos/gogoproto/
[email protected] 8984 go install github.com/golangci/golangci-lint/v2/cmd/
[email protected]
0 commit comments