xref: /freebsd/sys/Makefile (revision 031beb4e)
1303b706cSRodney W. Grimes
2ff2ad7d6SGreg Lehey# Directories to include in cscope name file and TAGS.
3ca987d46SWarner LoshCSCOPEDIRS=	bsm cam cddl compat conf contrib crypto ddb dev fs gdb \
445c203fcSGleb Smirnoff		geom gnu isa kern libkern modules net net80211 \
5f80c9100SEnji Cooper		netgraph netinet netinet6 netipsec netpfil \
646c57c8dSJohn Baldwin		netsmb nfs nfsclient nfsserver nlm ofed opencrypto \
75c3babf6SRui Paulo		rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR}
8debfd27fSJohn Baldwin.if !defined(CSCOPE_ARCHDIR)
92efc107aSDavid E. O'Brien.if defined(ALL_ARCH)
10153b6271SMitchell HorneCSCOPE_ARCHDIR = amd64 arm arm64 i386 powerpc riscv x86
112efc107aSDavid E. O'Brien.else
12debfd27fSJohn BaldwinCSCOPE_ARCHDIR = ${MACHINE}
13debfd27fSJohn Baldwin.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
14debfd27fSJohn BaldwinCSCOPE_ARCHDIR += x86
15debfd27fSJohn Baldwin.endif
16debfd27fSJohn Baldwin.endif
172efc107aSDavid E. O'Brien.endif
18ff2ad7d6SGreg Lehey
1917b88064SJordan K. HubbardHTAGSFLAGS+= -at `awk -F= '/^RELEASE *=/{release=$2}; END {print "FreeBSD", release, "kernel"}' < conf/newvers.sh`
2017b88064SJordan K. Hubbard
21f43455fdSBjoern A. Zeeb# You need the devel/cscope port for this.
22aa33f7d2SDavid E. O'Briencscope: cscope.out
23aa33f7d2SDavid E. O'Briencscope.out: ${.CURDIR}/cscope.files
24c960a2adSRui Paulo	cd ${.CURDIR}; cscope -k -buq -p4 -v
25ff2ad7d6SGreg Lehey
26aa33f7d2SDavid E. O'Brien${.CURDIR}/cscope.files: .PHONY
27aa33f7d2SDavid E. O'Brien	cd ${.CURDIR}; \
28d9cf41b6SDavid E. O'Brien		find ${CSCOPEDIRS} -name "*.[chSsly]" -a -type f > ${.TARGET}
29aa33f7d2SDavid E. O'Brien
30aa33f7d2SDavid E. O'Briencscope-clean:
3152f72bfaSEnji Cooper	cd ${.CURDIR}; \
32aa33f7d2SDavid E. O'Brien	    rm -f cscope.files cscope.out cscope.in.out cscope.po.out
33ff2ad7d6SGreg Lehey
34fb256796SRui Paulo#
35fb256796SRui Paulo# Installs SCM hooks to update the cscope database every time the source tree
36fb256796SRui Paulo# is updated.
37fb256796SRui Paulo# cscope understands incremental updates, so it's considerably faster when only
38fb256796SRui Paulo# a few files have changed.
39fb256796SRui Paulo#
40fb256796SRui PauloHG_DIR=${.CURDIR}/../.hg
41fb256796SRui PauloHG_HOOK=if [ \$$HG_ERROR -eq 0 ]; then cd sys && make -m ../share/mk cscope; fi
42fb256796SRui Paulocscope-hook:
43fb256796SRui Paulo	@if [ -d ${HG_DIR} ]; then 					\
44fb256796SRui Paulo		if [ "`grep hooks ${HG_DIR}/hgrc`" = "" ]; then		\
45fb256796SRui Paulo			echo "[hooks]" >> ${HG_DIR}/hgrc;		\
46fb256796SRui Paulo			echo "update = ${HG_HOOK}" >> ${HG_DIR}/hgrc;	\
47fb256796SRui Paulo			echo "Hook installed in ${HG_DIR}/hgrc";	\
48fb256796SRui Paulo		else 							\
49fb256796SRui Paulo			echo "Mercurial update hook already exists.";	\
50fb256796SRui Paulo		fi;							\
51fb256796SRui Paulo	fi
52fb256796SRui Paulo
53f43455fdSBjoern A. Zeeb# You need the devel/global and one of editor/emacs* ports for that.
54aa33f7d2SDavid E. O'BrienTAGS ${.CURDIR}/TAGS: ${.CURDIR}/cscope.files
55ff2ad7d6SGreg Lehey	rm -f ${.CURDIR}/TAGS
56aa33f7d2SDavid E. O'Brien	cd ${.CURDIR}; xargs etags -a < ${.CURDIR}/cscope.files
57ff2ad7d6SGreg Lehey
58e37a8052SEnji Cooper.if !(make(cscope) || make(cscope-clean) || make(cscope-hook) || make(TAGS))
5971e8891aSJohn Baldwin.include <src.opts.mk>
6071e8891aSJohn Baldwin
6171e8891aSJohn Baldwin# Loadable kernel modules
6271e8891aSJohn Baldwin
6371e8891aSJohn Baldwin.if defined(MODULES_WITH_WORLD)
6471e8891aSJohn BaldwinSUBDIR+=modules
6571e8891aSJohn Baldwin.endif
6671e8891aSJohn Baldwin
67303b706cSRodney W. Grimes.include <bsd.subdir.mk>
6871e8891aSJohn Baldwin.endif
69