forked from Project-HAMi/HAMi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (39 loc) · 1.2 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
##### 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} \
. -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} \
. -f=docker/Dockerfile.withlib -t ${IMG_TAG}
tidy:
$(GO) mod tidy
proto:
$(GO) get github.com/gogo/protobuf/[email protected]
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