2018-09-25 16:40:34 +00:00
|
|
|
# Setup name variables for the package/tool
|
|
|
|
NAME := binctr
|
|
|
|
PKG := github.com/genuinetools/$(NAME)
|
2016-04-15 06:42:40 +00:00
|
|
|
|
2018-09-25 16:40:34 +00:00
|
|
|
CGO_ENABLED := 1
|
|
|
|
|
|
|
|
# Set any default go build tags.
|
2018-03-20 02:21:14 +00:00
|
|
|
BUILDTAGS := seccomp apparmor
|
2016-04-15 06:42:40 +00:00
|
|
|
|
2018-09-25 16:40:34 +00:00
|
|
|
.PHONY: everything
|
2018-09-25 16:48:37 +00:00
|
|
|
everything: clean alpine busybox cl-k8s fmt lint test staticcheck vet ## Builds a static executable or package.
|
2016-04-15 06:42:40 +00:00
|
|
|
|
2018-09-25 16:40:34 +00:00
|
|
|
include basic.mk
|
2016-04-15 06:42:40 +00:00
|
|
|
|
2018-09-25 16:40:34 +00:00
|
|
|
.PHONY: prebuild
|
|
|
|
prebuild:
|
2016-04-15 06:42:40 +00:00
|
|
|
|
2018-03-20 05:46:02 +00:00
|
|
|
.PHONY: alpine
|
2018-03-20 06:02:00 +00:00
|
|
|
alpine:
|
2018-03-20 05:46:02 +00:00
|
|
|
@echo "+ $@"
|
2018-03-20 06:02:00 +00:00
|
|
|
go generate ./examples/$@/...
|
2018-09-25 16:40:34 +00:00
|
|
|
CGO_ENABLED=$(CGO_ENABLED) $(GO) build \
|
2018-03-20 05:46:02 +00:00
|
|
|
-tags "$(BUILDTAGS) static_build" \
|
|
|
|
${GO_LDFLAGS_STATIC} -o $@ ./examples/$@/...
|
2018-03-20 05:54:27 +00:00
|
|
|
@echo "Static container for $@ created at: ./$@"
|
2016-04-15 08:54:02 +00:00
|
|
|
|
2018-03-20 05:46:02 +00:00
|
|
|
.PHONY: busybox
|
2018-03-20 06:02:00 +00:00
|
|
|
busybox:
|
2016-04-15 06:42:40 +00:00
|
|
|
@echo "+ $@"
|
2018-03-20 06:02:00 +00:00
|
|
|
go generate ./examples/$@/...
|
2018-09-25 16:40:34 +00:00
|
|
|
CGO_ENABLED=$(CGO_ENABLED) $(GO) build \
|
2018-03-20 06:02:00 +00:00
|
|
|
-tags "$(BUILDTAGS) static_build" \
|
|
|
|
${GO_LDFLAGS_STATIC} -o $@ ./examples/$@/...
|
|
|
|
@echo "Static container for $@ created at: ./$@"
|
|
|
|
|
|
|
|
.PHONY: cl-k8s
|
|
|
|
cl-k8s:
|
|
|
|
@echo "+ $@"
|
|
|
|
go generate ./examples/$@/...
|
2018-09-25 16:40:34 +00:00
|
|
|
CGO_ENABLED=$(CGO_ENABLED) $(GO) build \
|
2018-03-20 01:52:49 +00:00
|
|
|
-tags "$(BUILDTAGS) static_build" \
|
2018-03-20 05:46:02 +00:00
|
|
|
${GO_LDFLAGS_STATIC} -o $@ ./examples/$@/...
|
2018-03-20 05:54:27 +00:00
|
|
|
@echo "Static container for $@ created at: ./$@"
|