Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 04C3E431FBC for ; Wed, 18 Nov 2009 03:36:40 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EK1EJVf3FXp4 for ; Wed, 18 Nov 2009 03:36:39 -0800 (PST) Received: from orsmga101.jf.intel.com (mga06.intel.com [134.134.136.21]) by olra.theworths.org (Postfix) with ESMTP id 3EC64431FAE for ; Wed, 18 Nov 2009 03:36:39 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 18 Nov 2009 03:22:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.44,764,1249282800"; d="scan'208";a="570709306" Received: from unknown (HELO localhost.localdomain) ([10.255.16.119]) by orsmga001.jf.intel.com with ESMTP; 18 Nov 2009 03:36:28 -0800 From: Chris Wilson To: notmuch@notmuchmail.org Date: Wed, 18 Nov 2009 11:34:54 +0000 Message-Id: <1258544095-16616-1-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 1.6.5.2 Subject: [notmuch] [PATCH 1/2] Makefile: evaluate pkg-config once X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Nov 2009 11:36:40 -0000 Currently the same `pkg-config ...` is executed for every target, so just store the results in a variable. --- Makefile | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 96aaa73..023b2ec 100644 --- a/Makefile +++ b/Makefile @@ -4,15 +4,16 @@ CFLAGS=-O2 # Additional flags that we will append to whatever the user set. # These aren't intended for the user to manipulate. -extra_cflags = `pkg-config --cflags glib-2.0 gmime-2.4 talloc` -extra_cxxflags = `xapian-config --cxxflags` +extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc) +extra_cxxflags := $(shell xapian-config --cxxflags) # Now smash together user's values with our extra values override CFLAGS += $(WARN_FLAGS) $(extra_cflags) override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags) -override LDFLAGS += `pkg-config --libs glib-2.0 gmime-2.4 talloc` \ - `xapian-config --libs` +override LDFLAGS += \ + $(shell pkg-config --libs glib-2.0 gmime-2.4 talloc) \ + $(shell xapian-config --libs) # Include our local Makefile.local first so that its first target is default include Makefile.local -- 1.6.5.2