-
Notifications
You must be signed in to change notification settings - Fork 80
/
Makefile
43 lines (35 loc) · 1.08 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
# Setup name variables for the package/tool
NAME := binctr
PKG := github.com/genuinetools/$(NAME)
CGO_ENABLED := 1
# Set any default go build tags.
BUILDTAGS := seccomp apparmor
.PHONY: everything
everything: clean alpine busybox cl-k8s fmt lint test staticcheck vet ## Builds a static executable or package.
include basic.mk
.PHONY: prebuild
prebuild:
.PHONY: alpine
alpine:
@echo "+ $@"
go generate ./examples/$@/...
CGO_ENABLED=$(CGO_ENABLED) $(GO) build \
-tags "$(BUILDTAGS) static_build" \
${GO_LDFLAGS_STATIC} -o $@ ./examples/$@/...
@echo "Static container for $@ created at: ./$@"
.PHONY: busybox
busybox:
@echo "+ $@"
go generate ./examples/$@/...
CGO_ENABLED=$(CGO_ENABLED) $(GO) build \
-tags "$(BUILDTAGS) static_build" \
${GO_LDFLAGS_STATIC} -o $@ ./examples/$@/...
@echo "Static container for $@ created at: ./$@"
.PHONY: cl-k8s
cl-k8s:
@echo "+ $@"
go generate ./examples/$@/...
CGO_ENABLED=$(CGO_ENABLED) $(GO) build \
-tags "$(BUILDTAGS) static_build" \
${GO_LDFLAGS_STATIC} -o $@ ./examples/$@/...
@echo "Static container for $@ created at: ./$@"