-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Conversation
cc @ethernetdan Could you take a look here when you get a chance? |
BUILD_DIR ?= ./out | ||
GOPATH := $(shell pwd)/.gopath | ||
REPOPATH ?= k8s.io/minikube | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GO15VENDOREXPERIMENT=1
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 :)
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