forked from nautilus/gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
29 lines (23 loc) · 910 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
.PHONY: test
test:
go test -race -coverprofile=cover.out ./...
cd ./cmd/gateway && go test -v -race ./...
.PHONY: build-setup
build-setup:
# When building cmd/gateway in CI, always use the current version of the gateway.
set -ex; \
cd cmd/gateway; \
go mod edit -replace github.com/nautilus/gateway=../..; \
go mod download github.com/nautilus/gateway
rm -rf bin && mkdir bin
.PHONY: build
build: build-linux build-darwin build-windows
.PHONY: build-linux
build-linux: build-setup
cd cmd/gateway && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ../../bin/gateway_linux_amd64 .
.PHONY: build-darwin
build-darwin: build-setup
cd cmd/gateway && CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ../../bin/gateway_darwin_amd64 .
.PHONY: build-windows
build-windows: build-setup
cd cmd/gateway && CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ../../bin/gateway_windows_amd64.exe .