Skip to content

Commit a2a9150

Browse files
Kristof Provostspearce
authored andcommitted
makefile: Add a cscope target
The current makefile supports ctags but not cscope. Some people prefer cscope (I do), so this patch adds a cscope target. I've also added cscope* to the .gitignore file. For some reason tags and TAGS weren't in there either so I've added them too. Signed-off-by: Kristof Provost <Kristof@provost-engineering.be> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
1 parent 729f504 commit a2a9150

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,6 @@ config.status
171171
config.mak.autogen
172172
config.mak.append
173173
configure
174+
tags
175+
TAGS
176+
cscope*

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,10 @@ tags:
947947
$(RM) tags
948948
$(FIND) . -name '*.[hcS]' -print | xargs ctags -a
949949

950+
cscope:
951+
$(RM) cscope*
952+
$(FIND) . -name '*.[hcS]' -print | xargs cscope -b
953+
950954
### Detect prefix changes
951955
TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\
952956
$(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
@@ -1093,7 +1097,7 @@ clean:
10931097
$(LIB_FILE) $(XDIFF_LIB)
10941098
$(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X
10951099
$(RM) $(TEST_PROGRAMS)
1096-
$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags
1100+
$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
10971101
$(RM) -r autom4te.cache
10981102
$(RM) configure config.log config.mak.autogen config.mak.append config.status config.cache
10991103
$(RM) -r $(GIT_TARNAME) .doc-tmp-dir
@@ -1111,7 +1115,7 @@ endif
11111115
$(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS
11121116

11131117
.PHONY: all install clean strip
1114-
.PHONY: .FORCE-GIT-VERSION-FILE TAGS tags .FORCE-GIT-CFLAGS
1118+
.PHONY: .FORCE-GIT-VERSION-FILE TAGS tags cscope .FORCE-GIT-CFLAGS
11151119

11161120
### Check documentation
11171121
#

0 commit comments

Comments
 (0)