Source-Changes-HG archive

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

[src/perseant-stdc-iso10646]: src/sys/conf 2814968



details:   https://anonhg.NetBSD.org/src/rev/42b2932e191e
branches:  perseant-stdc-iso10646
changeset: 850641:42b2932e191e
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jul 15 15:20:53 2017 +0000

description:
2814968

diffstat:

 sys/conf/Makefile.kern.inc |  540 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 540 insertions(+), 0 deletions(-)

diffs (truncated from 544 to 300 lines):

diff -r a3c2d2dd2fe7 -r 42b2932e191e sys/conf/Makefile.kern.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/conf/Makefile.kern.inc        Sat Jul 15 15:20:53 2017 +0000
@@ -0,0 +1,540 @@
+#      $NetBSD: Makefile.kern.inc,v 1.260.2.2 2017/07/15 15:20:53 christos Exp $
+#
+# This file contains common `MI' targets and definitions and it is included
+# at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
+#
+# Each target in this file should be protected with `if !target(target)'
+# or `if !commands(target)' and each variable should only be conditionally
+# assigned `VAR ?= VALUE', so that everything can be overriden.
+#
+# DEBUG is set to -g if debugging.
+# PROF is set to -pg if profiling.
+#
+# To specify debugging, add the config line: makeoptions DEBUG="-g"
+# A better way is to specify -g only for a few files.
+#
+#      makeoptions DEBUGLIST="uvm* trap if_*"
+#
+# all ports are expected to include bsd.own.mk for toolchain settings
+
+# Default DEBUG to -g if kernel debug info is requested by MKKDEBUG=yes
+.if defined(MKKDEBUG) && ${MKKDEBUG} == "yes"
+DEBUG?=-g
+.endif
+
+##
+## (0) toolchain settings for things that aren't part of the standard
+## toolchain
+##
+HOST_SH?=      sh
+DBSYM?=                dbsym
+MKDEP?=                mkdep
+STRIP?=                strip
+OBJCOPY?=      objcopy
+OBJDUMP?=      objdump
+CSCOPE?=       cscope
+MKID?=         mkid
+UUDECODE?=     ${TOOL_UUDECODE:Uuudecode}
+HEXDUMP?=      ${TOOL_HEXDUMP:Uhexdump}
+GENASSYM?=     ${TOOL_GENASSYM:Ugenassym}
+.MAKEOVERRIDES+=USETOOLS       # make sure proper value is propagated
+
+_MKMSG?=               @\#
+_MKSHMSG?=             echo
+_MKSHECHO?=            echo
+_MKSHNOECHO=           :
+_MKMSG_CREATE?=                :
+_MKTARGET_COMPILE?=    :
+_MKTARGET_CREATE?=     :
+
+##
+## (1) port independent source tree identification
+##
+# source tree is located via $S relative to the compilation directory
+.ifndef S
+S!=    cd ../../../.. && pwd
+.endif
+
+##
+## (2) compile settings
+##
+## CPPFLAGS, CFLAGS, and AFLAGS must be set in the port's Makefile
+##
+INCLUDES?=     -I. ${EXTRA_INCLUDES} -I${S}/../common/include -I$S/arch \
+               -I$S -nostdinc
+CPPFLAGS+=     ${INCLUDES} ${IDENT} -D_KERNEL -D_KERNEL_OPT
+CPPFLAGS+=     -std=gnu99
+DEFCOPTS?=     -O2
+COPTS?=                ${DEFCOPTS}
+DBG=           # might contain unwanted -Ofoo
+CWARNFLAGS+=   -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith
+CWARNFLAGS+=   -Wmissing-prototypes -Wstrict-prototypes
+CWARNFLAGS+=   -Wold-style-definition
+CWARNFLAGS+=   -Wswitch -Wshadow
+CWARNFLAGS+=   -Wcast-qual -Wwrite-strings
+CWARNFLAGS+=   -Wno-unreachable-code
+#CWARNFLAGS+=  -Wc++-compat -Wno-error=c++-compat
+CWARNFLAGS+=   -Wno-pointer-sign -Wno-attributes
+.  if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "x86_64" || \
+       ${MACHINE_ARCH} == "sparc64" || ${MACHINE} == "prep"
+CWARNFLAGS+=   -Wextra -Wno-unused-parameter
+.  endif
+.  if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "x86_64"
+CWARNFLAGS+=   -Wold-style-definition
+.  endif
+# Add -Wno-sign-compare.  -Wsign-compare is included in -Wall as of GCC 3.3,
+# but our sources aren't up for it yet.
+CWARNFLAGS+=   -Wno-sign-compare
+
+CWARNFLAGS.clang+=     -Wno-unknown-pragmas -Wno-conversion \
+                       -Wno-self-assign -Wno-error=address-of-packed-member \
+                       -Wno-error=constant-conversion
+
+CWARNFLAGS.ah_regdomain.c= ${${ACTIVE_CC} == "clang":? \
+    -Wno-shift-count-negative -Wno-shift-count-overflow:}
+
+CWARNFLAGS.ioconf.c= ${${ACTIVE_CC} == "clang":? -Wno-unused-const-variable :}
+
+CFLAGS+=       -ffreestanding -fno-zero-initialized-in-bss
+CFLAGS+=       ${DEBUG} ${COPTS}
+AFLAGS+=       -D_LOCORE -Wa,--fatal-warnings
+
+# XXX
+.if defined(HAVE_GCC) || defined(HAVE_LLVM)
+CFLAGS+=       -fno-strict-aliasing
+CFLAGS+=       -fno-common
+.endif
+
+# Use the per-source COPTS variables to add -g to just those
+# files that match the shell patterns given in ${DEBUGLIST}
+#
+.for i in ${DEBUGLIST}
+. for j in ${ALLFILES:M*.c:T:M$i.c}
+COPTS.${j}+=-g
+. endfor
+.endfor
+
+# Always compile debugsyms.c with debug information.
+# This allows gdb to use type informations.
+#
+COPTS.debugsyms.c+=    -g
+
+# Add CTF sections for DTrace
+.if defined(CTFCONVERT)
+COMPILE_CTFCONVERT=    ${_MKSHECHO}\
+                       ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \
+                       ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
+.else
+COMPILE_CTFCONVERT=    ${_MKSHNOECHO}
+.endif
+
+KCOMPILE.c=    ${CC} ${COPTS.${<:T}} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
+KCOMPILE.s=    ${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${CPPFLAGS} -c $< -o $@
+KLINK.o=       ${LD} -r ${LINKFORMAT} -Map=${.TARGET}.map -o ${.TARGET} ${.ALLSRC}
+
+# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
+# NOPROF and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
+NORMAL_C?=     @${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}" && \
+               ${_MKSHECHO} ${KCOMPILE.c} ${PROF} && \
+               ${KCOMPILE.c} ${PROF} && \
+               ${COMPILE_CTFCONVERT}
+NOPROF_C?=     @${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}" && \
+               ${_MKSHECHO} ${KCOMPILE.c} && \
+               ${KCOMPILE.c} && \
+               ${COMPILE_CTFCONVERT}
+NORMAL_S?=     @${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}" && \
+               ${_MKSHECHO} ${KCOMPILE.s} && \
+               ${KCOMPILE.s}
+ 
+# link rules: 
+LINK_O?=       @${_MKSHMSG} "   link  ${.CURDIR:T}/${.TARGET}" && \
+               ${_MKSHECHO} ${KLINK.o} && \
+               ${KLINK.o}
+
+##
+## (3) libkern and compat
+##
+## Set KERN_AS in the port Makefile to "obj" or "library".  The
+## default is "library", as documented in $S/lib/libkern/Makefile.inc.
+##
+
+### find out what to use for libkern
+.include "$S/lib/libkern/Makefile.inc"
+.ifndef PROF
+LIBKERN?=      ${KERNLIB}
+.else
+LIBKERN?=      ${KERNLIB_PROF}
+.endif
+
+LIBKERNLN?=    ${KERNLIBLN}
+
+### find out what to use for libcompat
+.include "$S/compat/common/Makefile.inc"
+.ifndef PROF
+SYSLIBCOMPAT?= ${COMPATLIB}
+.else
+SYSLIBCOMPAT?= ${COMPATLIB_PROF}
+.endif
+
+SYSLIBCOMPATLN?=       ${COMPATLIBLN}
+
+##
+## (4) local objects, compile rules, and dependencies
+##
+## Each port should have a corresponding section with settings for
+## MD_CFILES, MD_SFILES, and MD_OBJS, along with build rules for same.
+##
+
+.if !defined(___USE_SUFFIX_RULES___)
+_MD_OBJS=      ${MD_OBJS:T}
+.else
+_MD_OBJS=      ${MD_OBJS}
+.endif
+
+##
+## (5) link settings
+##
+## TEXTADDR (or LOADADDRESS), LINKFORMAT, LINKSCRIPT, and any EXTRA_LINKFLAGS
+## must be set in the port's Makefile.  The port specific definitions for
+## LINKFLAGS_NORMAL and LINKFLAGS_DEBUG will added to the LINKFLAGS
+## depending on the value of DEBUG.
+##
+# load lines for config "xxx" will be emitted as:
+# xxx: ${SYSTEM_DEP} swapxxxx.o vers.o build_kernel
+
+SYSTEM_LIB=    ${MD_LIBS} ${SYSLIBCOMPAT} ${LIBKERN}
+SYSTEM_OBJ?=   ${_MD_OBJS} ${OBJS} ${SYSTEM_LIB}
+SYSTEM_DEP+=   Makefile ${SYSTEM_OBJ:O}
+.if defined(CTFMERGE)
+SYSTEM_CTFMERGE= ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o
+.else
+SYSTEM_CTFMERGE= ${_MKSHECHO}
+.endif
+
+REMOVE_SWAP=   [@]
+.for k in ${KERNELS}
+REMOVE_SWAP:=  ${REMOVE_SWAP}:Nswap${k}.o
+.endfor
+
+SYSTEM_LD_HEAD?=@rm -f $@
+SYSTEM_LD?=    ${_MKSHMSG} "   link  ${.CURDIR:T}/${.TARGET}"; \
+               ${_MKSHECHO}\
+               ${LD} -Map ${.TARGET}.map --cref ${LINKFLAGS} -o ${.TARGET} \
+               '$${SYSTEM_OBJ:${REMOVE_SWAP}}' '$${EXTRA_OBJ}' vers.o \
+               ${OBJS:M*swap${.TARGET}.o}; \
+               ${LD} -Map ${.TARGET}.map --cref ${LINKFLAGS} -o ${.TARGET} \
+               ${SYSTEM_OBJ:${REMOVE_SWAP}} ${EXTRA_OBJ} vers.o \
+               ${OBJS:M*swap${.TARGET}.o}
+
+TEXTADDR?=     ${LOADADDRESS}                  # backwards compatibility
+LINKTEXT?=     ${TEXTADDR:C/.+/-Ttext &/}
+LINKDATA?=     ${DATAADDR:C/.+/-Tdata &/}
+ENTRYPOINT?=   start
+LINKENTRY?=    ${ENTRYPOINT:C/.+/-e &/}
+LINKFLAGS?=    ${LINKFORMAT} ${LINKSCRIPT} ${LINKTEXT} ${LINKDATA} ${LINKENTRY} \
+               ${EXTRA_LINKFLAGS}
+
+LINKFLAGS_DEBUG?=      -X
+
+SYSTEM_LD_TAIL?=@${TOOL_SED} '/const char sccs/!d;s/.*@(.)//;s/" "//;s/\\.*//' vers.c && \
+               ${SIZE} $@ && chmod 755 $@ && \
+               ${SYSTEM_CTFMERGE}
+SYSTEM_LD_TAIL_DEBUG?=&& \
+               echo mv -f $@ $@.gdb && mv -f $@ $@.gdb && \
+               echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb && \
+               ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
+LINKFLAGS_NORMAL?=     -S
+STRIPFLAGS?=   -g
+
+DEBUG?=
+.if !empty(DEBUG:M-g*)
+SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_DEBUG}
+LINKFLAGS+=    ${LINKFLAGS_DEBUG}
+EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.gdb@}
+CTFFLAGS+=     -g
+TARGETSFX=     .gdb
+.elifndef PROF
+LINKFLAGS+=    ${LINKFLAGS_NORMAL}
+.endif
+
+SYSTEM_LD_HEAD+=       ${SYSTEM_LD_HEAD_EXTRA}
+SYSTEM_LD_TAIL_STAGE1= ${SYSTEM_LD_TAIL}
+SYSTEM_LD_TAIL_STAGE2= ${SYSTEM_LD_TAIL}
+.if defined(COPY_SYMTAB)
+SYSTEM_LD_TAIL_STAGE2+=        && echo ${DBSYM} $@ && ${DBSYM} $@
+.if !empty(DEBUG:M-g)
+SYSTEM_LD_TAIL_STAGE2+=        && echo ${DBSYM} $@.gdb && ${DBSYM} $@.gdb
+.endif
+.endif
+SYSTEM_LD_TAIL_STAGE2+=        ${SYSTEM_LD_TAIL_EXTRA}
+
+##
+## (6) port independent targets and dependencies: assym.h, vers.o
+##
+
+.if !defined(___USE_SUFFIX_RULES___)
+
+# Generate list of *.o files to pass to ${LD}, preserving order.
+#      x/y/z/a.[csS] -> a.[csS]
+#      a.[csS] -> a.o
+OBJS=  ${ALLFILES:C|^.*/([^/]*\.[csS])$$|\1|:C|^(.*)\.[csS]$$|\1.o|}
+
+CFILES=        ${ALLFILES:M*.c}
+SFILES=        ${ALLFILES:M*.[sS]}
+OFILES=        ${ALLFILES:M*.o}
+# absolute, generated (build directory), relative (under $S)
+_CFILES=${CFILES:M/*} ${CFILES:N/*:N*/*} ${CFILES:N/*:M*/*:C|^|$S/|}
+_SFILES=${SFILES:M/*} ${SFILES:N/*:N*/*} ${SFILES:N/*:M*/*:C|^|$S/|}
+_MD_CFILES=${MD_CFILES}
+_MD_SFILES=${MD_SFILES}
+CSRCS= ${_MD_CFILES} ${_CFILES}
+SSRCS= ${_MD_SFILES} ${_SFILES}
+SRCS=  ${CSRCS} ${SSRCS}
+
+.else # ___USE_SUFFIX_RULES___
+OBJS=  ${ALLFILES:C|\.[csS]$$|.o|}
+SRCS=  ${ALLFILES:M*.[csS]}



Home | Main Index | Thread Index | Old Index