forked from go-graphite/carbonapi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
38 lines (29 loc) · 846 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
35
36
37
38
all: carbonapi
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
EXTRA_PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig
endif
VERSION ?= $(shell git describe --abbrev=4 --dirty --always --tags)
GO ?= go
carbonapi:
PKG_CONFIG_PATH="$(EXTRA_PKG_CONFIG_PATH)" $(GO) build -v -tags cairo -ldflags '-X main.BuildVersion=$(VERSION)'
nocairo:
$(GO) build -ldflags '-X main.BuildVersion=$(VERSION)'
test:
$(GO) test -race
$(GO) vet
dep:
@which dep 2>/dev/null || $(GO) get github.com/golang/dep/cmd/dep
dep ensure
depupd:
@which dep 2>/dev/null || $(GO) get github.com/golang/dep/cmd/dep
dep ensure -update
install:
mkdir -p $(DESTDIR)/usr/bin/
mkdir -p $(DESTDIR)/usr/share/carbonapi/
cp ./carbonapi $(DESTDIR)/usr/bin/
cp ./carbonapi.example.yaml $(DESTDIR)/usr/share/carbonapi/
clean:
rm -f carbonapi
rm -f *.deb
rm -f *.rpm