unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Justus Winter <4winter@informatik.uni-hamburg.de>
To: notmuch@notmuchmail.org
Subject: [PATCH 4/5] go: update the build system
Date: Wed,  9 May 2012 13:15:19 +0200	[thread overview]
Message-ID: <1336562120-13837-5-git-send-email-4winter@informatik.uni-hamburg.de> (raw)
In-Reply-To: <1336562120-13837-1-git-send-email-4winter@informatik.uni-hamburg.de>

The new "go" utility does not require any Makefiles to compile go
packages and programs. Remove the old Makefiles and replace the top
level Makefile with one defining some convenience targets for
compiling the notmuch bindings and the notmuch-addrlookup utility.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
---
 bindings/go/Makefile      |   70 ++++++++++++++++++++++++++-------------------
 bindings/go/cmds/Makefile |   11 -------
 bindings/go/pkg/Makefile  |   17 -----------
 3 files changed, 40 insertions(+), 58 deletions(-)
 delete mode 100644 bindings/go/cmds/Makefile
 delete mode 100644 bindings/go/pkg/Makefile

diff --git a/bindings/go/Makefile b/bindings/go/Makefile
index aba2d59..c38f234 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 src/github.com/kless/goconfig/config ]; then \
+	    $(GO) get github.com/kless/goconfig/config; \
+	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
diff --git a/bindings/go/cmds/Makefile b/bindings/go/cmds/Makefile
deleted file mode 100644
index afbc6d2..0000000
--- a/bindings/go/cmds/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# 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
-
-TARG=notmuch-addrlookup
-GOFILES=\
-	notmuch-addrlookup.go
-
-include ${GOROOT}/src/Make.cmd
diff --git a/bindings/go/pkg/Makefile b/bindings/go/pkg/Makefile
deleted file mode 100644
index de89dbc..0000000
--- a/bindings/go/pkg/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# 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
-
-TARG=notmuch
-CGOFILES=notmuch.go
-CGO_LDFLAGS=-lnotmuch
-
-CLEANFILES+=notmuch_test
-
-include $(GOROOT)/src/Make.pkg
-
-%: install %.go
-	$(GC) $*.go
-	$(LD) -o $@ $*.$O
-- 
1.7.10

  parent reply	other threads:[~2012-05-09 11:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-28 21:45 [PATCH] go: Update to the current notmuch_database_find_message API Austin Clements
2012-04-30 11:53 ` David Bremner
2012-04-30 19:54   ` Justus Winter
2012-04-30 19:55     ` [PATCH 1/5] go: reorganize the go bindings Justus Winter
2012-04-30 19:55       ` [PATCH 2/5] go: set LDFLAGS, fix include directive Justus Winter
2012-04-30 19:55       ` [PATCH 3/5] go: update the addrlookup utility to go 1 Justus Winter
2012-04-30 19:55       ` [PATCH 4/5] go: update the build system Justus Winter
2012-04-30 19:55       ` [PATCH 5/5] go: format the souce code using gofmt Justus Winter
2012-05-04 18:38       ` [PATCH 1/5] go: reorganize the go bindings Austin Clements
2012-05-04 18:43         ` Austin Clements
2012-05-05 11:15           ` Justus Winter
2012-05-09 11:15             ` [patch v2] update the go stuff to go 1 Justus Winter
2012-05-09 11:15               ` [PATCH 1/5] go: reorganize the go bindings Justus Winter
2012-05-09 11:15               ` [PATCH 2/5] go: set LDFLAGS to -lnotmuch in the packages source file Justus Winter
2012-05-09 11:15               ` [PATCH 3/5] go: update the addrlookup utility to go 1 Justus Winter
2012-05-09 11:15               ` Justus Winter [this message]
2012-05-09 11:15               ` [PATCH 5/5] go: format the souce code using gofmt Justus Winter
2012-05-09 18:10               ` [patch v2] update the go stuff to go 1 Austin Clements
2012-05-11 11:48               ` David Bremner
2012-04-30 20:14     ` [PATCH] go: Update to the current notmuch_database_find_message API Sebastien Binet
2012-05-04 11:56 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1336562120-13837-5-git-send-email-4winter@informatik.uni-hamburg.de \
    --to=4winter@informatik.uni-hamburg.de \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).