Add build tags and Improve the test case of selinux
- Add build tags - Fixes a bug because of my negligence - Improve the test case of selinux Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn> test
This commit is contained in:
10
Makefile
10
Makefile
@@ -24,7 +24,10 @@ VERSION := $(shell git describe --tags --dirty)
|
||||
# strip the first char of the tag if it's a `v`
|
||||
VERSION := $(VERSION:v%=%)
|
||||
TARBALL ?= cri-containerd-$(VERSION).tar.gz
|
||||
BUILD_TAGS:= -ldflags '-X $(PROJECT)/pkg/version.criContainerdVersion=$(VERSION)'
|
||||
ifdef BUILD_TAGS
|
||||
BUILD_TAGS := -tags $(BUILD_TAGS)
|
||||
endif
|
||||
GO_LDFLAGS := -ldflags '-X $(PROJECT)/pkg/version.criContainerdVersion=$(VERSION)'
|
||||
SOURCES := $(shell find . -name '*.go')
|
||||
|
||||
all: binaries
|
||||
@@ -68,8 +71,7 @@ boiler:
|
||||
|
||||
$(BUILD_DIR)/cri-containerd: $(SOURCES)
|
||||
$(GO) build -o $@ \
|
||||
$(BUILD_TAGS) \
|
||||
$(GO_LDFLAGS) $(GO_GCFLAGS) \
|
||||
$(BUILD_TAGS) $(GO_LDFLAGS) $(GO_GCFLAGS) \
|
||||
$(PROJECT)/cmd/cri-containerd
|
||||
|
||||
test:
|
||||
@@ -86,7 +88,7 @@ clean:
|
||||
|
||||
binaries: $(BUILD_DIR)/cri-containerd
|
||||
|
||||
static-binaries: GO_LDFLAGS=--ldflags '-extldflags "-fno-PIC -static"'
|
||||
static-binaries: GO_LDFLAGS += --ldflags '-extldflags "-fno-PIC -static"'
|
||||
static-binaries: $(BUILD_DIR)/cri-containerd
|
||||
|
||||
install: binaries
|
||||
|
||||
Reference in New Issue
Block a user