]> git.lizzy.rs Git - rust.git/blobdiff - mk/ctags.mk
Rollup merge of #38299 - achanda:ctrl-c, r=brson
[rust.git] / mk / ctags.mk
index c7a3406a9e746e2f9329c479f4fed02904b95980..1fcb0bb4debbce6109f33d171084fadfc6704c2f 100644 (file)
 
 .PHONY: TAGS.emacs TAGS.vi
 
-# This is using a blacklist approach, probably more durable than a whitelist.
-# We exclude: external dependencies (llvm, rt/{msvc,vg}),
-# tests (compiletest, test) and a couple of other things (rt/arch, etc)
-CTAGS_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/llvm,, \
-                               $(patsubst ${CFG_SRC_DIR}src/compiletest,, \
-                               $(patsubst ${CFG_SRC_DIR}src/test,, \
-                               $(patsubst ${CFG_SRC_DIR}src/etc,, \
-                               $(patsubst ${CFG_SRC_DIR}src/rt,, \
-                               $(patsubst ${CFG_SRC_DIR}src/rt/arch,, \
-                               $(patsubst ${CFG_SRC_DIR}src/rt/msvc,, \
-                               $(patsubst ${CFG_SRC_DIR}src/rt/vg,, \
-                               $(wildcard ${CFG_SRC_DIR}src/*) $(wildcard ${CFG_SRC_DIR}src/rt/*) \
-                               ))))))))
-CTAGS_OPTS=--options="${CFG_SRC_DIR}src/etc/ctags.rust" --languages=-javascript --recurse ${CTAGS_LOCATIONS}
-# We could use `--languages=Rust`, but there is value in producing tags for the
-# C++ parts of the code base too (at the time of writing, those are .h and .cpp
-# files in src/rt, src/rt/sync and src/rustllvm); we mainly just want to
-# exclude the external dependencies.
+CTAGS_RUSTC_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/lib%test,, \
+                               $(wildcard ${CFG_SRC_DIR}src/lib*)) ${CFG_SRC_DIR}src/libtest
+CTAGS_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/librust%,, \
+                $(patsubst ${CFG_SRC_DIR}src/lib%test,, \
+                               $(wildcard ${CFG_SRC_DIR}src/lib*))) ${CFG_SRC_DIR}src/libtest
+CTAGS_OPTS=--options="${CFG_SRC_DIR}src/etc/ctags.rust" --languages=Rust --recurse
+
+TAGS.rustc.emacs:
+       ctags -e -f $@ ${CTAGS_OPTS} ${CTAGS_RUSTC_LOCATIONS}
 
 TAGS.emacs:
-       ctags -e -f $@ ${CTAGS_OPTS}
+       ctags -e -f $@ ${CTAGS_OPTS} ${CTAGS_LOCATIONS}
+
+TAGS.rustc.vi:
+       ctags -f $@ ${CTAGS_OPTS} ${CTAGS_RUSTC_LOCATIONS}
 
 TAGS.vi:
-       ctags -f $@ ${CTAGS_OPTS}
+       ctags -f $@ ${CTAGS_OPTS} ${CTAGS_LOCATIONS}