Skip to content

Commit 3155aae

Browse files
authored
Merge pull request firecracker-microvm#474 from kzys/makefile-internal
Rebuild binaries when dependencies change
2 parents 0115996 + 10e4f9d commit 3155aae

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

agent/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ EXTRAGOARGS?=
1515

1616
GOMOD := $(shell go env GOMOD)
1717
GOSUM := $(GOMOD:.mod=.sum)
18-
SOURCES:=$(shell find . -name '*.go')
18+
SOURCES := $(shell find ../eventbridge ../internal ../proto . -name '*.go')
1919
DOCKER_IMAGE_TAG?=latest
2020
REVISION := $(shell git rev-parse HEAD)
2121

2222
all: agent
2323

24-
agent: *.go $(GOMOD) $(GOSUM)
24+
agent: $(SOURCES) $(GOMOD) $(GOSUM)
2525
ifneq ($(STATIC_AGENT),)
2626
CGO_ENABLED=0 go build -installsuffix cgo -a -ldflags "-s -X main.revision=$(REVISION)" $(EXTRAGOARGS) -o agent
2727
else

firecracker-control/cmd/containerd/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Set this to pass additional commandline flags to the go compiler, e.g. "make test EXTRAGOARGS=-v"
1515
EXTRAGOARGS:=
1616

17-
SRC := $(shell find . -name '*.go')
17+
SOURCES := $(shell find ../../../config ../../../internal ../../../proto ../../ -name '*.go')
1818
GOMOD := $(shell go env GOMOD)
1919
GOSUM := $(GOMOD:.mod=.sum)
2020
REVISION=$(shell git rev-parse HEAD)
@@ -24,7 +24,7 @@ all: build
2424

2525
build: firecracker-containerd firecracker-ctr
2626

27-
firecracker-containerd: $(SRC) $(GOMOD) $(GOSUM)
27+
firecracker-containerd: $(SOURCES) $(GOMOD) $(GOSUM)
2828
go build $(EXTRAGOARGS) \
2929
-ldflags $(VERSION_LDFLAGS) -o firecracker-containerd
3030

runtime/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
EXTRAGOARGS?=
1616
NUMBER_OF_VMS?=
1717

18-
SOURCES:=$(shell find . -name '*.go')
18+
SOURCES := $(shell find ../config ../eventbridge ../firecracker-control ../internal ../proto . -name '*.go')
1919
GOMOD := $(shell go env GOMOD)
2020
GOSUM := $(GOMOD:.mod=.sum)
2121
DOCKER_IMAGE_TAG?=latest

0 commit comments

Comments
 (0)