]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* lib/am/tags.am (TAGS): Pass `.' to Exuberant Ctags if
authorAlexandre Duret-Lutz <adl@gnu.org>
Sat, 24 Apr 2004 10:45:42 +0000 (10:45 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Sat, 24 Apr 2004 10:45:42 +0000 (10:45 +0000)
--etags-include is used but no other files are supplied, so it
creates the TAGS file anyway.
Report from Akim Demaille.

ChangeLog
Makefile.in
lib/Automake/Makefile.in
lib/Makefile.in
lib/am/tags.am

index 61c52995a116ebd117e4f172993d278a5921a841..b8e7815ed690afe1abdf36203faec4cf973fef46 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2004-04-24  Alexandre Duret-Lutz  <adl@gnu.org>
 
+       * 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
index 5fb2c9ed5d04ad52afd2a505af2cbef2813a7131..46ea90991af1a600370ac82dc0b2ac29f91af9cb 100644 (file)
@@ -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; \
index 4b9abe978f4adb617ffa18c8ac73c53461b20768..8f69874cab0d86f82322286b9fb1928efa6bcde9 100644 (file)
@@ -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; \
index b11bd931af9e14306f878b86bc9073603cb0ffbb..516eb861fe193747c4a37e24bc3ea5811e6c05dc 100644 (file)
@@ -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; \
index 723e9c341ac423db31637e8ccfe49cc452e62c04..fabb8ad12c9fc4716a34a4b21930a4c46be05fdd 100644 (file)
@@ -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
 
 
 ## ------------- ##