Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/conf Add cscope and mkid (and cscope.out and ID) targets...



details:   https://anonhg.NetBSD.org/src/rev/42d90beabc27
branches:  trunk
changeset: 532901:42d90beabc27
user:      wrstuden <wrstuden%NetBSD.org@localhost>
date:      Mon Jun 17 20:31:26 2002 +0000

description:
Add cscope and mkid (and cscope.out and ID) targets to kernel compile
Makefiles. The main feature added by these targets is that they cover
ONLY the source files used for a given kernel and no other. Thus when
examining MD routines provided by all machines, you will see only
those applicable for your kernel.

diffstat:

 sys/conf/Makefile.kern.inc |  33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

diffs (61 lines):

diff -r f8e343e6deef -r 42d90beabc27 sys/conf/Makefile.kern.inc
--- a/sys/conf/Makefile.kern.inc        Mon Jun 17 20:22:48 2002 +0000
+++ b/sys/conf/Makefile.kern.inc        Mon Jun 17 20:31:26 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.kern.inc,v 1.15 2002/05/29 16:12:54 tv Exp $
+#      $NetBSD: Makefile.kern.inc,v 1.16 2002/06/17 20:31:26 wrstuden Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. There are
@@ -27,6 +27,8 @@
 STRIP?=                strip
 OBJCOPY?=      objcopy
 OBJDUMP?=      objdump
+CSCOPE?=       cscope
+MKID?=         mkid
 .MAKEOVERRIDES+=USETOOLS       # make sure proper value is propagated
 
 ##
@@ -200,7 +202,8 @@
 assym.h machdep.o: Makefile
 
 ##
-## (7) misc targets: install, clean(dir), depend(all), lint, links, tags
+## (7) misc targets: install, clean(dir), depend(all), lint, links, tags,
+##                   cscope, mkid
 ##
 ## Any ports that have other stuff to be cleaned up should fill in
 ## EXTRA_CLEAN.  Some ports may want different settings for
@@ -281,6 +284,32 @@
        @echo "see $S/kern/Makefile for tags"
 .endif
 
+EXTRA_CLEAN+= cscope.out
+.if !target(cscope.out)
+cscope.out: Makefile
+       @echo Building cscope.out source database
+       @echo ${SRCS} | ${CSCOPE} -k -i - -b \
+               `echo ${INCLUDES} | sed s/-nostdinc//`
+#      cscope doesn't write cscope.out if it's uptodate, so ensure
+#      make doesn't keep calling cscope when not needed.
+       @touch cscope.out
+.endif
+
+.if !target(cscope)
+cscope: cscope.out
+       @${CSCOPE} -d
+.endif
+
+EXTRA_CLEAN+= ID
+.if !target(mkid)
+.PHONY: mkid
+mkid: ID
+
+ID: Makefile
+       @echo Building mkid database
+       @${MKID} ${SRCS}
+.endif
+
 ##
 ## the end
 ##



Home | Main Index | Thread Index | Old Index