Skip to content

Commit c989158

Browse files
committed
chore(makefile): extract MAIN_PKG to deduplicate cmd path
`./cmd/git-real` が build と deadcode の 2 ターゲットでハードコードされていたため、`MAIN_PKG` 変数として 1 箇所に集約。
1 parent bfd7a06 commit c989158

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
GO ?= go
22
COVERAGE_THRESHOLD ?= 95
33
GOFMT_TARGETS := cmd internal
4+
MAIN_PKG := ./cmd/git-real
45
CACHE_DIR ?= $(CURDIR)/.cache
56

67
export GOCACHE ?= $(CACHE_DIR)/go-build
@@ -22,7 +23,7 @@ LDFLAGS := -s -w \
2223
.PHONY: build fmt fmt-check lint typecheck deadcode test test-race coverage vuln actionlint check
2324

2425
build:
25-
$(GO) build -trimpath -buildvcs=true -ldflags='$(LDFLAGS)' -o git-real ./cmd/git-real
26+
$(GO) build -trimpath -buildvcs=true -ldflags='$(LDFLAGS)' -o git-real $(MAIN_PKG)
2627

2728
fmt:
2829
$(GO) fmt ./...
@@ -46,7 +47,7 @@ typecheck:
4647
$(GO) test -run '^$$' ./...
4748

4849
deadcode:
49-
$(GO) tool deadcode ./cmd/git-real
50+
$(GO) tool deadcode $(MAIN_PKG)
5051

5152
test:
5253
$(GO) test ./...

0 commit comments

Comments
 (0)