Skip to content

Commit 2efb5fc

Browse files
committed
Add clean Make target
ref: stolostron/backlog#23044 Signed-off-by: Dale Haiducek <[email protected]>
1 parent 85c0023 commit 2efb5fc

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

Makefile

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,32 @@ echo "Checking installation of $(1)" ;\
2929
GOBIN=$(LOCAL_BIN) go install $(1)
3030
endef
3131

32-
.PHONY: build build-binary build-release generate layout fmt lint lint-dependencies test
33-
3432
include 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
4050
build: layout
4151
go build -o $(API_PLUGIN_PATH)/PolicyGenerator cmd/main.go
4252

53+
.PHONY: build-binary
4354
build-binary:
4455
go build -o PolicyGenerator cmd/main.go
4556

57+
.PHONY: build-release
4658
build-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
5770
generate:
5871
@KUSTOMIZE_PLUGIN_HOME=$(KUSTOMIZE_PLUGIN_HOME) kustomize build --enable-alpha-plugins $(SOURCE_DIR)
5972

73+
.PHONY: layout
6074
layout:
6175
mkdir -p $(API_PLUGIN_PATH)
6276

6377
############################################################
6478
# format section
6579
############################################################
6680

81+
.PHONY: fmt
6782
fmt:
6883
go fmt ./...
6984

@@ -75,13 +90,15 @@ fmt:
7590
lint-dependencies:
7691
$(call go-get-tool,github.com/golangci/golangci-lint/cmd/[email protected])
7792

93+
.PHONY: lint
7894
lint: lint-dependencies lint-all
7995

8096
############################################################
8197
# test section
8298
############################################################
8399
GOSEC = $(LOCAL_BIN)/gosec
84100

101+
.PHONY: test
85102
test:
86103
@go test $(TESTARGS) ./...
87104

0 commit comments

Comments
 (0)