@@ -29,20 +29,32 @@ echo "Checking installation of $(1)" ;\
2929GOBIN=$(LOCAL_BIN ) go install $(1 )
3030endef
3131
32- .PHONY : build build-binary build-release generate layout fmt lint lint-dependencies test
33-
3432include build/common/Makefile.common.mk
3533
34+ # ###########################################################
35+ # clean section
36+ # ###########################################################
37+
38+ .PHONY : clean
39+ clean :
40+ -rm $(LOCAL_BIN ) /*
41+ -rm $(API_PLUGIN_PATH ) /PolicyGenerator
42+ -rm build_output/*
43+ -rm PolicyGenerator
44+
3645# ###########################################################
3746# build section
3847# ###########################################################
3948
49+ .PHONY : build
4050build : layout
4151 go build -o $(API_PLUGIN_PATH ) /PolicyGenerator cmd/main.go
4252
53+ .PHONY : build-binary
4354build-binary :
4455 go build -o PolicyGenerator cmd/main.go
4556
57+ .PHONY : build-release
4658build-release :
4759 @if [[ $( shell git status --porcelain | wc -l) -gt 0 ]]; \
4860 then \
@@ -54,16 +66,19 @@ build-release:
5466 GOOS=darwin CGO_ENABLED=0 GOARCH=amd64 go build -o build_output/darwin-amd64-PolicyGenerator cmd/main.go
5567 GOOS=windows CGO_ENABLED=0 GOARCH=amd64 go build -o build_output/windows-amd64-PolicyGenerator.exe cmd/main.go
5668
69+ .PHONY : generate
5770generate :
5871 @KUSTOMIZE_PLUGIN_HOME=$(KUSTOMIZE_PLUGIN_HOME ) kustomize build --enable-alpha-plugins $(SOURCE_DIR )
5972
73+ .PHONY : layout
6074layout :
6175 mkdir -p $(API_PLUGIN_PATH )
6276
6377# ###########################################################
6478# format section
6579# ###########################################################
6680
81+ .PHONY : fmt
6782fmt :
6883 go fmt ./...
6984
7590lint-dependencies :
7691 $(call go-get-tool,github.com/golangci/golangci-lint/cmd/[email protected] ) 7792
93+ .PHONY : lint
7894lint : lint-dependencies lint-all
7995
8096# ###########################################################
8197# test section
8298# ###########################################################
8399GOSEC = $(LOCAL_BIN ) /gosec
84100
101+ .PHONY : test
85102test :
86103 @go test $(TESTARGS ) ./...
87104
0 commit comments