summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 703f05a)
raw | patch | inline | side by side (parent: 703f05a)
author | Junio C Hamano <gitster@pobox.com> | |
Tue, 18 Oct 2011 07:26:18 +0000 (00:26 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 18 Oct 2011 17:03:00 +0000 (10:03 -0700) |
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>
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>
Makefile | patch | blob | history |
diff --git a/Makefile b/Makefile
index 8d6d4515d2d635ff8b5e59e0ce38ffa566f5bb64..badfb77f409a8e86202f5c1213648da6012977d4 100644 (file)
--- a/Makefile
+++ b/Makefile
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)):\