make: re-add kube make targets#132
Conversation
* re add the kube make targets that were accidently removed as part of envoyproxy#113 * rm implementation for image.multiarch, which needs work * rm Makefile.targets.mk and reuse tools/make/common.mk * move top level targets to the right makefiles * move `make help` strings closer to the target ``` Envoy Gateway is an open source project for managing Envoy Proxy as a standalone or Kubernetes-based application gateway Usage: make <Targets> <Options> ... Targets: Usage: make <target> Golang build Build envoy-gateway for host platform. See Option PLATFORM and BINS. test Run all Go test of code sources. format Format codes style with mod tidy, gofmt and goimports. clean Remove all files that are created during builds. Image image Build docker images for host platform. See Option PLATFORM and BINS. push Push docker images to registry. Lint lint Run all linter of code sources, including golint, yamllint and codespell. Kubernetes Development manifests Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects. generate Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. kube-test Run Kubernetes provider tests. Kubernetes Deployment kube-install Install CRDs into the Kubernetes cluster specified in ~/.kube/config. kube-uninstall Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. Kubernetes Build Dependencies kustomize Download kustomize locally if necessary. controller-gen Download controller-gen locally if necessary. envtest Download envtest-setup locally if necessary. Options: BINS The binaries to build. Default is all of cmd. This option is available when using: make build/build.multiarch Example: make build BINS="envoy-gateway" IMAGES Backend images to make. Default is all of cmds. This option is available when using: make image/image.multiarch/push/push.multiarch Example: make image.multiarch IMAGES="envoy-gateway" PLATFORM The specified platform to build. This option is available when using: make build/image Example: make build BINS="envoy-gateway" PLATFORM="linux_amd64" Supported Platforms: linux_amd64 linux_arm64 darwin_amd64 darwin_arm64 PLATFORMS The multiple platforms to build. This option is available when using: make build.multiarch Example: make image.multiarch IMAGES="envoy-gateway" PLATFORMS="linux_amd64 linux_arm64" Default is "linux_amd64 linux_arm64 darwin_amd64 darwin_arm64". ``` Signed-off-by: Arko Dasgupta <arko@tetrate.io>
| .PHONY: go.build | ||
| go.build: $(addprefix go.build., $(addprefix $(PLATFORM)., $(BINS))) | ||
| go.build: | ||
| @$(MAKE) $(addprefix go.build., $(addprefix $(PLATFORM)., $(BINS))) |
There was a problem hiding this comment.
What's the point of this change? In the other places that do $(MAKE) like this, I'd have made the reverse change.
(See also: Peter Miller's famous "Recursive Make Considered Harmful" article)
There was a problem hiding this comment.
@LukeShu thanks for the review, I added that extra make because I was unable to work around it, here's the error
diff --git a/tools/make/golang.mk b/tools/make/golang.mk
index 7600d0a..9c7f1c3 100644
--- a/tools/make/golang.mk
+++ b/tools/make/golang.mk
@@ -22,8 +22,7 @@ go.build.%:
# Build the envoy-gateway binaries in the hosted platforms.
.PHONY: go.build
-go.build:
- @$(MAKE) $(addprefix go.build., $(addprefix $(PLATFORM)., $(BINS)))
+go.build: $(addprefix go.build., $(addprefix $(PLATFORM)., $(BINS)))
# Build the envoy-gateway binaries in multi platforms
# It will build the linux/amd64, linux/arm64, darwin/amd64, darwin/arm64 binaries out.
🐳 ~/go-workspace/src/github.com/envoyproxy/gateway$ make build
make[3]: Nothing to be done for `go.build'.
hopefully some make magician can help iron this out, but for the time being shouldnt affect correctness
LukeShu
left a comment
There was a problem hiding this comment.
I don't like that this is leaning even harder in to recursive Make rather than just using dependencies.
But to the degree that this is copy/pasting the code around (either within the repo, or out of the old Makefile.targets.mk), lgtm.
re add the kube make targets that were accidently
removed as part of chore: add more commands and refactor makefiles #113
rm implementation for image.multiarch, which needs work
rm Makefile.targets.mk and reuse tools/make/common.mk
move top level targets to the right makefiles
move
make helpstrings closer to the targetSigned-off-by: Arko Dasgupta arko@tetrate.io