Make the binary the default Make target
All checks were successful
check / check (push) Successful in 4s
All checks were successful
check / check (push) Successful in 4s
Plain make now builds sfdupes (previously the default was all = check + build); make build remains as an alias, so the Dockerfile and existing habits keep working. The sfdupes target is phony: go build's own cache decides what to recompile.
This commit is contained in:
10
Makefile
10
Makefile
@@ -6,13 +6,15 @@ BINARY := sfdupes
|
||||
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
|
||||
LDFLAGS := -X main.Version=$(VERSION)
|
||||
|
||||
.PHONY: all build test lint fmt fmt-check check docker hooks clean
|
||||
.PHONY: sfdupes build test lint fmt fmt-check check docker hooks clean
|
||||
|
||||
all: check build
|
||||
|
||||
build:
|
||||
# Default target: build the binary. Phony so go build (which has its
|
||||
# own build cache) always decides what to recompile.
|
||||
sfdupes:
|
||||
go build -ldflags "$(LDFLAGS)" -o $(BINARY)
|
||||
|
||||
build: sfdupes
|
||||
|
||||
test:
|
||||
@go test -timeout 30s -cover ./... || \
|
||||
{ echo "--- Rerunning with -v for details ---"; \
|
||||
|
||||
Reference in New Issue
Block a user