-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
33 lines (26 loc) · 1.11 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
.PHONY: build docker build-all
build-all: build-linux-amd64 build-linux-arm64
build-test:
@go mod tidy
@rm -f ./build/deeplx_* || true
@go build -o deeplx .
build-linux-amd64:
@mkdir -p build
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags "all=-N -l" -ldflags "-s -w" -o build/deeplx_linux_amd64 .
build-linux-arm64:
@mkdir -p build
@CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -gcflags "all=-N -l" -ldflags "-s -w" -o build/deeplx_linux_arm64 .
gox-linux:
gox -gcflags="all=-N -l" -ldflags "-s -w" -osarch="linux/amd64 linux/arm64" -output="build/deeplx_{{.OS}}_{{.Arch}}"
gox-all:
gox -gcflags="all=-N -l" -ldflags "-s -w" -osarch="darwin/amd64 darwin/arm64 linux/amd64 linux/arm64 windows/amd64" -output="build/deeplx_{{.OS}}_{{.Arch}}"
docker:
@go mod tidy
@rm -f deeplx || true
@GOOS=linux GOARCH=arm64 go build -o deeplx .
@docker stop deeplx || true
@docker rm deeplx || true
@docker rmi -f neccen/deeplx-local || true
@docker build -t neccen/deeplx-local .
@docker-buildx build --platform linux/arm64 -t neccen/deeplx-local .
@docker run -itd -p 62155:62155 --name deeplx neccen/deeplx-local