forked from alexandr-g/concourse-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (36 loc) · 1.15 KB
/
Makefile
File metadata and controls
47 lines (36 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
39
40
41
42
43
44
45
46
47
# Other config
NO_COLOR=\033[0m
OK_COLOR=\033[32;01m
ERROR_COLOR=\033[31;01m
WARN_COLOR=\033[33;01m
DIR_OUT=$(CURDIR)/out
BINARY=$(DIR_OUT)/concourse-tutorial
GO_LINKER_FLAGS=-ldflags="-s -w"
GO_PROJECT_FILES=`go list -f '{{.Dir}}' ./... | grep -v /vendor/ | sed -n '1!p'`
.PHONY: all clean deps build
all: clean deps build
deps:
@echo "$(OK_COLOR)==> Installing glide with dependencies$(NO_COLOR)"
@go get -u github.com/Masterminds/glide
@glide install
@echo "$(OK_COLOR)==> Installing testing libraries"
@go get github.com/onsi/ginkgo/ginkgo # installs the ginkgo CLI
@go get github.com/onsi/gomega # fetches the matcher library
# Builds the project
build:
@echo "$(OK_COLOR)==> Building project$(NO_COLOR)"
@go build -o ${BINARY} ${GO_LINKER_FLAGS} ${SRC_AUTH}
# Builds the project
build:
@echo "$(OK_COLOR)==> Building project$(NO_COLOR)"
@go build -o ${BINARY} ${GO_LINKER_FLAGS} ${SRC_AUTH}
# Format the source code
fmt:
@gofmt -s=true -w $(GO_PROJECT_FILES)
# Tests the project
test:
@ginkgo -r
# Cleans our project: deletes binaries
clean:
@echo "$(OK_COLOR)==> Cleaning project$(NO_COLOR)"
if [ -d ${DIR_OUT} ] ; then rm -f ${DIR_OUT}/* ; fi