Skip to content

Commit 1020fbc

Browse files
committed
Merge branch 'jc/make-tags'
* jc/make-tags: Makefile: ask "ls-files" to list source files if available
2 parents 8d3c0cb + 3353397 commit 1020fbc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,17 +2127,21 @@ po/git.pot: $(LOCALIZED_C)
21272127

21282128
pot: po/git.pot
21292129

2130+
FIND_SOURCE_FILES = ( git ls-files '*.[hcS]' 2>/dev/null || \
2131+
$(FIND) . \( -name .git -type d -prune \) \
2132+
-o \( -name '*.[hcS]' -type f -print \) )
2133+
21302134
$(ETAGS_TARGET): FORCE
21312135
$(RM) $(ETAGS_TARGET)
2132-
$(FIND) . -name '*.[hcS]' -print | xargs etags -a -o $(ETAGS_TARGET)
2136+
$(FIND_SOURCE_FILES) | xargs etags -a -o $(ETAGS_TARGET)
21332137

21342138
tags: FORCE
21352139
$(RM) tags
2136-
$(FIND) . -name '*.[hcS]' -print | xargs ctags -a
2140+
$(FIND_SOURCE_FILES) | xargs ctags -a
21372141

21382142
cscope:
21392143
$(RM) cscope*
2140-
$(FIND) . -name '*.[hcS]' -print | xargs cscope -b
2144+
$(FIND_SOURCE_FILES) | xargs cscope -b
21412145

21422146
### Detect prefix changes
21432147
TRACK_CFLAGS = $(CC):$(subst ','\'',$(ALL_CFLAGS)):\

0 commit comments

Comments
 (0)