Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Makefile to replace build.sh and test.sh. #43

Merged
merged 3 commits into from
May 5, 2016

Conversation

dlorenc
Copy link
Contributor

@dlorenc dlorenc commented May 4, 2016

This creates some make actions to build and test:

make minikube
make localkube
make minikube-linux-amd64, etc.
make localkube-linux-amd64, etc.

make test
make integration

@dlorenc
Copy link
Contributor Author

dlorenc commented May 4, 2016

cc @ethernetdan Could you take a look here when you get a chance?

@dlorenc
Copy link
Contributor Author

dlorenc commented May 4, 2016

cc @luxas
ref #43

BUILD_DIR ?= ./out
GOPATH := $(shell pwd)/.gopath
REPOPATH ?= k8s.io/minikube

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GO15VENDOREXPERIMENT=1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I've been using Go 1.6 for everything so I forget to set that.


.PHONY: localkube-$(GOOS)-$(GOARCH)
localkube-$(GOOS)-$(GOARCH): gopath
GOARCH=$(GOARCH) GOOS=$(GOOS) $(GO) build -o $(BUILD_DIR)/localkube-$(GOOS)-$(GOARCH) -i --ldflags '-extldflags "-static" --s -w' ./cmd/localkube
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think localkube should be dynamically built, since we want and need cAdvisor.

Clean up PHONY's
Make localkube dynamic
Put test.sh script back
@dlorenc
Copy link
Contributor Author

dlorenc commented May 4, 2016

PTAL @luxas, cleaned it up a bit. Thanks for the detailed review!

GOPATH=$(GOPATH) CGO_ENABLED=0 GOARCH=$(GOARCH) GOOS=$(GOOS) go build --installsuffix cgo -a -o $(BUILD_DIR)/minikube-$(GOOS)-$(GOARCH) ./cmd/minikube

localkube-$(GOOS)-$(GOARCH): gopath
GOARCH=$(GOARCH) GOOS=$(GOOS) CGO_ENABLED=1 go build -o $(BUILD_DIR)/localkube-$(GOOS)-$(GOARCH) -i ./cmd/localkube
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to support platforms other than Linux for localkube?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not, but it is really nice to be able to run "make localkube" on my mac just to be sure everything compiles :)

@dlorenc dlorenc merged commit f0ad262 into kubernetes:master May 5, 2016
@dlorenc dlorenc deleted the make branch May 19, 2016 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants