1999-08-28 01:08:13 +00:00
|
|
|
# $FreeBSD$
|
1994-05-28 04:10:32 +00:00
|
|
|
|
2005-03-05 00:56:15 +00:00
|
|
|
# Directories to include in cscope name file and TAGS.
|
2017-11-14 23:02:19 +00:00
|
|
|
CSCOPEDIRS= bsm cam cddl compat conf contrib crypto ddb dev fs gdb \
|
2014-03-14 06:29:43 +00:00
|
|
|
geom gnu isa kern libkern modules net net80211 \
|
2017-05-01 05:54:33 +00:00
|
|
|
netgraph netinet netinet6 netipsec netpfil \
|
2012-03-20 18:05:15 +00:00
|
|
|
netsmb nfs nfsclient nfsserver nlm ofed opencrypto \
|
2014-09-23 06:32:19 +00:00
|
|
|
rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR}
|
2012-01-03 17:31:27 +00:00
|
|
|
.if !defined(CSCOPE_ARCHDIR)
|
2008-07-10 16:03:24 +00:00
|
|
|
.if defined(ALL_ARCH)
|
2020-02-03 17:35:11 +00:00
|
|
|
CSCOPE_ARCHDIR = amd64 arm arm64 i386 mips powerpc riscv x86
|
2008-07-10 16:03:24 +00:00
|
|
|
.else
|
2015-05-29 14:03:07 +00:00
|
|
|
CSCOPE_ARCHDIR = ${MACHINE}
|
2012-01-03 17:31:27 +00:00
|
|
|
.if ${MACHINE} != ${MACHINE_CPUARCH}
|
|
|
|
CSCOPE_ARCHDIR += ${MACHINE_CPUARCH}
|
|
|
|
.endif
|
|
|
|
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
|
|
|
|
CSCOPE_ARCHDIR += x86
|
|
|
|
.endif
|
|
|
|
.endif
|
2008-07-10 16:03:24 +00:00
|
|
|
.endif
|
2005-03-05 00:56:15 +00:00
|
|
|
|
1997-07-13 07:36:20 +00:00
|
|
|
HTAGSFLAGS+= -at `awk -F= '/^RELEASE *=/{release=$2}; END {print "FreeBSD", release, "kernel"}' < conf/newvers.sh`
|
|
|
|
|
2007-07-05 08:55:14 +00:00
|
|
|
# You need the devel/cscope port for this.
|
2008-05-21 07:56:10 +00:00
|
|
|
cscope: cscope.out
|
|
|
|
cscope.out: ${.CURDIR}/cscope.files
|
2012-12-02 20:51:24 +00:00
|
|
|
cd ${.CURDIR}; cscope -k -buq -p4 -v
|
2005-03-05 00:56:15 +00:00
|
|
|
|
2008-05-21 07:56:10 +00:00
|
|
|
${.CURDIR}/cscope.files: .PHONY
|
|
|
|
cd ${.CURDIR}; \
|
2010-11-21 03:58:11 +00:00
|
|
|
find ${CSCOPEDIRS} -name "*.[chSsly]" -a -type f > ${.TARGET}
|
2008-05-21 07:56:10 +00:00
|
|
|
|
|
|
|
cscope-clean:
|
2017-05-01 05:59:52 +00:00
|
|
|
cd ${.CURDIR}; \
|
|
|
|
rm -f cscope.files cscope.out cscope.in.out cscope.po.out
|
2005-03-05 00:56:15 +00:00
|
|
|
|
2014-05-15 03:47:52 +00:00
|
|
|
#
|
|
|
|
# Installs SCM hooks to update the cscope database every time the source tree
|
|
|
|
# is updated.
|
|
|
|
# cscope understands incremental updates, so it's considerably faster when only
|
|
|
|
# a few files have changed.
|
|
|
|
#
|
|
|
|
HG_DIR=${.CURDIR}/../.hg
|
|
|
|
HG_HOOK=if [ \$$HG_ERROR -eq 0 ]; then cd sys && make -m ../share/mk cscope; fi
|
|
|
|
cscope-hook:
|
|
|
|
@if [ -d ${HG_DIR} ]; then \
|
|
|
|
if [ "`grep hooks ${HG_DIR}/hgrc`" = "" ]; then \
|
|
|
|
echo "[hooks]" >> ${HG_DIR}/hgrc; \
|
|
|
|
echo "update = ${HG_HOOK}" >> ${HG_DIR}/hgrc; \
|
|
|
|
echo "Hook installed in ${HG_DIR}/hgrc"; \
|
|
|
|
else \
|
|
|
|
echo "Mercurial update hook already exists."; \
|
|
|
|
fi; \
|
|
|
|
fi
|
|
|
|
|
2007-07-05 08:55:14 +00:00
|
|
|
# You need the devel/global and one of editor/emacs* ports for that.
|
2008-05-21 07:56:10 +00:00
|
|
|
TAGS ${.CURDIR}/TAGS: ${.CURDIR}/cscope.files
|
2005-03-05 00:56:15 +00:00
|
|
|
rm -f ${.CURDIR}/TAGS
|
2008-05-21 07:56:10 +00:00
|
|
|
cd ${.CURDIR}; xargs etags -a < ${.CURDIR}/cscope.files
|
2005-03-05 00:56:15 +00:00
|
|
|
|
2017-05-22 15:53:30 +00:00
|
|
|
.if !(make(cscope) || make(cscope-clean) || make(cscope-hook) || make(TAGS))
|
2014-05-29 16:03:08 +00:00
|
|
|
.include <src.opts.mk>
|
|
|
|
|
|
|
|
# Loadable kernel modules
|
|
|
|
|
|
|
|
.if defined(MODULES_WITH_WORLD)
|
|
|
|
SUBDIR+=modules
|
|
|
|
.endif
|
|
|
|
|
1994-05-28 04:10:32 +00:00
|
|
|
.include <bsd.subdir.mk>
|
2014-05-29 16:03:08 +00:00
|
|
|
.endif
|