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