-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (25 loc) · 868 Bytes
/
Makefile
File metadata and controls
35 lines (25 loc) · 868 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
31
32
33
34
35
.PHONY: bootstrap vendor clean test release dev
SRCS := main.go $(wildcard plugin/*.go)
OS_ARCHS := linux/amd64 linux/386 freebsd/386 freebsd/amd64
BIN_NAME := vault-plugin-auth-chefnode
RELEASE_TARGETS := $(foreach OS_ARCH,$(OS_ARCHS),pkg/$(OS_ARCH)/$(BIN_NAME))
default: dev
bootstrap:
go get -u github.com/golang/dep/cmd/dep
go get -u github.com/mitchellh/gox
vendor:
dep ensure
bin/vault-plugin-auth-chefnode: $(SRCS)
mkdir -p bin
CGO_ENABLED=0 go build -o bin/vault-plugin-auth-chefnode main.go
test:
go test -v github.com/nhuff/vault-plugin-auth-chefnode/plugin
clean:
rm -rf bin
rm -rf pkg
dev: test bin/vault-plugin-auth-chefnode
$(RELEASE_TARGETS) : test $(SRCS)
mkdir -p pkg
CGO_ENABLED=0 gox -osarch=$(subst /$(BIN_NAME),,$(subst pkg/,,$@)) \
-output="pkg/{{.OS}}/{{.Arch}}/vault-plugin-auth-chefnode"
release: test $(RELEASE_TARGETS)