git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] makefile: Add a cscope target

From
KPKristof Provost <kristof@provost-engineering.be>
Date
Oct 7, 2007, 20:45 UTC
Message-ID
<20071007204543.GC4635@luggage>
In-Reply-To
<20071006142442.GA4635@luggage>

The current makefile supports ctags but not cscope. Some people prefer cscope (I do), so this patch adds a cscope target.

Signed-off-by: Kristof Provost <Kristof@provost-engineering.be>

--- This version of the patch includes the fix for the missing [ Frank spotted, and adds 'cscope*' to the .gitignore list as Alex suggested. While I did that I noticed that 'tags' and 'TAGS' were also missing.

It's also in the (hopefully) right format. Thank to Johannes Schindelin for pointing out my mistakes.

 .gitignore |    3 +++
 Makefile   |    8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/.gitignore b/.gitignore
index e0b91be..62afef2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -171,3 +171,6 @@ config.status
 config.mak.autogen
 config.mak.append
 configure
+tags
+TAGS
+cscope*
diff --git a/Makefile b/Makefile
index 8db4dbe..e2790c8 100644
--- a/Makefile
+++ b/Makefile
@@ -947,6 +947,10 @@ tags:
 	$(RM) tags
 	$(FIND) . -name '*.[hcS]' -print | xargs ctags -a
 
+cscope:
+	$(RM) cscope*
+	$(FIND) . -name '*.[hcS]' -print | xargs cscope -b
+
 ### Detect prefix changes
 TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\
              $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
@@ -1093,7 +1097,7 @@ clean:
 		$(LIB_FILE) $(XDIFF_LIB)
 	$(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X
 	$(RM) $(TEST_PROGRAMS)
-	$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags
+	$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
 	$(RM) -r autom4te.cache
 	$(RM) configure config.log config.mak.autogen config.mak.append config.status config.cache
 	$(RM) -r $(GIT_TARNAME) .doc-tmp-dir
@@ -1111,7 +1115,7 @@ endif
 	$(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS
 
 .PHONY: all install clean strip
-.PHONY: .FORCE-GIT-VERSION-FILE TAGS tags .FORCE-GIT-CFLAGS
+.PHONY: .FORCE-GIT-VERSION-FILE TAGS tags cscope .FORCE-GIT-CFLAGS 
 
 ### Check documentation
 #
-- 
1.5.3.4.207.g1aae
Previous: Kristof ProvostNext: Alex Riesen
Message 4 of 5 in “makefile: Add a cscope target”
  1. makefile: Add a cscope targetKristof Provost, Oct 5, 2007
  2. Frank LichtenheldOct 6, 2007
  3. Kristof ProvostOct 6, 2007
  4. makefile: Add a cscope targetKristof Provost, Oct 7, 2007
  5. Alex RiesenOct 6, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.