]> git.notmuchmail.org Git - notmuch/blob - contrib/go/Makefile
bindings: move go bindings to contrib
[notmuch] / contrib / go / Makefile
1 # Makefile for the go bindings of notmuch
2
3 export GOPATH      ?= $(shell pwd)
4 export CGO_CFLAGS  ?= -I../../../../lib
5 export CGO_LDFLAGS ?= -L../../../../lib
6
7 GO         ?= go
8 GOFMT      ?= gofmt
9
10 all: notmuch notmuch-addrlookup
11
12 .PHONY: notmuch
13 notmuch:
14         $(GO) install notmuch
15
16 .PHONY: goconfig
17 goconfig:
18         if [ ! -d github.com/msbranco/goconfig ]; then \
19             $(GO) get github.com/msbranco/goconfig; \
20         fi
21
22 .PHONY: notmuch-addrlookup
23 notmuch-addrlookup: notmuch goconfig
24         $(GO) install notmuch-addrlookup
25
26 .PHONY: format
27 format:
28         $(GOFMT) -w=true $(GOFMT_OPTS) src/notmuch
29         $(GOFMT) -w=true $(GOFMT_OPTS) src/notmuch-addrlookup
30
31 .PHONY: check-format
32 check-format:
33         $(GOFMT) -d=true $(GOFMT_OPTS) src/notmuch
34         $(GOFMT) -d=true $(GOFMT_OPTS) src/notmuch-addrlookup
35
36 .PHONY: clean
37 clean:
38         $(GO) clean notmuch
39         $(GO) clean notmuch-addrlookup
40         rm -rf pkg bin