Merge pull request #1099 from runcom/makefile-fixes-v1
[release-1.0] Makefile: output binaries under bin/
This commit is contained in:
commit
d54ad94656
6 changed files with 33 additions and 32 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,17 +1,13 @@
|
||||||
/.artifacts/
|
/.artifacts/
|
||||||
/_output/
|
/_output/
|
||||||
/conmon/conmon
|
|
||||||
/conmon/conmon.o
|
/conmon/conmon.o
|
||||||
/docs/*.[158]
|
/docs/*.[158]
|
||||||
/docs/*.[158].gz
|
/docs/*.[158].gz
|
||||||
/kpod
|
|
||||||
/crioctl
|
|
||||||
/crio
|
|
||||||
/crio.conf
|
/crio.conf
|
||||||
*.o
|
*.o
|
||||||
*.orig
|
*.orig
|
||||||
/pause/pause
|
|
||||||
/pause/pause.o
|
/pause/pause.o
|
||||||
|
/bin/
|
||||||
/test/bin2img/bin2img
|
/test/bin2img/bin2img
|
||||||
/test/checkseccomp/checkseccomp
|
/test/checkseccomp/checkseccomp
|
||||||
/test/copyimg/copyimg
|
/test/copyimg/copyimg
|
||||||
|
|
32
Makefile
32
Makefile
|
@ -36,7 +36,10 @@ GOPKGBASEDIR := $(shell dirname "$(GOPKGDIR)")
|
||||||
# Update VPATH so make finds .gopathok
|
# Update VPATH so make finds .gopathok
|
||||||
VPATH := $(VPATH):$(GOPATH)
|
VPATH := $(VPATH):$(GOPATH)
|
||||||
SHRINKFLAGS := -s -w
|
SHRINKFLAGS := -s -w
|
||||||
LDFLAGS := -ldflags '${SHRINKFLAGS} -X main.gitCommit=${GIT_COMMIT} -X main.buildInfo=${BUILD_INFO} -X main.kpodVersion=${KPOD_VERSION}'
|
BASE_LDFLAGS := ${SHRINKFLAGS} -X main.gitCommit=${GIT_COMMIT} -X main.buildInfo=${BUILD_INFO}
|
||||||
|
KPOD_LDFLAGS := -X main.kpodVersion=${KPOD_VERSION}
|
||||||
|
LDFLAGS := -ldflags '${BASE_LDFLAGS}'
|
||||||
|
LDFLAGS_KPOD := -ldflags '${BASE_LDFLAGS} ${KPOD_LDFLAGS}'
|
||||||
|
|
||||||
all: binaries crio.conf docs
|
all: binaries crio.conf docs
|
||||||
|
|
||||||
|
@ -46,7 +49,7 @@ help:
|
||||||
@echo "Usage: make <target>"
|
@echo "Usage: make <target>"
|
||||||
@echo
|
@echo
|
||||||
@echo " * 'install' - Install binaries to system locations"
|
@echo " * 'install' - Install binaries to system locations"
|
||||||
@echo " * 'binaries' - Build crio, conmon and crioctl"
|
@echo " * 'binaries' - Build crio, conmon, pause, crioctl and kpod"
|
||||||
@echo " * 'integration' - Execute integration tests"
|
@echo " * 'integration' - Execute integration tests"
|
||||||
@echo " * 'clean' - Clean artifacts"
|
@echo " * 'clean' - Clean artifacts"
|
||||||
@echo " * 'lint' - Execute the source code linter"
|
@echo " * 'lint' - Execute the source code linter"
|
||||||
|
@ -82,16 +85,16 @@ test/checkseccomp/checkseccomp: .gopathok $(wildcard test/checkseccomp/*.go)
|
||||||
$(GO) build $(LDFLAGS) -tags "$(BUILDTAGS) containers_image_ostree_stub" -o $@ $(PROJECT)/test/checkseccomp
|
$(GO) build $(LDFLAGS) -tags "$(BUILDTAGS) containers_image_ostree_stub" -o $@ $(PROJECT)/test/checkseccomp
|
||||||
|
|
||||||
crio: .gopathok $(shell hack/find-godeps.sh $(GOPKGDIR) cmd/crio $(PROJECT))
|
crio: .gopathok $(shell hack/find-godeps.sh $(GOPKGDIR) cmd/crio $(PROJECT))
|
||||||
$(GO) build $(LDFLAGS) -tags "$(BUILDTAGS) containers_image_ostree_stub" -o $@ $(PROJECT)/cmd/crio
|
$(GO) build $(LDFLAGS) -tags "$(BUILDTAGS) containers_image_ostree_stub" -o bin/$@ $(PROJECT)/cmd/crio
|
||||||
|
|
||||||
crioctl: .gopathok $(shell hack/find-godeps.sh $(GOPKGDIR) cmd/crioctl $(PROJECT))
|
crioctl: .gopathok $(shell hack/find-godeps.sh $(GOPKGDIR) cmd/crioctl $(PROJECT))
|
||||||
$(GO) build $(LDFLAGS) -tags "$(BUILDTAGS) containers_image_ostree_stub" -o $@ $(PROJECT)/cmd/crioctl
|
$(GO) build $(LDFLAGS) -tags "$(BUILDTAGS) containers_image_ostree_stub" -o bin/$@ $(PROJECT)/cmd/crioctl
|
||||||
|
|
||||||
kpod: .gopathok $(shell hack/find-godeps.sh $(GOPKGDIR) cmd/kpod $(PROJECT))
|
kpod: .gopathok $(shell hack/find-godeps.sh $(GOPKGDIR) cmd/kpod $(PROJECT))
|
||||||
$(GO) build $(LDFLAGS) -tags "$(BUILDTAGS)" -o $@ $(PROJECT)/cmd/kpod
|
$(GO) build $(LDFLAGS_KPOD) -tags "$(BUILDTAGS)" -o bin/$@ $(PROJECT)/cmd/kpod
|
||||||
|
|
||||||
crio.conf: crio
|
crio.conf: crio
|
||||||
./crio --config="" config --default > crio.conf
|
./bin/crio --config="" config --default > crio.conf
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
ifneq ($(GOPATH),)
|
ifneq ($(GOPATH),)
|
||||||
|
@ -102,7 +105,7 @@ endif
|
||||||
rm -fr test/testdata/redis-image
|
rm -fr test/testdata/redis-image
|
||||||
find . -name \*~ -delete
|
find . -name \*~ -delete
|
||||||
find . -name \#\* -delete
|
find . -name \#\* -delete
|
||||||
rm -f crioctl crio kpod
|
rm -f bin/crioctl bin/crio bin/kpod
|
||||||
make -C conmon clean
|
make -C conmon clean
|
||||||
make -C pause clean
|
make -C pause clean
|
||||||
rm -f test/bin2img/bin2img
|
rm -f test/bin2img/bin2img
|
||||||
|
@ -121,10 +124,11 @@ integration: crioimage
|
||||||
testunit:
|
testunit:
|
||||||
$(GO) test -tags "$(BUILDTAGS)" -cover $(PACKAGES)
|
$(GO) test -tags "$(BUILDTAGS)" -cover $(PACKAGES)
|
||||||
|
|
||||||
localintegration: clean binaries
|
localintegration: clean binaries test-binaries
|
||||||
./test/test_runner.sh ${TESTFLAGS}
|
./test/test_runner.sh ${TESTFLAGS}
|
||||||
|
|
||||||
binaries: crio crioctl kpod conmon pause test/bin2img/bin2img test/copyimg/copyimg test/checkseccomp/checkseccomp
|
binaries: crio conmon pause kpod crioctl
|
||||||
|
test-binaries: test/bin2img/bin2img test/copyimg/copyimg test/checkseccomp/checkseccomp
|
||||||
|
|
||||||
MANPAGES_MD := $(wildcard docs/*.md)
|
MANPAGES_MD := $(wildcard docs/*.md)
|
||||||
MANPAGES := $(MANPAGES_MD:%.md=%)
|
MANPAGES := $(MANPAGES_MD:%.md=%)
|
||||||
|
@ -143,11 +147,11 @@ docs: $(MANPAGES)
|
||||||
install: .gopathok install.bin install.man
|
install: .gopathok install.bin install.man
|
||||||
|
|
||||||
install.bin:
|
install.bin:
|
||||||
install ${SELINUXOPT} -D -m 755 crio $(BINDIR)/crio
|
install ${SELINUXOPT} -D -m 755 bin/crio $(BINDIR)/crio
|
||||||
install ${SELINUXOPT} -D -m 755 crioctl $(BINDIR)/crioctl
|
install ${SELINUXOPT} -D -m 755 bin/crioctl $(BINDIR)/crioctl
|
||||||
install ${SELINUXOPT} -D -m 755 kpod $(BINDIR)/kpod
|
install ${SELINUXOPT} -D -m 755 bin/kpod $(BINDIR)/kpod
|
||||||
install ${SELINUXOPT} -D -m 755 conmon/conmon $(LIBEXECDIR)/crio/conmon
|
install ${SELINUXOPT} -D -m 755 bin/conmon $(LIBEXECDIR)/crio/conmon
|
||||||
install ${SELINUXOPT} -D -m 755 pause/pause $(LIBEXECDIR)/crio/pause
|
install ${SELINUXOPT} -D -m 755 bin/pause $(LIBEXECDIR)/crio/pause
|
||||||
|
|
||||||
install.man:
|
install.man:
|
||||||
install ${SELINUXOPT} -d -m 755 $(MANDIR)/man1
|
install ${SELINUXOPT} -d -m 755 $(MANDIR)/man1
|
||||||
|
|
|
@ -5,8 +5,8 @@ override LIBS += $(shell pkg-config --libs glib-2.0)
|
||||||
override CFLAGS += -std=c99 -Os -Wall -Wextra $(shell pkg-config --cflags glib-2.0)
|
override CFLAGS += -std=c99 -Os -Wall -Wextra $(shell pkg-config --cflags glib-2.0)
|
||||||
|
|
||||||
conmon: $(obj)
|
conmon: $(obj)
|
||||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
$(CC) -o ../bin/$@ $^ $(CFLAGS) $(LIBS)
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -f $(obj) conmon
|
rm -f $(obj) ../bin/conmon
|
||||||
|
|
|
@ -5,9 +5,9 @@ override LIBS +=
|
||||||
override CFLAGS += -std=c99 -Os -Wall -Wextra -static
|
override CFLAGS += -std=c99 -Os -Wall -Wextra -static
|
||||||
|
|
||||||
pause: $(obj)
|
pause: $(obj)
|
||||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
$(CC) -o ../bin/$@ $^ $(CFLAGS) $(LIBS)
|
||||||
strip $@
|
strip ../bin/$@
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -f $(obj) pause
|
rm -f $(obj) ../bin/pause
|
||||||
|
|
|
@ -10,16 +10,16 @@ TESTDATA="${INTEGRATION_ROOT}/testdata"
|
||||||
CRIO_ROOT=${CRIO_ROOT:-$(cd "$INTEGRATION_ROOT/../.."; pwd -P)}
|
CRIO_ROOT=${CRIO_ROOT:-$(cd "$INTEGRATION_ROOT/../.."; pwd -P)}
|
||||||
|
|
||||||
# Path of the crio binary.
|
# Path of the crio binary.
|
||||||
CRIO_BINARY=${CRIO_BINARY:-${CRIO_ROOT}/cri-o/crio}
|
CRIO_BINARY=${CRIO_BINARY:-${CRIO_ROOT}/cri-o/bin/crio}
|
||||||
# Path of the crictl binary.
|
# Path of the crictl binary.
|
||||||
CRICTL_PATH=$(command -v crictl || true)
|
CRICTL_PATH=$(command -v crictl || true)
|
||||||
CRICTL_BINARY=${CRICTL_PATH:-/usr/bin/crictl}
|
CRICTL_BINARY=${CRICTL_PATH:-/usr/bin/crictl}
|
||||||
# Path to kpod binary.
|
# Path to kpod binary.
|
||||||
KPOD_BINARY=${KPOD_BINARY:-${CRIO_ROOT}/cri-o/kpod}
|
KPOD_BINARY=${KPOD_BINARY:-${CRIO_ROOT}/cri-o/bin/kpod}
|
||||||
# Path of the conmon binary.
|
# Path of the conmon binary.
|
||||||
CONMON_BINARY=${CONMON_BINARY:-${CRIO_ROOT}/cri-o/conmon/conmon}
|
CONMON_BINARY=${CONMON_BINARY:-${CRIO_ROOT}/cri-o/bin/conmon}
|
||||||
# Path of the pause binary.
|
# Path of the pause binary.
|
||||||
PAUSE_BINARY=${PAUSE_BINARY:-${CRIO_ROOT}/cri-o/pause/pause}
|
PAUSE_BINARY=${PAUSE_BINARY:-${CRIO_ROOT}/cri-o/bin/pause}
|
||||||
# Path of the default seccomp profile.
|
# Path of the default seccomp profile.
|
||||||
SECCOMP_PROFILE=${SECCOMP_PROFILE:-${CRIO_ROOT}/cri-o/seccomp.json}
|
SECCOMP_PROFILE=${SECCOMP_PROFILE:-${CRIO_ROOT}/cri-o/seccomp.json}
|
||||||
# Name of the default apparmor profile.
|
# Name of the default apparmor profile.
|
||||||
|
@ -174,7 +174,7 @@ function crio() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# DEPRECATED
|
# DEPRECATED
|
||||||
OCIC_BINARY=${OCIC_BINARY:-${CRIO_ROOT}/cri-o/crioctl}
|
OCIC_BINARY=${OCIC_BINARY:-${CRIO_ROOT}/cri-o/bin/crioctl}
|
||||||
# Run crioctl using the binary specified by $OCIC_BINARY.
|
# Run crioctl using the binary specified by $OCIC_BINARY.
|
||||||
function crioctl() {
|
function crioctl() {
|
||||||
"$OCIC_BINARY" --connect "$CRIO_SOCKET" "$@"
|
"$OCIC_BINARY" --connect "$CRIO_SOCKET" "$@"
|
||||||
|
@ -244,7 +244,7 @@ function start_crio() {
|
||||||
"$COPYIMG_BINARY" --root "$TESTDIR/crio" $STORAGE_OPTS --runroot "$TESTDIR/crio-run" --image-name=mrunalp/image-volume-test --import-from=dir:"$ARTIFACTS_PATH"/image-volume-test-image --add-name=docker.io/library/mrunalp/image-volume-test --signature-policy="$INTEGRATION_ROOT"/policy.json
|
"$COPYIMG_BINARY" --root "$TESTDIR/crio" $STORAGE_OPTS --runroot "$TESTDIR/crio-run" --image-name=mrunalp/image-volume-test --import-from=dir:"$ARTIFACTS_PATH"/image-volume-test-image --add-name=docker.io/library/mrunalp/image-volume-test --signature-policy="$INTEGRATION_ROOT"/policy.json
|
||||||
"$COPYIMG_BINARY" --root "$TESTDIR/crio" $STORAGE_OPTS --runroot "$TESTDIR/crio-run" --image-name=busybox:latest --import-from=dir:"$ARTIFACTS_PATH"/busybox-image --add-name=docker.io/library/busybox:latest --signature-policy="$INTEGRATION_ROOT"/policy.json
|
"$COPYIMG_BINARY" --root "$TESTDIR/crio" $STORAGE_OPTS --runroot "$TESTDIR/crio-run" --image-name=busybox:latest --import-from=dir:"$ARTIFACTS_PATH"/busybox-image --add-name=docker.io/library/busybox:latest --signature-policy="$INTEGRATION_ROOT"/policy.json
|
||||||
"$COPYIMG_BINARY" --root "$TESTDIR/crio" $STORAGE_OPTS --runroot "$TESTDIR/crio-run" --image-name=runcom/stderr-test:latest --import-from=dir:"$ARTIFACTS_PATH"/stderr-test --add-name=docker.io/runcom/stderr-test:latest --signature-policy="$INTEGRATION_ROOT"/policy.json
|
"$COPYIMG_BINARY" --root "$TESTDIR/crio" $STORAGE_OPTS --runroot "$TESTDIR/crio-run" --image-name=runcom/stderr-test:latest --import-from=dir:"$ARTIFACTS_PATH"/stderr-test --add-name=docker.io/runcom/stderr-test:latest --signature-policy="$INTEGRATION_ROOT"/policy.json
|
||||||
"$CRIO_BINARY" ${DEFAULT_MOUNTS_OPTS} ${HOOKS_OPTS} --conmon "$CONMON_BINARY" --listen "$CRIO_SOCKET" --cgroup-manager "$CGROUP_MANAGER" --registry "docker.io" --runtime "$RUNTIME_BINARY" --root "$TESTDIR/crio" --runroot "$TESTDIR/crio-run" $STORAGE_OPTS --seccomp-profile "$seccomp" --apparmor-profile "$apparmor" --cni-config-dir "$CRIO_CNI_CONFIG" --signature-policy "$INTEGRATION_ROOT"/policy.json --image-volumes "$IMAGE_VOLUMES" --pids-limit "$PIDS_LIMIT" --log-size-max "$LOG_SIZE_MAX_LIMIT" --config /dev/null config >$CRIO_CONFIG
|
"$CRIO_BINARY" ${DEFAULT_MOUNTS_OPTS} ${HOOKS_OPTS} --conmon "$CONMON_BINARY" --listen "$CRIO_SOCKET" --cgroup-manager "$CGROUP_MANAGER" --registry "docker.io" --runtime "$RUNTIME_BINARY" --root "$TESTDIR/crio" --runroot "$TESTDIR/crio-run" $STORAGE_OPTS --seccomp-profile "$seccomp" --apparmor-profile "$apparmor" --cni-config-dir "$CRIO_CNI_CONFIG" --cni-plugin-dir "$CRIO_CNI_PLUGIN" --signature-policy "$INTEGRATION_ROOT"/policy.json --image-volumes "$IMAGE_VOLUMES" --pids-limit "$PIDS_LIMIT" --log-size-max "$LOG_SIZE_MAX_LIMIT" --config /dev/null config >$CRIO_CONFIG
|
||||||
|
|
||||||
# Prepare the CNI configuration files, we're running with non host networking by default
|
# Prepare the CNI configuration files, we're running with non host networking by default
|
||||||
if [[ -n "$4" ]]; then
|
if [[ -n "$4" ]]; then
|
||||||
|
|
|
@ -7,6 +7,7 @@ function teardown() {
|
||||||
cleanup_pods
|
cleanup_pods
|
||||||
stop_crio
|
stop_crio
|
||||||
rm -f /var/lib/cni/networks/crionet_test_args/*
|
rm -f /var/lib/cni/networks/crionet_test_args/*
|
||||||
|
chmod 0755 $CONMON_BINARY
|
||||||
cleanup_test
|
cleanup_test
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,11 +172,11 @@ function teardown() {
|
||||||
|
|
||||||
# make conmon non-executable to cause the sandbox setup to fail after
|
# make conmon non-executable to cause the sandbox setup to fail after
|
||||||
# networking has been configured
|
# networking has been configured
|
||||||
chmod 0644 /go/src/github.com/kubernetes-incubator/cri-o/conmon/conmon
|
chmod 0644 $CONMON_BINARY
|
||||||
run crioctl pod run --config "$TESTDATA"/sandbox_config.json
|
run crioctl pod run --config "$TESTDATA"/sandbox_config.json
|
||||||
|
chmod 0755 $CONMON_BINARY
|
||||||
echo "$output"
|
echo "$output"
|
||||||
[ "$status" -ne 0 ]
|
[ "$status" -ne 0 ]
|
||||||
chmod 0755 /go/src/github.com/kubernetes-incubator/cri-o/conmon/conmon
|
|
||||||
|
|
||||||
# ensure that the server cleaned up sandbox networking if the sandbox
|
# ensure that the server cleaned up sandbox networking if the sandbox
|
||||||
# failed after network setup
|
# failed after network setup
|
||||||
|
|
Loading…
Reference in a new issue