-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (37 loc) · 1.11 KB
/
Copy pathMakefile
File metadata and controls
46 lines (37 loc) · 1.11 KB
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
BINARY := bin/docker-gpu-proxy
VERSION ?= dev
DIST_OS_ARCH ?= linux/amd64 linux/arm64
.PHONY: build test test-race vet check install dist clean
build:
mkdir -p bin
go build -buildvcs=false -trimpath -ldflags '-X main.version=$(VERSION)' -o $(BINARY) ./cmd/docker-gpu-proxy
test:
go test ./...
test-race:
go test -race -count=1 ./...
vet:
go vet ./...
check: test-race vet
install: build
./scripts/install.sh
dist:
mkdir -p dist
@set -e; for pair in $(DIST_OS_ARCH); do \
os=$${pair%/*}; \
arch=$${pair#*/}; \
name=docker-gpu-proxy_$(VERSION)_$${os}_$${arch}; \
out=dist/$${name}; \
mkdir -p $${out}/bin $${out}/packaging $${out}/scripts; \
CGO_ENABLED=0 GOOS=$${os} GOARCH=$${arch} \
go build -buildvcs=false -trimpath \
-ldflags '-X main.version=$(VERSION)' \
-o $${out}/bin/docker-gpu-proxy ./cmd/docker-gpu-proxy; \
cp packaging/docker-gpu-proxy.service $${out}/packaging/; \
cp scripts/install.sh $${out}/scripts/; \
cp README.md $${out}/; \
tar -C dist -czf dist/$${name}.tar.gz $${name}; \
rm -rf $${out}; \
done
cd dist && sha256sum *.tar.gz > checksums.txt
clean:
rm -rf bin dist