forked from openshift/api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (48 loc) · 1.83 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Detect go environment to build tools into env specific directories.
# This is helpful for those running tools locally and within containers across different OS/architechture combinations.
GOOS=$(shell go env GOOS)
GOARCH=$(shell go env GOARCH)
TOOLS_DIR=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
OUTPUT_DIR=$(TOOLS_DIR)/_output/bin/$(GOOS)/$(GOARCH)
# Tools builds all tools.
tools: deepcopy-gen openapi-gen
#############################################
#
# BEGIN: Shortcuts to fully qualified targets
#
#############################################
.PHONY:deepcopy-gen
deepcopy-gen: $(OUTPUT_DIR)/deepcopy-gen
.PHONY:go-to-protobuf
go-to-protobuf: $(OUTPUT_DIR)/go-to-protobuf
.PHONY:openapi-gen
openapi-gen: $(OUTPUT_DIR)/openapi-gen
.PHONY:protoc-gen-gogo
protoc-gen-gogo: $(OUTPUT_DIR)/protoc-gen-gogo
.PHONY:yq
yq: $(OUTPUT_DIR)/yq
###########################################
#
# End: Shortcuts to fully qualified targets
#
###########################################
#####################################
#
# BEGIN: Fully qualified tool targets
#
#####################################
$(OUTPUT_DIR)/deepcopy-gen:
go build -mod=vendor -o $(OUTPUT_DIR)/deepcopy-gen ./vendor/k8s.io/code-generator/cmd/deepcopy-gen
$(OUTPUT_DIR)/go-to-protobuf:
go build -mod=vendor -o $(OUTPUT_DIR)/go-to-protobuf ./vendor/k8s.io/code-generator/cmd/go-to-protobuf
$(OUTPUT_DIR)/openapi-gen:
go build -mod=vendor -o $(OUTPUT_DIR)/openapi-gen ./vendor/k8s.io/code-generator/cmd/openapi-gen
$(OUTPUT_DIR)/protoc-gen-gogo:
go build -mod=vendor -o $(OUTPUT_DIR)/protoc-gen-gogo ./vendor/k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo
$(OUTPUT_DIR)/yq:
go build -mod=vendor -o $(OUTPUT_DIR)/yq ./vendor/github.com/mikefarah/yq/v4
###################################
#
# END: Fully qualified tool targets
#
###################################