Source-Changes-HG archive

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

[src/trunk]: src/sys/conf Move less important part out of Makefile.kern.inc.



details:   https://anonhg.NetBSD.org/src/rev/89fc0283a943
branches:  trunk
changeset: 810408:89fc0283a943
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Sat Aug 29 16:27:07 2015 +0000

description:
Move less important part out of Makefile.kern.inc.

diffstat:

 sys/conf/Makefile.kern.inc |  119 +-------------------------------------------
 sys/conf/cscope.mk         |   49 ++++++++++++++++++
 sys/conf/gdbinit.mk        |   20 +++++++
 sys/conf/lint.mk           |   39 ++++++++++++++
 4 files changed, 113 insertions(+), 114 deletions(-)

diffs (267 lines):

diff -r e2ec34c0c372 -r 89fc0283a943 sys/conf/Makefile.kern.inc
--- a/sys/conf/Makefile.kern.inc        Sat Aug 29 16:10:01 2015 +0000
+++ b/sys/conf/Makefile.kern.inc        Sat Aug 29 16:27:07 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.kern.inc,v 1.209 2015/08/29 16:07:07 uebayasi Exp $
+#      $NetBSD: Makefile.kern.inc,v 1.210 2015/08/29 16:27:07 uebayasi Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -446,51 +446,14 @@
 .endif
 
 ##
-## lint
+## install
 ##
 
