-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (38 loc) · 1.98 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
NAME := ssh-debug-log-parser
VERSION := $(shell cat ./VERSION)
REVISION = $(shell git rev-parse --short HEAD)
.PHONY: build
build:
@make build:macos:arm64
@make build:macos:amd64
@make build:linux:arm64
@make build:linux:amd64
.PHONY: build\:macos
build\:macos:
@make build:macos:arm64
@make build:macos:amd64
.PHONY: build\:linux
build\:linux:
@make build:linux:arm64
@make build:linux:amd64
.PHONY: build\:macos\:arm64
build\:macos\:arm64:
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o ${NAME}-${VERSION}-macos-arm64 -ldflags="-s -w -X main.binName=${NAME} -X main.version=${VERSION}-${REVISION}" -v ./cmd/ssh-debug-log-parser/main.go
.PHONY: build\:macos\:amd64
build\:macos\:amd64:
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ${NAME}-${VERSION}-macos-amd64 -ldflags="-s -w -X main.binName=${NAME} -X main.version=${VERSION}-${REVISION}" -v ./cmd/ssh-debug-log-parser/main.go
.PHONY: build\:linux\:arm64
build\:linux\:arm64:
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o ${NAME}-${VERSION}-linux-arm64 -ldflags="-s -w -X main.binName=${NAME} -X main.version=${VERSION}-${REVISION}" -v ./cmd/ssh-debug-log-parser/main.go
.PHONY: build\:linux\:amd64
build\:linux\:amd64:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${NAME}-${VERSION}-linux-amd64 -ldflags="-s -w -X main.binName=${NAME} -X main.version=${VERSION}-${REVISION}" -v ./cmd/ssh-debug-log-parser/main.go
.PHONY: help
help:
@echo "build - Compile go code and provide binary for macOS and Linux (arm64 and amd64)"
@echo "build:macos - Compile go code and provide binary for macOS (arm64 and amd64)"
@echo "build:macos:arm64 - Compile go code and provide binary for macOS (arm64)"
@echo "build:macos:amd64 - Compile go code and provide binary for macOS (amd64)"
@echo "build:linux - Compile go code and provide binary for Linux (arm64 and amd64)"
@echo "build:linux:arm64 - Compile go code and provide binary for Linux (arm64)"
@echo "build:linux:amd64 - Compile go code and provide binary for Linux (amd64)"