Skip to content

Instantly share code, notes, and snippets.

@bartman
Last active August 29, 2015 14:27
Show Gist options
  • Save bartman/0f2fe8232eec175322c4 to your computer and use it in GitHub Desktop.
Save bartman/0f2fe8232eec175322c4 to your computer and use it in GitHub Desktop.
mktags
#!/usr/bin/make -f
DIRS = .
IGNORE_DIRS = .svn BitKeeper CVS SCCS .hg .git
EXISTING_IGNORE_DIRS = $(wildcard ${IGNORE_DIRS})
FIND_FILTER = $(shell for d in ${EXISTING_IGNORE_DIRS} ; do echo ! -path "\"*/$$d/*\"" -a ; done)
.PHONY: all cscope cscope.files cscope.out tags
all: cscope tags
cscope: cscope.out
cscope.out: cscope.files
cscope -b
tags: cscope.files
@rm -f tags
ctags -L cscope.files
ABS_DIRS = $(foreach d,${DIRS},$(shell cd ${d} && pwd))
cscope.files:
find ${ABS_DIRS} ${FIND_FILTER} -name '*.[ch]' -o -name '*.cc' > cscope.files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment