1# $FreeBSD$ 2 3.include <src.opts.mk> 4 5# The boot loader 6.if ${MK_BOOT} != "no" 7SUBDIR= boot 8.endif 9 10# Directories to include in cscope name file and TAGS. 11CSCOPEDIRS= boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \ 12 geom gnu isa kern libkern modules net net80211 \ 13 netgraph netinet netinet6 netipsec netnatm netpfil \ 14 netsmb nfs nfsclient nfsserver nlm ofed opencrypto \ 15 pci rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR} 16.if !defined(CSCOPE_ARCHDIR) 17.if defined(ALL_ARCH) 18CSCOPE_ARCHDIR = amd64 arm i386 ia64 mips pc98 powerpc sparc64 x86 19.else 20CSCOPE_ARCHDIR = ${MACHINE} 21.if ${MACHINE} != ${MACHINE_CPUARCH} 22CSCOPE_ARCHDIR += ${MACHINE_CPUARCH} 23.endif 24.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" 25CSCOPE_ARCHDIR += x86 26.endif 27.endif 28.endif 29 30# Loadable kernel modules 31 32.if defined(MODULES_WITH_WORLD) 33SUBDIR+=modules 34.endif 35 36HTAGSFLAGS+= -at `awk -F= '/^RELEASE *=/{release=$2}; END {print "FreeBSD", release, "kernel"}' < conf/newvers.sh` 37 38# You need the devel/cscope port for this. 39cscope: cscope.out 40cscope.out: ${.CURDIR}/cscope.files 41 cd ${.CURDIR}; cscope -k -buq -p4 -v 42 43${.CURDIR}/cscope.files: .PHONY 44 cd ${.CURDIR}; \ 45 find ${CSCOPEDIRS} -name "*.[chSsly]" -a -type f > ${.TARGET} 46 47cscope-clean: 48 rm -f cscope.files cscope.out cscope.in.out cscope.po.out 49 50# 51# Installs SCM hooks to update the cscope database every time the source tree 52# is updated. 53# cscope understands incremental updates, so it's considerably faster when only 54# a few files have changed. 55# 56HG_DIR=${.CURDIR}/../.hg 57HG_HOOK=if [ \$$HG_ERROR -eq 0 ]; then cd sys && make -m ../share/mk cscope; fi 58cscope-hook: 59 @if [ -d ${HG_DIR} ]; then \ 60 if [ "`grep hooks ${HG_DIR}/hgrc`" = "" ]; then \ 61 echo "[hooks]" >> ${HG_DIR}/hgrc; \ 62 echo "update = ${HG_HOOK}" >> ${HG_DIR}/hgrc; \ 63 echo "Hook installed in ${HG_DIR}/hgrc"; \ 64 else \ 65 echo "Mercurial update hook already exists."; \ 66 fi; \ 67 fi 68 69# You need the devel/global and one of editor/emacs* ports for that. 70TAGS ${.CURDIR}/TAGS: ${.CURDIR}/cscope.files 71 rm -f ${.CURDIR}/TAGS 72 cd ${.CURDIR}; xargs etags -a < ${.CURDIR}/cscope.files 73 74# You need the textproc/glimpse ports for this. 75glimpse: 76.if !exists(${.CURDIR}/.glimpse_exclude) 77 echo .svn > ${.CURDIR}/.glimpse_exclude 78 echo /compile/ >> ${.CURDIR}/.glimpse_exclude 79.endif 80 cd ${.CURDIR}; glimpseindex -H . -B -f -o . 81 82glimpse-clean: 83 cd ${.CURDIR}; rm -f .glimpse_* 84 85.include <bsd.subdir.mk> 86