bab3b75c |
# Old-skool build tools.
#
# Targets (see each target for more information):
# all: Build code.
# build: Build code. |
54386f99 |
# check: Run unit tests.
# test: Run all tests.
# run: Run all-in-one server |
bab3b75c |
# clean: Clean up.
|
c547a10c |
OUT_DIR = _output
OUT_PKG_DIR = Godeps/_workspace/pkg |
bab3b75c |
export GOFLAGS |
d0ca07cd |
export TESTFLAGS |
bab3b75c |
# Build code.
#
# Args:
# WHAT: Directory names to build. If any of these directories has a 'main'
# package, the build will produce executable files under $(OUT_DIR)/go/bin.
# If not specified, "everything" will be built.
# GOFLAGS: Extra flags to pass to 'go' when building. |
d0ca07cd |
# TESTFLAGS: Extra flags that should only be passed to hack/test-go.sh |
bab3b75c |
#
# Example:
# make
# make all
# make all WHAT=cmd/kubelet GOFLAGS=-v
all build:
hack/build-go.sh $(WHAT)
.PHONY: all build
|
54386f99 |
# Build and run unit tests |
bab3b75c |
#
# Args:
# WHAT: Directory names to test. All *_test.go files under these
# directories will be run. If not specified, "everything" will be tested.
# TESTS: Same as WHAT.
# GOFLAGS: Extra flags to pass to 'go' when building. |
d0ca07cd |
# TESTFLAGS: Extra flags that should only be passed to hack/test-go.sh |
bab3b75c |
#
# Example:
# make check
# make check WHAT=pkg/build GOFLAGS=-v |
54386f99 |
check: |
7204a0dc |
TEST_KUBE=1 hack/test-go.sh $(WHAT) $(TESTS) $(TESTFLAGS) |
54386f99 |
.PHONY: check
|
6daa7f71 |
# Verify code is properly organized.
#
# Example:
# make verify |
785538b8 |
ifeq ($(SKIP_BUILD), true)
verify:
else |
6daa7f71 |
verify: build |
785538b8 |
endif |
749428c4 |
hack/verify-upstream-commits.sh |
6daa7f71 |
hack/verify-gofmt.sh |
772b5fa0 |
hack/verify-govet.sh |
6daa7f71 |
hack/verify-generated-deep-copies.sh
hack/verify-generated-conversions.sh
hack/verify-generated-completions.sh
hack/verify-generated-docs.sh
hack/verify-generated-swagger-spec.sh
hack/verify-api-descriptions.sh
.PHONY: verify
|
785538b8 |
# check and verify can't run concurently because of strange concurrent build issues.
check-verify:
# delegate to another make process that runs serially against the check and verify targets
$(MAKE) -j1 check verify
.PHONY: check-verify
|
e8c3ea5e |
# Install travis dependencies
#
# Args:
# TEST_ASSETS: Instead of running tests, test assets only.
ifeq ($(TEST_ASSETS), true)
install-travis:
hack/install-assets.sh
else
install-travis:
hack/install-etcd.sh
hack/install-tools.sh
endif
.PHONY: install-travis
|
6daa7f71 |
# Run unit and integration tests that don't require Docker. |
432096e9 |
#
# Args:
# GOFLAGS: Extra flags to pass to 'go' when building. |
d0ca07cd |
# TESTFLAGS: Extra flags that should only be passed to hack/test-go.sh |
e8c3ea5e |
# TEST_ASSETS: Instead of running tests, test assets only. |
432096e9 |
#
# Example:
# make check-test
check-test: export KUBE_COVER= -cover -covermode=atomic
check-test: export KUBE_RACE= -race |
e8c3ea5e |
ifeq ($(TEST_ASSETS), true)
check-test:
hack/test-assets.sh
else |
aa097331 |
check-test:
check-verify |
d0ca07cd |
hack/test-cmd.sh
KUBE_RACE=" " hack/test-integration.sh |
e8c3ea5e |
endif |
432096e9 |
.PHONY: check-test
|
54386f99 |
# Build and run the complete test-suite.
#
# Args:
# GOFLAGS: Extra flags to pass to 'go' when building. |
d0ca07cd |
# TESTFLAGS: Extra flags that should only be passed to hack/test-go.sh |
54386f99 |
#
# Example:
# make test
# make test GOFLAGS=-v
test: export KUBE_COVER= -cover -covermode=atomic
test: export KUBE_RACE= -race |
07dd7dda |
ifeq ($(SKIP_BUILD), true) |
785538b8 |
test: check-verify test-int-plus |
07dd7dda |
else |
785538b8 |
test: build check-verify test-int-plus |
fcabd4de |
endif |
785538b8 |
.PHONY: test
# Split out of `test`. This allows `make -j --output-sync=recurse test` to parallelize as expected
test-int-plus: export KUBE_COVER= -cover -covermode=atomic
test-int-plus: export KUBE_RACE= -race
ifeq ($(SKIP_BUILD), true)
test-int-plus:
else
test-int-plus: build
endif
test-int-plus: |
54386f99 |
hack/test-cmd.sh |
3da7c1aa |
hack/test-tools.sh |
d0ca07cd |
KUBE_RACE=" " hack/test-integration-docker.sh |
6c0b7f88 |
hack/test-end-to-end-docker.sh |
a8873051 |
ifeq ($(EXTENDED),true)
hack/test-extended.sh
endif |
785538b8 |
.PHONY: test-int-plus
|
bab3b75c |
# Run All-in-one OpenShift server.
#
# Example:
# make run |
5f8790a2 |
OS_OUTPUT_BINPATH=$(shell bash -c 'source hack/common.sh; echo $${OS_OUTPUT_BINPATH}')
PLATFORM=$(shell bash -c 'source hack/common.sh; os::build::host_platform') |
bab3b75c |
run: build |
5f8790a2 |
$(OS_OUTPUT_BINPATH)/$(PLATFORM)/openshift start |
bab3b75c |
.PHONY: run
# Remove all build artifacts.
#
# Example:
# make clean
clean: |
c547a10c |
rm -rf $(OUT_DIR) $(OUT_PKG_DIR) |
bab3b75c |
.PHONY: clean
|
366baa89 |
# Build an official release of OpenShift, including the official images.
#
# Example: |
04d566a0 |
# make release |
366baa89 |
release: clean
hack/build-release.sh
hack/build-images.sh |
04d566a0 |
hack/extract-release.sh |
366baa89 |
.PHONY: release |
04d566a0 |
# Build only the release binaries for OpenShift
#
# Example:
# make release-binaries
release-binaries: clean
hack/build-release.sh
hack/extract-release.sh |
5f8790a2 |
.PHONY: release-binaries |