-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (29 loc) · 1.15 KB
/
Makefile
File metadata and controls
38 lines (29 loc) · 1.15 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
Version := $(shell git describe --tags --dirty)
GitCommit := $(shell git rev-parse HEAD)
LDFLAGS := "-s -w -X main.Version=$(Version) -X main.GitCommit=$(GitCommit)"
NAME := lokiproxy
.PHONY: all
all: dist
.PHONY: test
test:
go test -race -v ./...
.PHONY: dist linux-amd64 darwin linux-armv7 linux-arm64 windows-amd64
dist: linux-amd64 darwin linux-armv7 linux-arm64 windows-amd64
linux-amd64:
mkdir -p bin/
GOARCH=amd64 CGO_ENABLED=0 GOOS=linux go build -ldflags $(LDFLAGS) -o bin/$(NAME)-amd64 lokiproxy.go
darwin:
mkdir -p bin/
GOARCH=amd64 CGO_ENABLED=0 GOOS=darwin go build -ldflags $(LDFLAGS) -o bin/$(NAME)-darwin lokiproxy.go
linux-armv7:
mkdir -p bin/
GOARM=7 GOARCH=arm CGO_ENABLED=0 GOOS=linux go build -ldflags $(LDFLAGS) -o bin/$(NAME)-arm lokiproxy.go
linux-arm64:
mkdir -p bin/
GOARCH=arm64 CGO_ENABLED=0 GOOS=linux go build -ldflags $(LDFLAGS) -o bin/$(NAME)-arm64 lokiproxy.go
windows-amd64:
mkdir -p bin/
GOARCH=amd64 GOOS=windows CGO_ENABLED=0 go build -ldflags $(LDFLAGS) -o bin/$(NAME).exe lokiproxy.go
.PHONY: image
image:
docker buildx build --pull . --platform linux/amd64,linux/arm64 --push --tag ghcr.io/nyu-rts/lokiproxy:$(Version)