forked from go-graphite/carbonapi
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
53 lines (40 loc) · 1.86 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
all: carbonapi mockbackend
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
PKG_CARBONAPI=github.com/go-graphite/carbonapi/cmd/carbonapi
PKG_MOCKBACKEND=github.com/go-graphite/carbonapi/cmd/mockbackend
PKG_CARBONZIPPER=github.com/go-graphite/carbonapi/cmd/carbonzipper
carbonapi: $(shell find . -name '*.go' | grep -v 'vendor')
PKG_CONFIG_PATH="$(EXTRA_PKG_CONFIG_PATH)" GO111MODULE=on $(GO) build -mod=vendor -v -tags cairo -ldflags '-X main.BuildVersion=$(VERSION)' $(PKG_CARBONAPI)
mockbackend: $(shell find . -name '*.go' | grep -v 'vendor')
GO111MODULE=on $(GO) build -mod=vendor -v -ldflags '-X main.BuildVersion=$(VERSION)' $(PKG_MOCKBACKEND)
debug:
PKG_CONFIG_PATH="$(EXTRA_PKG_CONFIG_PATH)" GO111MODULE=on $(GO) build -mod=vendor -v -tags cairo -ldflags '-X main.BuildVersion=$(VERSION)' -gcflags=all='-l -N' $(PKG_CARBONAPI)
nocairo:
GO111MODULE=on $(GO) build -mod=vendor -ldflags '-X main.BuildVersion=$(VERSION)' $(PKG_CARBONAPI)
carbonzipper: $(shell find . -name '*.go' | grep -v 'vendor')
GO111MODULE=on $(GO) build -mod=vendor --ldflags '-X main.BuildVersion=$(VERSION)' $(PKG_CARBONZIPPER)
test:
PKG_CONFIG_PATH="$(EXTRA_PKG_CONFIG_PATH)" $(GO) test -mod=vendor -tags cairo ./... -race
test_nocairo:
$(GO) test -mod=vendor ./... -race
vet:
$(GO) vet
install:
mkdir -p $(DESTDIR)/usr/bin/
mkdir -p $(DESTDIR)/usr/share/carbonapi/
cp ./carbonapi $(DESTDIR)/usr/bin/
cp ./cmd/carbonapi/carbonapi.example.yaml $(DESTDIR)/usr/share/carbonapi/
install_carbonzipper:
mkdir -p $(DESTDIR)/usr/bin/
mkdir -p $(DESTDIR)/usr/share/carbonzipper/
cp ./carbonzipper $(DESTDIR)/usr/bin/
cp ./cmd/carbonzipper/example.conf $(DESTDIR)/usr/share/carbonzipper/
clean:
rm -f carbonapi carbonzipper mockbackend
rm -f *.deb
rm -f *.rpm