-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
39 lines (32 loc) · 978 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
30
31
32
33
34
35
36
37
38
39
NAME=ejsonkms
PACKAGE=github.com/envato/ejsonkms
VERSION=$(shell cat VERSION)
GOFILES=$(shell find . -type f -name '*.go')
.PHONY: default all binaries clean
default: all
all: binaries
binaries: build/bin/linux-amd64 build/bin/linux-arm64 build/bin/darwin-amd64 build/bin/darwin-arm64
build/bin/linux-amd64: $(GOFILES)
mkdir -p "$(@D)"
GOOS=linux GOARCH=amd64 go build \
-ldflags '-s -w -X main.version="$(VERSION)"' \
-o "$@" \
"$(PACKAGE)/cmd/$(NAME)"
build/bin/linux-arm64: $(GOFILES)
mkdir -p "$(@D)"
GOOS=linux GOARCH=arm64 go build \
-ldflags '-s -w -X main.version="$(VERSION)"' \
-o "$@" \
"$(PACKAGE)/cmd/$(NAME)"
build/bin/darwin-amd64: $(GOFILES)
GOOS=darwin GOARCH=amd64 go build \
-ldflags '-s -w -X main.version="$(VERSION)"' \
-o "$@" \
"$(PACKAGE)/cmd/$(NAME)"
build/bin/darwin-arm64: $(GOFILES)
GOOS=darwin GOARCH=arm64 go build \
-ldflags '-s -w -X main.version="$(VERSION)"' \
-o "$@" \
"$(PACKAGE)/cmd/$(NAME)"
clean:
rm -rf build