forked from 99designs/aws-vault
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (26 loc) · 810 Bytes
/
Makefile
File metadata and controls
30 lines (26 loc) · 810 Bytes
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
OS=$(shell uname -s)
ARCH=$(shell uname -m)
PREFIX=github.com/99designs/aws-vault
GOVERSION=$(shell go version)
GOBIN=$(shell go env GOBIN)
VERSION=$(shell git describe --tags --candidates=1 --dirty)
FLAGS=-v -X main.Version=$(VERSION)
CERT="3rd Party Mac Developer Application: 99designs Inc (NRM9HVJ62Z)"
# Prevent broken code-signing
# https://github.com/golang/go/issues/11887#issuecomment-126117692.
ifneq (,$(findstring 1.5, $(GOVERSION)))
FLAGS+=-s
endif
build:
go build -o aws-vault -ldflags="$(FLAGS)" $(PREFIX)
ifeq "$(OS)" "Darwin"
codesign -s $(CERT) ./aws-vault
endif
install:
go install -ldflags="$(FLAGS)" $(PREFIX)
ifeq "$(OS)" "Darwin"
codesign -s $(CERT) $(GOBIN)/aws-vault
endif
release: build
cp aws-vault aws-vault-$(OS)-$(ARCH)
@echo Upload aws-vault-$(OS)-$(ARCH) as $(VERSION)