Skip to content

Commit

Permalink
make: Don't hardcode GOARCH in Makefile
Browse files Browse the repository at this point in the history
out/localkube.d and out/minikube-* targets should be able to build
on every architecture.
  • Loading branch information
vadorovsky authored and dlorenc committed May 30, 2018
1 parent b08b496 commit c7037c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ out/minikube$(IS_EXE): out/minikube-$(GOOS)-$(GOARCH)$(IS_EXE)
cp $< $@

out/localkube.d:
GOOS=linux GOARCH=amd64 $(MAKEDEPEND) out/localkube $(ORG) $(LOCALKUBEFILES) $^ > $@
GOOS=linux GOARCH=$(GOARCH) $(MAKEDEPEND) out/localkube $(ORG) $(LOCALKUBEFILES) $^ > $@

-include out/localkube.d
out/localkube:
Expand All @@ -115,14 +115,14 @@ out/minikube.d: pkg/minikube/assets/assets.go
$(MAKEDEPEND) out/minikube-$(GOOS)-$(GOARCH) $(ORG) $(MINIKUBEFILES) $^ > $@

-include out/minikube.d
out/minikube-%-amd64: pkg/minikube/assets/assets.go
out/minikube-%-$(GOARCH): pkg/minikube/assets/assets.go
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
$(call DOCKER,$(BUILD_IMAGE),/usr/bin/make $@)
else
ifneq ($(GOPATH)/src/$(REPOPATH),$(PWD))
$(warning Warning: Building minikube outside the GOPATH, should be $(GOPATH)/src/$(REPOPATH) but is $(PWD))
endif
GOOS=$* go build -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS) $(K8S_VERSION_LDFLAGS)" -a -o $@ k8s.io/minikube/cmd/minikube
GOOS=$* GOARCH=$(GOARCH) go build -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS) $(K8S_VERSION_LDFLAGS)" -a -o $@ k8s.io/minikube/cmd/minikube
endif

.PHONY: e2e-%-amd64
Expand Down

0 comments on commit c7037c4

Please sign in to comment.