-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
26 lines (20 loc) · 991 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
version:=${CLI_VERSION}
build_date:=`date +%Y/%m/%d`
build:
echo "Building CLI with version: $(version), build date: $(build_date)"
# build binary for mac osx
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 \
go build \
-tags="containers_image_openpgp exclude_graphdriver_devicemapper exclude_graphdriver_btrfs" \
-o bin/darwin/cbctl \
-ldflags "-X 'github.com/vmware/carbon-black-cloud-container-cli/internal/version.version=${version}' \
-X 'github.com/vmware/carbon-black-cloud-container-cli/internal/version.buildDate=${build_date}'" \
main.go
# build binary for linux
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build \
-tags="containers_image_openpgp exclude_graphdriver_devicemapper exclude_graphdriver_btrfs" \
-o bin/linux/cbctl \
-ldflags "-X 'github.com/vmware/carbon-black-cloud-container-cli/internal/version.version=${version}' \
-X 'github.com/vmware/carbon-black-cloud-container-cli/internal/version.buildDate=${build_date}'" \
main.go