-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (42 loc) · 1.04 KB
/
Makefile
File metadata and controls
54 lines (42 loc) · 1.04 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
48
49
50
51
52
53
54
REV_VAR := github.com/modcloth/mithril.Rev
VERSION_VAR := github.com/modcloth/mithril.Version
REPO_VERSION := $(shell git describe --always --dirty --tags)
REPO_REV := $(shell git rev-parse --sq HEAD)
GOBUILD_VERSION_ARGS := -ldflags "\
-X $(REV_VAR) $(REPO_REV) \
-X $(VERSION_VAR) $(REPO_VERSION)"
GO ?= go
DEPPY ?= deppy
GO_TAG_ARGS ?=
ADDR := :8371
export ADDR
.PHONY: all
all: clean golden
.PHONY: test
test: build
go test $(GO_TAG_ARGS) -x ./...
.PHONY: build
build: deps
go install $(GOBUILD_VERSION_ARGS) $(GO_TAG_ARGS) ./...
go build -o $${GOPATH%%:*}/bin/mithril-server $(GOBUILD_VERSION_ARGS) $(GO_TAG_ARGS) ./mithril-server
.PHONY: deps
deps:
$(DEPPY) restore
.PHONY: save
save:
$(DEPPY) save ./...
.PHONY: clean
clean:
$(GO) clean -x ./...
if [ -d $${GOPATH%%:*}/pkg ] ; then \
find $${GOPATH%%:*}/pkg -wholename '*modcloth/mithril*' -exec $(RM) -v {} \; ; \
fi
$(RM) .artifacts/*
.PHONY: distclean
distclean: clean
.PHONY: serve
serve:
$${GOPATH%%:*}/bin/mithril-server -d -a $(ADDR)
.PHONY: golden
golden: test
./runtests -v