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 7FED66DE0164 for ; Wed, 23 Aug 2017 22:52:07 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.034 X-Spam-Level: X-Spam-Status: No, score=0.034 tagged_above=-999 required=5 tests=[AWL=0.054, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] 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 Kmy5FUODVpzY for ; Wed, 23 Aug 2017 22:52:05 -0700 (PDT) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by arlo.cworth.org (Postfix) with ESMTPS id 6DC8A6DE00E6 for ; Wed, 23 Aug 2017 22:52:05 -0700 (PDT) Received: by mail-lf0-f68.google.com with SMTP id v79so953256lfa.1 for ; Wed, 23 Aug 2017 22:52:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nikula-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=4AvnjaGb1OS+cBMB5EJm6mH3lNvYg38OcVmnT2u9dt8=; b=RyJ7UsiF9accFMPfcaAtdVUIVUiPMVqBKIeleT1JwZKonucBxAflIvpfjRhIVVU5w9 aJUDq1YNOclBC6ZPi8jly8sdz5hVjXHYxAqtZXiLIXyFHuptEvExcGlfr1RplJWaTqC3 kvqyXnvBSp2++gJA0ESHELWp+FhJCxO7AuqrvJxQxrNzuBzMMgQuw1IHaOFdRQkQOrsc X1BEaj+pONiUgv6N6hLf1cV0eg0gS3067sd6Ug86JO9horYaE3oGYIU/IARntkNiDF13 0JwZRZnL/YzYGVx43S4uJiF16F7aum0G9Y7p7bWe1gY0xEx3TigL/Qbru1o3MNvG86XL 1OdA== 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:in-reply-to:references:date :message-id:mime-version; bh=4AvnjaGb1OS+cBMB5EJm6mH3lNvYg38OcVmnT2u9dt8=; b=NaBtX+OylvHO4rwZ18qjFCUgAf6fruXRZyCGIMTgZ8ySNqDLSypIYksWgAIYXqAm8S GtMAiIiEcfP5I4Ul98By63yXNr6HbZQFyibXtrTJoTKTIsF08sBAYDU+0AfTNYkJGgsz zL3bVC1idrg+9ABAUNbjJ1EJ8BCiX1rO9cMrwR8TOuWbTzYxo+z2tpRePPxxsyxj3yp7 b4M++CbF11M8RV/XofkI0lySDW8GK/t1usz5R0rXLAMiSKbDEWc2Df/JUfIEwOONSeA6 XuaNeI5IkjVRuS2mRudIxtnpDrbdtCAG7jA/LPHY91QnT65dIpzhjeDoPEEhag7p31uN rpxQ== X-Gm-Message-State: AHYfb5i+lqhbwMAIB4E6vK9HUhGVJ4gUe8OXDT44f65Bs1eLHFtTmEAV r0tPXTj/5WS3bKWx X-Received: by 10.46.64.221 with SMTP id r90mr2448786lje.17.1503553920632; Wed, 23 Aug 2017 22:52:00 -0700 (PDT) Received: from localhost (mobile-access-5d6aa6-119.dhcp.inet.fi. [93.106.166.119]) by smtp.gmail.com with ESMTPSA id y30sm486573ljd.91.2017.08.23.22.51.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2017 22:51:59 -0700 (PDT) From: Jani Nikula To: Yuri Volchkov , notmuch@notmuchmail.org Subject: Re: [PATCH] build: generate cscope and etags source indexes In-Reply-To: <1503521740-32330-1-git-send-email-yuri.volchkov@gmail.com> References: <1503521740-32330-1-git-send-email-yuri.volchkov@gmail.com> Date: Thu, 24 Aug 2017 08:51:58 +0300 Message-ID: <87d17lqzr5.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain 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: Thu, 24 Aug 2017 05:52:07 -0000 On Wed, 23 Aug 2017, Yuri Volchkov wrote: > 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 What's the point in adding these to configure? Or, to be honest, to the build at all? In theory you'll be able to look at $(SRCS) for indexing... but those are only the .c/.cc files. Are your tools clever enough to follow #include directives to index the headers as well? I guess I'm also biased because I use gnu global [1] instead. And for that I have a script of my own that basically boils down to: $ git ls-files | gtags -f - which means all files tracked by git get indexed, and global will decide whether it can index the file or not. BR, Jani. [1] https://www.gnu.org/software/global/ > > 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 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch