Skip to content

Commit f1f837e

Browse files
Ensure dirty revision builds (#1032)
* move test dependency from build target to install * binary target depends on all go files * depend on go.mod and go.sum
1 parent 160f265 commit f1f837e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,22 @@ PROTOS := protos/io/defang/v1/fabric.pb.go protos/io/defang/v1/defangv1connect/f
55

66
BINARY_NAME:=defang
77
GOFLAGS:=-ldflags "-X main.version=$(VERSION)"
8+
GOSRC := $(shell find . -name '*.go')
89

9-
$(BINARY_NAME): test
10+
$(BINARY_NAME): $(PROTOS) $(GOSRC) go.mod go.sum
1011
go build -o $@ $(GOFLAGS) ./cmd/cli
1112

13+
.PHONY: build
14+
build: $(BINARY_NAME)
15+
1216
.PHONY: protos
1317
protos: $(PROTOS)
1418
$(PROTOS) &: protos/io/defang/v1/fabric.proto buf.gen.yaml
1519
cd protos && buf lint
1620
buf generate protos
1721

1822
.PHONY: install
19-
install: $(BINARY_NAME)
23+
install: $(BINARY_NAME) test
2024
install $(BINARY_NAME) "${HOME}/.local/bin/"
2125

2226
.PHONY: test

0 commit comments

Comments
 (0)