3 # Directories to include in cscope name file and TAGS.
4 CSCOPEDIRS= bsm cam cddl compat conf contrib crypto ddb dev fs gdb \
5 geom gnu isa kern libkern modules net net80211 \
6 netgraph netinet netinet6 netipsec netpfil \
7 netsmb nfs nfsclient nfsserver nlm ofed opencrypto \
8 rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR}
9 .if !defined(CSCOPE_ARCHDIR)
11 CSCOPE_ARCHDIR = amd64 arm arm64 i386 mips powerpc riscv sparc64 x86
13 CSCOPE_ARCHDIR = ${MACHINE}
14 .if ${MACHINE} != ${MACHINE_CPUARCH}
15 CSCOPE_ARCHDIR += ${MACHINE_CPUARCH}
17 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
23 HTAGSFLAGS+= -at `awk -F= '/^RELEASE *=/{release=$2}; END {print "FreeBSD", release, "kernel"}' < conf/newvers.sh`
25 # You need the devel/cscope port for this.
27 cscope.out: ${.CURDIR}/cscope.files
28 cd ${.CURDIR}; cscope -k -buq -p4 -v
30 ${.CURDIR}/cscope.files: .PHONY
32 find ${CSCOPEDIRS} -name "*.[chSsly]" -a -type f > ${.TARGET}
36 rm -f cscope.files cscope.out cscope.in.out cscope.po.out
39 # Installs SCM hooks to update the cscope database every time the source tree
41 # cscope understands incremental updates, so it's considerably faster when only
42 # a few files have changed.
44 HG_DIR=${.CURDIR}/../.hg
45 HG_HOOK=if [ \$$HG_ERROR -eq 0 ]; then cd sys && make -m ../share/mk cscope; fi
47 @if [ -d ${HG_DIR} ]; then \
48 if [ "`grep hooks ${HG_DIR}/hgrc`" = "" ]; then \
49 echo "[hooks]" >> ${HG_DIR}/hgrc; \
50 echo "update = ${HG_HOOK}" >> ${HG_DIR}/hgrc; \
51 echo "Hook installed in ${HG_DIR}/hgrc"; \
53 echo "Mercurial update hook already exists."; \
57 # You need the devel/global and one of editor/emacs* ports for that.
58 TAGS ${.CURDIR}/TAGS: ${.CURDIR}/cscope.files
60 cd ${.CURDIR}; xargs etags -a < ${.CURDIR}/cscope.files
62 .if !(make(cscope) || make(cscope-clean) || make(cscope-hook) || make(TAGS))
63 .include <src.opts.mk>
65 # Loadable kernel modules
67 .if defined(MODULES_WITH_WORLD)
71 .include <bsd.subdir.mk>