From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 93B1F6DE1325 for ; Wed, 23 Aug 2017 13:55:47 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.231 X-Spam-Level: X-Spam-Status: No, score=0.231 tagged_above=-999 required=5 tests=[AWL=0.542, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.211, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YGohFswAUJfj for ; Wed, 23 Aug 2017 13:55:47 -0700 (PDT) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by arlo.cworth.org (Postfix) with ESMTPS id 9671F6DE1324 for ; Wed, 23 Aug 2017 13:55:46 -0700 (PDT) Received: by mail-wr0-f193.google.com with SMTP id n53so397830wrb.2 for ; Wed, 23 Aug 2017 13:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=iJ57pPIKNyXpw9u5A4CIXouDMibHuAdwVlaluNURzYs=; b=N4/xtYtMkTdrv5w/NPRoHvIU2ZYjEd/mKDwC6KLrTxsS1U3YYlA59cyg6wmmsKi//q G1rRM0/XRWNF2HgY5IGVeCcXzyJW9CmanqrYol91pvZ5fUZm+9LmuNDrIPpBTqjHKPah FfLrN79cjEmQd3Upy6uGijCq9rme1C5m0K7914lDukPTvTAzC08Q1omVe44/TbWeJgbY y7tkXafFFHsR/Th5/OuYBLbyt85MniLJp2ig49C/GYiF2O3rk9M/0azaZvq3xKHy2qPy 5Cfx3B0P7aNJSNp+weOOECdp5xNbf1Xo9Zp8cnhy8Hhl5gHe5euqJVc4hDTZoh2jqxfz wPeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=iJ57pPIKNyXpw9u5A4CIXouDMibHuAdwVlaluNURzYs=; b=ZFCFJBXO/8FVZf9YZKKJQQo3N5VUbpG4B9evdOjbsp0I1mumP7rOopB8+6vm6pSg8f OLgGPJXE40UwXNmAN/rEzJ5tVUpqpWWW4mxRLyHZNw9yVNucaVZbsADdb032BNfIDmWU wCQ6nWs3A6bTus00Mi7jc2DAKmyx3QyxjMeG3nAl/4vbjFW7LU3SQZWt/Lx9VGl0B3pA VO6JT/qEVkNXz9kQLS/YIkwNXk46h5e1TQn5vD2lCRg37dxDfjQ3B9SFGqmuAn5C+qmt mxBSeuzwFiw/a1TV0ECQtVr/ec2PHRGwNgL8cUzCqUAAV5YGEHD+cgH+XETtH7n6isrv le/Q== X-Gm-Message-State: AHYfb5gaLcHBGqEYR4h5dRlLl+P8jztE8+6jWua5rTeywn6W2uSyc7bb muqcFYKl9nhw15Czaio= X-Received: by 10.223.150.48 with SMTP id b45mr2458177wra.139.1503521742102; Wed, 23 Aug 2017 13:55:42 -0700 (PDT) Received: from localhost (HSI-KBW-046-005-000-196.hsi8.kabel-badenwuerttemberg.de. [46.5.0.196]) by smtp.gmail.com with ESMTPSA id b186sm3170765wma.24.2017.08.23.13.55.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Aug 2017 13:55:41 -0700 (PDT) From: Yuri Volchkov To: notmuch@notmuchmail.org Subject: [PATCH] build: generate cscope and etags source indexes Date: Wed, 23 Aug 2017 22:55:40 +0200 Message-Id: <1503521740-32330-1-git-send-email-yuri.volchkov@gmail.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 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, 23 Aug 2017 20:55:47 -0000 Just a handy tool to generate source code indexes for your favorite editor. To make tags for vim run: $ make cscope To make tags for emacs: $ make TAGS To make both: $ make alltags Signed-off-by: Yuri Volchkov --- Makefile.local | 24 ++++++++++++++++++++++++ configure | 30 ++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/Makefile.local b/Makefile.local index af12ca7..15075bb 100644 --- a/Makefile.local +++ b/Makefile.local @@ -280,6 +280,30 @@ endif SRCS := $(SRCS) $(notmuch_client_srcs) CLEAN := $(CLEAN) notmuch notmuch-shared $(notmuch_client_modules) CLEAN := $(CLEAN) version.stamp notmuch-*.tar.gz.tmp +CLEAN := $(CLEAN) cscope.out TAGS + +.PHONY: alltags cscope +alltags: cscope.out TAGS +cscope: cscope.out + +ifeq ($(HAVE_CSCOPE),1) +cscope.out: $(SRCS) + $(call quiet, CSCOPE) -b $(SRCS) +else +.PHONY: cscope.out +cscope.out: + $(warning "$@ is not generated. Please make sure you have cscope installed") +endif + +ifeq ($(HAVE_ETAGS),1) +TAGS: $(SRCS) + @rm -f $@ + $(call quiet, ETAGS) -a $(SRCS) +else +.PHONY: TAGS +TAGS: + $(warning "$@ is not generated. Please make sure you have etags installed") +endif DISTCLEAN := $(DISTCLEAN) .first-build-message Makefile.config sh.config diff --git a/configure b/configure index c5e2ffe..4467016 100755 --- a/configure +++ b/configure @@ -603,6 +603,24 @@ else have_emacs=0 fi +printf "Checking if cscope is available... " +if cscope -V > /dev/null 2>&1; then + printf "Yes.\n" + have_cscope=1 +else + printf "No (so will not generate cscope code index - file cscope.out)\n" + have_cscope=0 +fi + +printf "Checking if etags is available... " +if etags -V > /dev/null 2>&1; then + printf "Yes.\n" + have_etags=1 +else + printf "No (so will not generate etags code index - file TAGS)\n" + have_etags=0 +fi + have_doxygen=0 if [ $WITH_API_DOCS = "1" ] ; then printf "Checking if doxygen is available... " @@ -1011,6 +1029,12 @@ WARN_CXXFLAGS=${WARN_CXXFLAGS} # Flags to enable warnings when using the C compiler WARN_CFLAGS=${WARN_CFLAGS} +# Command to execute cscope from Makefiles +CSCOPE = cscope + +# Command to execute etags from Makefiles +ETAGS = etags + # Name of python interpreter PYTHON = ${python} @@ -1046,6 +1070,12 @@ emacsetcdir=${EMACSETCDIR} # Whether there's an emacs binary available for byte-compiling HAVE_EMACS = ${have_emacs} +# Whether there's a cscope available for source code indexing (development only) +HAVE_CSCOPE = ${have_cscope} + +# Whether there's a etags available for source code indexing (development only) +HAVE_ETAGS = ${have_etags} + # Whether there's a sphinx-build binary available for building documentation HAVE_SPHINX=${have_sphinx} -- 2.7.4