Skip to content

Commit 00a5588

Browse files
committed
Makefile: Conditionally build agent with tag seccomp
Inorder to get runc/libcontainer/seccomp/seccomp_linux.go built in, build agent with seccomp tag. Fixes: kata-containers#104 Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com
1 parent 5765593 commit 00a5588

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ INIT := no
1515
UNIT_DIR := /usr/lib/systemd/system
1616

1717
GENERATED_FILES :=
18+
# Define if agent will be built by seccomp tag
19+
SECCOMP := no
1820

1921
ifeq ($(INIT),no)
2022
# Unit file to start kata agent in systemd systems
@@ -31,6 +33,9 @@ COMMIT_NO_SHORT := $(shell git rev-parse --short HEAD 2> /dev/null || true)
3133
COMMIT := $(if $(shell git status --porcelain --untracked-files=no),${COMMIT_NO}-dirty,${COMMIT_NO})
3234
VERSION_COMMIT := $(if $(COMMIT),$(VERSION)-$(COMMIT),$(VERSION))
3335
ARCH := $(shell go env GOARCH)
36+
ifeq ($(SECCOMP),yes)
37+
BUILDTAGS := seccomp
38+
endif
3439

3540
# args for building agent image
3641
BUILDARGS := $(if $(http_proxy), --build-arg http_proxy=$(http_proxy))
@@ -40,7 +45,7 @@ AGENT_IMAGE := katacontainers/agent-dev
4045
AGENT_TAG := $(if $(COMMIT_NO_SHORT),$(COMMIT_NO_SHORT),dev)
4146

4247
$(TARGET): $(GENERATED_FILES) $(SOURCES) $(VERSION_FILE)
43-
go build -o $@ -ldflags "-X main.version=$(VERSION_COMMIT)"
48+
go build -tags "$(BUILDTAGS)" -o $@ -ldflags "-X main.version=$(VERSION_COMMIT)"
4449

4550
install:
4651
install -D $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET)

0 commit comments

Comments
 (0)