diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-10-18 00:26:18 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-18 10:03:00 -0700 |
commit | 335339758c48ed17c8eb34437269e821824f577b (patch) | |
tree | 2c0598561c86dfdabb9cfd295e1be762ec7f625c /Makefile | |
parent | 703f05ad5835cff92b12c29aecf8d724c8c847e2 (diff) | |
download | git-335339758c48ed17c8eb34437269e821824f577b.tar.gz |
Makefile: ask "ls-files" to list source files if availablejc/make-tags
The [ce]tags and cscope targets used to run "find" looking for any paths
that match '*.[chS]' to feed the list of source files to downstream xargs.
Use "git ls-files" if it is already available to us, and otherwise use a
tighter "find" expression that does not list directories and does not go
into our .git directory.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -2115,17 +2115,21 @@ po/git.pot: $(LOCALIZED_C) pot: po/git.pot +FIND_SOURCE_FILES = ( git ls-files '*.[hcS]' 2>/dev/null || \ + $(FIND) . \( -name .git -type d -prune \) \ + -o \( -name '*.[hcS]' -type f -print \) ) + $(ETAGS_TARGET): FORCE $(RM) $(ETAGS_TARGET) - $(FIND) . -name '*.[hcS]' -print | xargs etags -a -o $(ETAGS_TARGET) + $(FIND_SOURCE_FILES) | xargs etags -a -o $(ETAGS_TARGET) tags: FORCE $(RM) tags - $(FIND) . -name '*.[hcS]' -print | xargs ctags -a + $(FIND_SOURCE_FILES) | xargs ctags -a cscope: $(RM) cscope* - $(FIND) . -name '*.[hcS]' -print | xargs cscope -b + $(FIND_SOURCE_FILES) | xargs cscope -b ### Detect prefix changes TRACK_CFLAGS = $(CC):$(subst ','\'',$(ALL_CFLAGS)):\ |