-
Notifications
You must be signed in to change notification settings - Fork 136
/
Makefile
55 lines (41 loc) · 1.3 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
44
45
46
47
48
49
50
51
52
53
54
##### Global variables #####
include version.mk
all: build
docker:
docker build \
--build-arg GOLANG_IMAGE=${GOLANG_IMAGE} \
--build-arg TARGET_ARCH=${TARGET_ARCH} \
--build-arg NVIDIA_IMAGE=${NVIDIA_IMAGE} \
--build-arg DEST_DIR=${DEST_DIR} \
--build-arg GOPROXY=https://goproxy.cn,direct \
. -f=docker/Dockerfile -t ${IMG_TAG}
dockerwithlib:
docker build \
--no-cache \
--build-arg GOLANG_IMAGE=${GOLANG_IMAGE} \
--build-arg TARGET_ARCH=${TARGET_ARCH} \
--build-arg NVIDIA_IMAGE=${NVIDIA_IMAGE} \
--build-arg DEST_DIR=${DEST_DIR} \
--build-arg GOPROXY=https://goproxy.cn,direct \
. -f=docker/Dockerfile.withlib -t ${IMG_TAG}
tidy:
$(GO) mod tidy
proto:
$(GO) get github.com/gogo/protobuf/protoc-gen-gofast@v1.3.2
protoc --gofast_out=plugins=grpc:. ./pkg/api/*.proto
build: $(CMDS) $(DEVICES)
$(CMDS):
$(GO) build -ldflags '-s -w -X github.com/Project-HAMi/HAMi/pkg/version.version=$(VERSION)' -o ${OUTPUT_DIR}/$@ ./cmd/$@
$(DEVICES):
$(GO) build -ldflags '-s -w -X github.com/Project-HAMi/HAMi/pkg/version.version=$(VERSION)' -o ${OUTPUT_DIR}/$@-device-plugin ./cmd/device-plugin/$@
clean:
$(GO) clean -r -x ./cmd/...
-rm -rf $(OUTPUT_DIR)
.PHONY: all build docker clean $(CMDS)
test:
bash hack/unit-test.sh
lint:
bash hack/verify-staticcheck.sh
.PHONY: verify
verify:
hack/verify-all.sh