X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=bindings%2Fgo%2FMakefile;h=1b9e7505872129452e395fc2ab7f0a58aa4e784c;hp=aba2d5952b7840894ed1401c3854db767293ec04;hb=8a433aad9901f014e36f1b5cf36e2a6ac9cb466b;hpb=c234f8f972c13d1725da3152b114311350fea541 diff --git a/bindings/go/Makefile b/bindings/go/Makefile index aba2d595..1b9e7505 100644 --- a/bindings/go/Makefile +++ b/bindings/go/Makefile @@ -1,30 +1,40 @@ -# Copyright 2009 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -include ${GOROOT}/src/Make.inc - -all: install - -DIRS=\ - pkg\ - cmds\ - - -clean.dirs: $(addsuffix .clean, $(DIRS)) -install.dirs: $(addsuffix .install, $(DIRS)) -nuke.dirs: $(addsuffix .nuke, $(DIRS)) -test.dirs: $(addsuffix .test, $(TEST)) -bench.dirs: $(addsuffix .bench, $(BENCH)) - -%.clean: - +cd $* && $(QUOTED_GOBIN)/gomake clean - -%.install: - +cd $* && $(QUOTED_GOBIN)/gomake install - -clean: clean.dirs - -install: install.dirs - -#-include ${GOROOT}/src/Make.deps +# Makefile for the go bindings of notmuch + +export GOPATH ?= $(shell pwd) +export CGO_CFLAGS ?= -I../../../../lib +export CGO_LDFLAGS ?= -L../../../../lib + +GO ?= go +GOFMT ?= gofmt + +all: notmuch notmuch-addrlookup + +.PHONY: notmuch +notmuch: + $(GO) install notmuch + +.PHONY: goconfig +goconfig: + if [ ! -d github.com/msbranco/goconfig ]; then \ + $(GO) get github.com/msbranco/goconfig; \ + fi + +.PHONY: notmuch-addrlookup +notmuch-addrlookup: notmuch goconfig + $(GO) install notmuch-addrlookup + +.PHONY: format +format: + $(GOFMT) -w=true $(GOFMT_OPTS) src/notmuch + $(GOFMT) -w=true $(GOFMT_OPTS) src/notmuch-addrlookup + +.PHONY: check-format +check-format: + $(GOFMT) -d=true $(GOFMT_OPTS) src/notmuch + $(GOFMT) -d=true $(GOFMT_OPTS) src/notmuch-addrlookup + +.PHONY: clean +clean: + $(GO) clean notmuch + $(GO) clean notmuch-addrlookup + rm -rf pkg bin