File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44* .dll
55* .so
66* .dylib
7- /bin
7+ /_build
88
99# Test binary, built with `go test -c`
1010* .test
Original file line number Diff line number Diff line change 1515SHELL := /usr/bin/env bash
1616
1717GO_INSTALL = ./hack/go-install.sh
18+ BUILD_DEST ?= _build
19+ CMD ?= $(notdir $(wildcard ./cmd/* ) )
1820
1921TOOLS_DIR =hack/tools
2022GOBIN_DIR := $(abspath $(TOOLS_DIR ) )
@@ -72,11 +74,19 @@ $(KUBE_INFORMER_GEN):
7274$(KUBE_APPLYCONFIGURATION_GEN ) :
7375 GOBIN=$(GOBIN_DIR ) $(GO_INSTALL ) k8s.io/code-generator/cmd/$(KUBE_APPLYCONFIGURATION_GEN_BIN ) $(KUBE_APPLYCONFIGURATION_GEN_BIN ) $(KUBE_APPLYCONFIGURATION_GEN_VER )
7476
77+ .PHONY : clean
78+ clean :
79+ rm -rf $(BUILD_DEST )
80+ @echo " Cleaned $( BUILD_DEST) "
7581
7682.PHONY : build
77- build : # # Build the project
78- mkdir -p bin
79- go build -o bin
83+ build : $(CMD )
84+
85+ .PHONY : $(CMD )
86+ $(CMD ) : % : $(BUILD_DEST ) /%
87+
88+ $(BUILD_DEST ) /% : cmd/%
89+ go build -o $@ ./cmd/$*
8090
8191.PHONY : install
8292install :
You can’t perform that action at this time.
0 commit comments