...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package main
17
18
19 const localBinaryGeneratedMkTemplate = `# Generated by ./cmd/generate-makefile. DO NOT EDIT.
20
21 ##@ Generated targets in local-binary.generated.mk
22
23 {{ .Content -}}
24
25 .PHONY: clean-local-binary
26 clean-local-binary:
27 {{- range .Recipes }}
28 rm -f {{ .OutputPath }}
29 {{- end }}
30 `
31
32
33 const localBinaryRecipeTemplate = `.PHONY: {{ .OutputPath }}
34 {{ .TargetName }}: {{ StringsJoin .DependencyTargets " " }} ## {{ .Comment }}
35 {{- if .UseCGO }}
36 $(CGO) build -ldflags "$(LDFLAGS)" -tags "${BUILD_TAGS}" -o {{ .OutputPath }} {{ .SourcePath }}
37 {{- else }}
38 $(GO) build -ldflags "$(LDFLAGS)" -tags "${BUILD_TAGS}" -o {{ .OutputPath }} {{ .SourcePath }}
39 {{- end }}
40
41 `
42
43
44 var localBinaryRecipes = []binaryRecipeOptions{
45 {
46 TargetName: "local/chaos-controller-manager",
47 SourcePath: "cmd/chaos-controller-manager/main.go",
48 OutputPath: "bin/chaos-controller-manager",
49 UseCGO: false,
50 Comment: "Build binary chaos-controller-manager in local environment",
51 },
52 {
53 TargetName: "local/chaos-dashboard",
54 SourcePath: "cmd/chaos-dashboard/main.go",
55 OutputPath: "bin/chaos-dashboard",
56 UseCGO: true,
57 Comment: "Build binary chaos-dashboard in local environment",
58 },
59 }
60