From c0cb2500f645b3fe00b6d5bb96c1f36134ea37a6 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sat, 24 Apr 2004 10:45:42 +0000 Subject: [PATCH] * lib/am/tags.am (TAGS): Pass `.' to Exuberant Ctags if --etags-include is used but no other files are supplied, so it creates the TAGS file anyway. Report from Akim Demaille. --- ChangeLog | 5 +++++ Makefile.in | 2 +- lib/Automake/Makefile.in | 2 +- lib/Makefile.in | 2 +- lib/am/tags.am | 17 ++++++++++++----- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61c52995a..b8e7815ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2004-04-24 Alexandre Duret-Lutz + * lib/am/tags.am (TAGS): Pass `.' to Exuberant Ctags if + --etags-include is used but no other files are supplied, so it + creates the TAGS file anyway. + Report from Akim Demaille. + * lib/depcomp (tru64) [libtool]: Nicolas Joly reported on 2002-06-12 that dependencies were output in $dir.libs/$base.lo.d. Teun Burgers reported on 2004-03-30 they were in diff --git a/Makefile.in b/Makefile.in index 5fb2c9ed5..46ea90991 100644 --- a/Makefile.in +++ b/Makefile.in @@ -302,7 +302,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ else \ include_option=--include; \ diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index 4b9abe978..8f69874ca 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -316,7 +316,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ else \ include_option=--include; \ diff --git a/lib/Makefile.in b/lib/Makefile.in index b11bd931a..516eb861f 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -292,7 +292,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ else \ include_option=--include; \ diff --git a/lib/am/tags.am b/lib/am/tags.am index 723e9c341..fabb8ad12 100644 --- a/lib/am/tags.am +++ b/lib/am/tags.am @@ -1,5 +1,5 @@ ## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003 +## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 ## Free Software Foundation, Inc. ## This program is free software; you can redistribute it and/or modify @@ -49,10 +49,15 @@ TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \ ## backslash will cause bad results (automake doesn't `see' the `if'). ## Exuberant Ctags wants --etags-include, ## GNU Etags --include -?SUBDIRS? if (etags --etags-include --version) >/dev/null 2>&1; then \ +## Furthermore Exuberant Ctags 5.5.4 fails to create TAGS files +## when no files are supplied, despite any --etags-include option. +## A workaround is to pass `.' as a file. This is what $empty_fix is for. +?SUBDIRS? if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ ?SUBDIRS? include_option=--etags-include; \ +?SUBDIRS? empty_fix=.; \ ?SUBDIRS? else \ ?SUBDIRS? include_option=--include; \ +?SUBDIRS? empty_fix=; \ ?SUBDIRS? fi; \ ?SUBDIRS? list='$(SUBDIRS)'; for subdir in $$list; do \ ## Do nothing if we're trying to look in `.'. @@ -71,9 +76,11 @@ TAGS: %TAGSDIRS% $(HEADERS) $(SOURCES) %CONFIG% $(TAGS_DEPENDENCIES) \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ ## Make sure we have something to run etags on. - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -z "$$unique" && unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ## ------------- ## -- 2.11.4.GIT