commit
37f1747aec
|
@ -2,3 +2,4 @@ vendor/pkg
|
||||||
/runc
|
/runc
|
||||||
Godeps/_workspace/src/github.com/opencontainers/runc
|
Godeps/_workspace/src/github.com/opencontainers/runc
|
||||||
man/man8
|
man/man8
|
||||||
|
release
|
||||||
|
|
31
Makefile
31
Makefile
|
@ -22,14 +22,44 @@ MAN_PAGES = $(shell ls $(MAN_DIR)/*.8)
|
||||||
MAN_PAGES_BASE = $(notdir $(MAN_PAGES))
|
MAN_PAGES_BASE = $(notdir $(MAN_PAGES))
|
||||||
MAN_INSTALL_PATH := ${PREFIX}/share/man/man8/
|
MAN_INSTALL_PATH := ${PREFIX}/share/man/man8/
|
||||||
|
|
||||||
|
RELEASE_DIR := $(CURDIR)/release
|
||||||
|
|
||||||
VERSION := ${shell cat ./VERSION}
|
VERSION := ${shell cat ./VERSION}
|
||||||
|
|
||||||
|
SHELL ?= $(shell command -v bash 2>/dev/null)
|
||||||
|
|
||||||
all: $(RUNC_LINK)
|
all: $(RUNC_LINK)
|
||||||
go build -i -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION}" -tags "$(BUILDTAGS)" -o runc .
|
go build -i -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION}" -tags "$(BUILDTAGS)" -o runc .
|
||||||
|
|
||||||
static: $(RUNC_LINK)
|
static: $(RUNC_LINK)
|
||||||
CGO_ENABLED=1 go build -i -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION}" -o runc .
|
CGO_ENABLED=1 go build -i -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION}" -o runc .
|
||||||
|
|
||||||
|
release: $(RUNC_LINK)
|
||||||
|
@flag_list=(seccomp selinux apparmor static); \
|
||||||
|
unset expression; \
|
||||||
|
for flag in "$${flag_list[@]}"; do \
|
||||||
|
expression+="' '{'',$${flag}}"; \
|
||||||
|
done; \
|
||||||
|
eval profile_list=("$$expression"); \
|
||||||
|
for profile in "$${profile_list[@]}"; do \
|
||||||
|
output=${RELEASE_DIR}/runc; \
|
||||||
|
for flag in $$profile; do \
|
||||||
|
output+=."$$flag"; \
|
||||||
|
done; \
|
||||||
|
tags="$$profile"; \
|
||||||
|
ldflags="-X main.gitCommit=${COMMIT} -X main.version=${VERSION}"; \
|
||||||
|
CGO_ENABLED=; \
|
||||||
|
[[ "$$profile" =~ static ]] && { \
|
||||||
|
tags="$${tags/static/static_build}"; \
|
||||||
|
tags+=" cgo"; \
|
||||||
|
ldflags+=" -w -extldflags -static"; \
|
||||||
|
CGO_ENABLED=1; \
|
||||||
|
}; \
|
||||||
|
echo "Building target: $$output"; \
|
||||||
|
rm -rf "${GOPATH}/pkg"; \
|
||||||
|
go build -i -ldflags "$$ldflags" -tags "$$tags" -o "$$output" .; \
|
||||||
|
done
|
||||||
|
|
||||||
$(RUNC_LINK):
|
$(RUNC_LINK):
|
||||||
ln -sfn $(CURDIR) $(RUNC_LINK)
|
ln -sfn $(CURDIR) $(RUNC_LINK)
|
||||||
|
|
||||||
|
@ -89,6 +119,7 @@ clean:
|
||||||
rm -f runc
|
rm -f runc
|
||||||
rm -f $(RUNC_LINK)
|
rm -f $(RUNC_LINK)
|
||||||
rm -rf $(GOPATH)/pkg
|
rm -rf $(GOPATH)/pkg
|
||||||
|
rm -rf $(RELEASE_DIR)
|
||||||
|
|
||||||
validate:
|
validate:
|
||||||
script/validate-gofmt
|
script/validate-gofmt
|
||||||
|
|
Loading…
Reference in New Issue