Merge pull request #6998 from thaJeztah/urfave_cli_no_docs
Makefile: use urfave_cli_no_docs for binaries that don't need it
This commit is contained in:
commit
dd9e6a70dc
8
Makefile
8
Makefile
@ -88,6 +88,7 @@ ifdef BUILDTAGS
|
|||||||
GO_BUILDTAGS = ${BUILDTAGS}
|
GO_BUILDTAGS = ${BUILDTAGS}
|
||||||
endif
|
endif
|
||||||
GO_BUILDTAGS ?=
|
GO_BUILDTAGS ?=
|
||||||
|
GO_BUILDTAGS += urfave_cli_no_docs
|
||||||
GO_BUILDTAGS += ${DEBUG_TAGS}
|
GO_BUILDTAGS += ${DEBUG_TAGS}
|
||||||
GO_TAGS=$(if $(GO_BUILDTAGS),-tags "$(strip $(GO_BUILDTAGS))",)
|
GO_TAGS=$(if $(GO_BUILDTAGS),-tags "$(strip $(GO_BUILDTAGS))",)
|
||||||
GO_LDFLAGS=-ldflags '-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) $(EXTRA_LDFLAGS)'
|
GO_LDFLAGS=-ldflags '-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PACKAGE) $(EXTRA_LDFLAGS)'
|
||||||
@ -221,13 +222,18 @@ FORCE:
|
|||||||
|
|
||||||
define BUILD_BINARY
|
define BUILD_BINARY
|
||||||
@echo "$(WHALE) $@"
|
@echo "$(WHALE) $@"
|
||||||
@$(GO) build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@ ${GO_LDFLAGS} ${GO_TAGS} ./$<
|
$(GO) build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@ ${GO_LDFLAGS} ${GO_TAGS} ./$<
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# Build a binary from a cmd.
|
# Build a binary from a cmd.
|
||||||
bin/%: cmd/% FORCE
|
bin/%: cmd/% FORCE
|
||||||
$(call BUILD_BINARY)
|
$(call BUILD_BINARY)
|
||||||
|
|
||||||
|
# gen-manpages must not have the urfave_cli_no_docs build-tag set
|
||||||
|
bin/gen-manpages: cmd/gen-manpages FORCE
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
|
$(GO) build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@ ${GO_LDFLAGS} $(subst urfave_cli_no_docs,,${GO_TAGS}) ./cmd/gen-manpages
|
||||||
|
|
||||||
bin/containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
|
bin/containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
|
||||||
@echo "$(WHALE) $@"
|
@echo "$(WHALE) $@"
|
||||||
@CGO_ENABLED=${SHIM_CGO_ENABLED} $(GO) build ${GO_BUILD_FLAGS} -o $@ ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
|
@CGO_ENABLED=${SHIM_CGO_ENABLED} $(GO) build ${GO_BUILD_FLAGS} -o $@ ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
|
||||||
|
Loading…
Reference in New Issue
Block a user