-.if !target(lint)
-ALLSFILES?=    ${MD_SFILES} ${SFILES}
-LINTSTUBS?=    ${ALLSFILES:T:R:C/^.*$/LintStub_&.c/g}
-KERNLINTFLAGS?=        -bcehnxzFS
-NORMAL_LN?=    ${LINT} ${KERNLINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i $< -o $@
-
-_lsrc=${CFILES} ${LINTSTUBS} ${MI_CFILES} ${MD_CFILES}
-LOBJS?= ${_lsrc:T:S/.c$/.ln/g} ${LIBKERNLN} ${SYSLIBCOMPATLN}
-
-.for _sfile in ${ALLSFILES}
-LintStub_${_sfile:T:R}.c: ${_sfile} assym.h
-       ${_MKTARGET_COMPILE}
-       ${CC} -E -C ${AFLAGS} ${CPPFLAGS} ${_sfile} | \
-             ${TOOL_AWK} -f $S/kern/genlintstub.awk >${.TARGET}
-.endfor
-
-.for _cfile in ${CFILES} ${LINTSTUBS} ${MI_CFILES} ${MD_CFILES}
-${_cfile:T:R}.ln: ${_cfile}
-       ${_MKTARGET_COMPILE}
-       ${NORMAL_LN}
-.endfor
-
-lint: ${LOBJS}
-       ${LINT} ${KERNLINTFLAGS} ${CPPFLAGS:M-[IDU]*} ${LOBJS}
-.endif
-
-# Attempt to do a syntax-only compile of the entire kernel as one entity.
-# Alas, bugs in the GCC C frontend prevent this from completely effective
-# but information can be gleaned from the output.
-syntax-only: ${CFILES} ${MD_CFILES}
-       ${CC} -fsyntax-only -combine ${CFLAGS} ${CPPFLAGS} \
-               ${CFILES} ${MD_CFILES}
-
 # List of kernel images that will be installed into the root file system.
 # Some platforms may need to install more than one (e.g. a netbsd.aout file
 # to be loaded directly by the firmware), so this can be overriden by them.
 KERNIMAGES?=   netbsd
 
-##
-## install
-##
-
 .if !target(install)
 # The install target can be redefined by putting a
 # install-kernel-${MACHINE_NAME} target into /etc/mk.conf
@@ -507,81 +470,9 @@
 .endif
 .endif
 
-##
-## tags
-##
-
-.if !target(tags)
-tags:
-       @echo "see $S/kern/Makefile for tags"
-.endif
-
-##
-## cscope
-##
-
-EXTRA_CLEAN+= cscope.out cscope.tmp
-.if !target(cscope.out)
-cscope.out: Makefile depend
-       ${_MKTARGET_CREATE}
-       @${TOOL_SED} 's/[^:]*://;s/^ *//;s/ *\\ *$$//;' lib/kern/.depend \
-           | tr -s ' ' '\n' \
-           | ${TOOL_SED} ';s|^../../||;' \
-           > cscope.tmp
-       @${TOOL_SED} 's/[^:]*://;s/^ *//;s/ *\\ *$$//;' lib/compat/.depend \
-           | tr -s ' ' '\n' \
-           | ${TOOL_SED} 's|^../../||;' \
-           >> cscope.tmp
-       @echo ${SRCS} | cat - cscope.tmp | tr -s ' ' '\n' | sort -u | \
-           ${CSCOPE} -k -i - -b `echo ${INCLUDES} | ${TOOL_SED} s/-nostdinc//`
-#      cscope doesn't write cscope.out if it's uptodate, so ensure
-#      make doesn't keep calling cscope when not needed.
-       @rm -f cscope.tmp; 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 depend
-       ${_MKTARGET_CREATE}
-       @${MKID} \
-           `${TOOL_SED} 's/[^:]*://;s/^ *//;s/ *\\\\ *$$//;' \
-                       lib/kern/.depend lib/compat/.depend \
-                   | tr ' ' '\n' \
-                   | ${TOOL_SED} "s|^../../||" \
-                   | sort -u` \
-           `${TOOL_SED} 's/[^:]*://;s/^ *//;s/ *\\\\ *$$//;' \
-                       .depend \
-                   | tr ' ' '\n' \
-                   | sort -u`
-
-.endif
-
-##
-## .gdbinit
-##
-
-.include "${S}/gdbscripts/Makefile.inc"
-
-EXTRA_CLEAN+= .gdbinit
-.gdbinit: Makefile ${S}/gdbscripts/Makefile.inc
-       ${_MKTARGET_CREATE}
-       rm -f .gdbinit
-.for __gdbinit in ${SYS_GDBINIT}
-       echo "source ${S}/gdbscripts/${__gdbinit}" >> .gdbinit
-.endfor
-.if defined(GDBINIT) && !empty(GDBINIT)
-.for __gdbinit in ${GDBINIT}
-       echo "source ${__gdbinit}" >> .gdbinit
-.endfor
-.endif
+.include "${S}/conf/lint.mk"
+.include "${S}/conf/cscope.mk"
+.include "${S}/conf/gdbinit.mk"
 
 ##
 ## the kernel
diff -r e2ec34c0c372 -r 89fc0283a943 sys/conf/cscope.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/conf/cscope.mk        Sat Aug 29 16:27:07 2015 +0000
@@ -0,0 +1,49 @@
+# $NetBSD: cscope.mk,v 1.1 2015/08/29 16:27:07 uebayasi Exp $
+
+##
+## cscope
+##
+
+EXTRA_CLEAN+= cscope.out cscope.tmp
+.if !target(cscope.out)
+cscope.out: Makefile depend
+       ${_MKTARGET_CREATE}
+       @${TOOL_SED} 's/[^:]*://;s/^ *//;s/ *\\ *$$//;' lib/kern/.depend \
+           | tr -s ' ' '\n' \
+           | ${TOOL_SED} ';s|^../../||;' \
+           > cscope.tmp
+       @${TOOL_SED} 's/[^:]*://;s/^ *//;s/ *\\ *$$//;' lib/compat/.depend \
+           | tr -s ' ' '\n' \
+           | ${TOOL_SED} 's|^../../||;' \
+           >> cscope.tmp
+       @echo ${SRCS} | cat - cscope.tmp | tr -s ' ' '\n' | sort -u | \
+           ${CSCOPE} -k -i - -b `echo ${INCLUDES} | ${TOOL_SED} s/-nostdinc//`
+#      cscope doesn't write cscope.out if it's uptodate, so ensure
+#      make doesn't keep calling cscope when not needed.
+       @rm -f cscope.tmp; 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 depend
+       ${_MKTARGET_CREATE}
+       @${MKID} \
+           `${TOOL_SED} 's/[^:]*://;s/^ *//;s/ *\\\\ *$$//;' \
+                       lib/kern/.depend lib/compat/.depend \
+                   | tr ' ' '\n' \
+                   | ${TOOL_SED} "s|^../../||" \
+                   | sort -u` \
+           `${TOOL_SED} 's/[^:]*://;s/^ *//;s/ *\\\\ *$$//;' \
+                       .depend \
+                   | tr ' ' '\n' \
+                   | sort -u`
+
+.endif
diff -r e2ec34c0c372 -r 89fc0283a943 sys/conf/gdbinit.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/conf/gdbinit.mk       Sat Aug 29 16:27:07 2015 +0000
@@ -0,0 +1,20 @@
+# $NetBSD: gdbinit.mk,v 1.1 2015/08/29 16:27:07 uebayasi Exp $
+
+##
+## .gdbinit
+##
+
+.include "${S}/gdbscripts/Makefile.inc"
+
+EXTRA_CLEAN+= .gdbinit
+.gdbinit: Makefile ${S}/gdbscripts/Makefile.inc
+       ${_MKTARGET_CREATE}
+       rm -f .gdbinit
+.for __gdbinit in ${SYS_GDBINIT}
+       echo "source ${S}/gdbscripts/${__gdbinit}" >> .gdbinit
+.endfor
+.if defined(GDBINIT) && !empty(GDBINIT)
+.for __gdbinit in ${GDBINIT}
+       echo "source ${__gdbinit}" >> .gdbinit
+.endfor
+.endif
diff -r e2ec34c0c372 -r 89fc0283a943 sys/conf/lint.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/conf/lint.mk  Sat Aug 29 16:27:07 2015 +0000
@@ -0,0 +1,39 @@
+# $NetBSD: lint.mk,v 1.1 2015/08/29 16:27:07 uebayasi Exp $
+
+##
+## lint
+##
+
+.if !target(lint)
+ALLSFILES?=    ${MD_SFILES} ${SFILES}
+LINTSTUBS?=    ${ALLSFILES:T:R:C/^.*$/LintStub_&.c/g}
+KERNLINTFLAGS?=        -bcehnxzFS
+NORMAL_LN?=    ${LINT} ${KERNLINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i $< -o $@
+
+_lsrc=${CFILES} ${LINTSTUBS} ${MI_CFILES} ${MD_CFILES}
+LOBJS?= ${_lsrc:T:S/.c$/.ln/g} ${LIBKERNLN} ${SYSLIBCOMPATLN}
+
+.for _sfile in ${ALLSFILES}
+LintStub_${_sfile:T:R}.c: ${_sfile} assym.h
+       ${_MKTARGET_COMPILE}
+       ${CC} -E -C ${AFLAGS} ${CPPFLAGS} ${_sfile} | \
+             ${TOOL_AWK} -f $S/kern/genlintstub.awk >${.TARGET}
+.endfor
+
+.for _cfile in ${CFILES} ${LINTSTUBS} ${MI_CFILES} ${MD_CFILES}
+${_cfile:T:R}.ln: ${_cfile}
+       ${_MKTARGET_COMPILE}
+       ${NORMAL_LN}
+.endfor
+
+lint: ${LOBJS}
+       ${LINT} ${KERNLINTFLAGS} ${CPPFLAGS:M-[IDU]*} ${LOBJS}
+.endif
+
+# XXX who uses this?
+# Attempt to do a syntax-only compile of the entire kernel as one entity.
+# Alas, bugs in the GCC C frontend prevent this from completely effective
+# but information can be gleaned from the output.
+syntax-only: ${CFILES} ${MD_CFILES}
+       ${CC} -fsyntax-only -combine ${CFLAGS} ${CPPFLAGS} \
+               ${CFILES} ${MD_CFILES}



Home | Main Index | Thread Index | Old Index