forked from SynologyOpenSource/synology-csi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (23 loc) · 733 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
24
25
26
27
28
29
30
31
# Copyright 2021 Synology Inc.
REGISTRY_NAME=synology
IMAGE_NAME=synology-csi
IMAGE_VERSION=v1.0.0
IMAGE_TAG=$(REGISTRY_NAME)/$(IMAGE_NAME):$(IMAGE_VERSION)
# For now, only build linux/amd64 platform
GOARCH?=amd64
BUILD_ENV=CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH)
BUILD_FLAGS="-extldflags \"-static\""
.PHONY: all clean synology-csi-driver synocli test docker-build
all: synology-csi-driver
synology-csi-driver:
@mkdir -p bin
$(BUILD_ENV) go build -v -ldflags $(BUILD_FLAGS) -o ./bin/synology-csi-driver ./
docker-build:
docker build -f Dockerfile -t $(IMAGE_TAG) .
synocli:
@mkdir -p bin
$(BUILD_ENV) go build -v -ldflags $(BUILD_FLAGS) -o ./bin/synocli ./synocli
test:
go test -v ./test/...
clean:
-rm -rf ./bin