]> git.lizzy.rs Git - rust.git/blob - mk/ctags.mk
auto merge of #17009 : kballard/rust/install_no_sudo, r=pnkfelix
[rust.git] / mk / ctags.mk
1 # Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 # file at the top-level directory of this distribution and at
3 # http://rust-lang.org/COPYRIGHT.
4 #
5 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 # option. This file may not be copied, modified, or distributed
9 # except according to those terms.
10
11 ######################################################################
12 # TAGS file creation.  No dependency tracking, just do it on demand.
13 # Requires Exuberant Ctags: http://ctags.sourceforge.net/index.html
14 ######################################################################
15
16 .PHONY: TAGS.emacs TAGS.vi
17
18 # This is using a blacklist approach, probably more durable than a whitelist.
19 # We exclude: external dependencies (llvm, rt/{msvc,sundown,vg}),
20 # tests (compiletest, test) and a couple of other things (rt/arch, etc)
21 CTAGS_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/llvm,, \
22                                 $(patsubst ${CFG_SRC_DIR}src/compiletest,, \
23                                 $(patsubst ${CFG_SRC_DIR}src/test,, \
24                                 $(patsubst ${CFG_SRC_DIR}src/etc,, \
25                                 $(patsubst ${CFG_SRC_DIR}src/rt,, \
26                                 $(patsubst ${CFG_SRC_DIR}src/rt/arch,, \
27                                 $(patsubst ${CFG_SRC_DIR}src/rt/msvc,, \
28                                 $(patsubst ${CFG_SRC_DIR}src/rt/sundown,, \
29                                 $(patsubst ${CFG_SRC_DIR}src/rt/vg,, \
30                                 $(wildcard ${CFG_SRC_DIR}src/*) $(wildcard ${CFG_SRC_DIR}src/rt/*) \
31                                 )))))))))
32 CTAGS_OPTS=--options="${CFG_SRC_DIR}src/etc/ctags.rust" --languages=-javascript --recurse ${CTAGS_LOCATIONS}
33 # We could use `--languages=Rust`, but there is value in producing tags for the
34 # C++ parts of the code base too (at the time of writing, those are .h and .cpp
35 # files in src/rt, src/rt/sync and src/rustllvm); we mainly just want to
36 # exclude the external dependencies.
37
38 TAGS.emacs:
39         ctags -e -f $@ ${CTAGS_OPTS}
40
41 TAGS.vi:
42         ctags -f $@ ${CTAGS_OPTS}