-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Makefile kops-install default #3426
Makefile kops-install default #3426
Conversation
Makefile binary targets depend on SOURCES
/approve
/assign chrislovecnm
|
@@ -93,8 +96,21 @@ ifndef SHASUMCMD | |||
$(error "Neither sha1sum nor shasum command is available") | |||
endif | |||
|
|||
.PHONY: kops-install # Install kops to local $GOPATH/bin | |||
kops-install: ${KOPS} | |||
cp ${KOPS} ${GOPATH_1ST}/bin |
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.
Is go build
still much slower than go install
?
@alrs the reason we've used PHONY for targets is because it's hard to compute the set of dependencies for a go program, and |
@justinsb The |
kops-dev: ${BINDATA_TARGETS} | ||
go install ${EXTRA_BUILDFLAGS} -ldflags "-X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA} ${EXTRA_LDFLAGS}" k8s.io/kops/cmd/kops/ | ||
|
||
.PHONY: ${GOBINDATA} | ||
${GOBINDATA}: |
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.
This needs .PHONY or some deps
OK, I still think we might need some more deps but I'm going to get this merged along with the others so we can have a look. BTW, @alrs have you check out bazel - once I saw bazel I kinda felt that as long as the makefile worked, that was good enough - the future is coming! Now if only they didn't keep breaking it ;-) /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alrs, justinsb The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. . |
Makefile binary targets depend on SOURCES
I botched an attempt to merge master into the previous PR, so here is a do-over.
make
will install thekops
binary in$GOPATH/bin
by default.The binary targets all depend on the
${SOURCES}
variable, so they will be rebuilt whenever any.go
file in the tree is modified.There was a concern in the previous PR from @chrislovecnm about missing
.PHONY
declarations..PHONY
is only needed for targets that aren't named after the artifact they create. Do you see any examples of.PHONY
targets that aren't maked as such?