-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (23 loc) · 839 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
BINARY_NAME=explain-cloudformation-changeset
SOURCES:=$(shell find . -type f -name '*.go')
AWS_EXAMPLES_SOURCES:=$(wildcard aws-examples/SampleChangeSet*.json)
AWS_EXAMPLES_OUTPUTS:=$(patsubst %.json, %.png, $(AWS_EXAMPLES_SOURCES))
all: build test aws-examples
build: ${BINARY_NAME}
${BINARY_NAME}: ${SOURCES} deps
go build -o "$@" -ldflags "-X github.com/ankon/explain-cloudformation-changeset/cmd.version=$(shell git describe --tags --always --first-parent)" main.go
lint:
go vet .
test:
go test -v main.go
run: ${BINARY_NAME}
./${BINARY_NAME}
aws-examples: ${AWS_EXAMPLES_OUTPUTS}
aws-examples/%.png: ${BINARY_NAME} aws-examples/%.json
./${BINARY_NAME} --cache-dir aws-examples --graph-output "$@" --change-set-name "$*"
deps:
go mod download
clean:
go clean
distclean: clean
rm -f ${BINARY_NAME} ${BINARY_NAME}.*