#!/usr/bin/make -f 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 xargs -n50 ctags -a < cscope.files cscope.files: find . ${FIND_FILTER} -name '*.[ch]' > cscope.files