Skip to content

Commit 3e2b151

Browse files
author
Peter Jönsson
committed
Add fancy Makefile
1 parent 9b1479b commit 3e2b151

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

Makefile

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
1-
all:
1+
NO_COLOR=\033[0m
2+
OK_COLOR=\033[32;01m
3+
ERROR_COLOR=\033[31;01m
4+
WARN_COLOR=\033[33;01m
5+
DEPS = $(go list -f '{{range .TestImports}}{{.}} {{end}}' ./...)
6+
7+
all: deps
8+
@mkdir -p bin/
9+
@echo "$(OK_COLOR)==> Building$(NO_COLOR)"
210
@go build
311

12+
deps:
13+
@echo "$(OK_COLOR)==> Installing dependencies$(NO_COLOR)"
14+
@go get -d -v ./...
15+
@echo $(DEPS) | xargs -n1 go get -d
16+
17+
updatedeps:
18+
@echo "$(OK_COLOR)==> Updating all dependencies$(NO_COLOR)"
19+
@go get -d -v -u ./...
20+
@echo $(DEPS) | xargs -n1 go get -d -u
21+
22+
clean:
23+
@git clean -dffxq
24+
425
format:
5-
@go fmt
26+
go fmt ./...
27+
28+
test: deps
29+
@echo "$(OK_COLOR)==> Testing Gopherstack...$(NO_COLOR)"
30+
go test ./...
31+
32+
.PHONY: all clean deps format test updatedeps

0 commit comments

Comments
 (0)