Home | History | Annotate | Line # | Download | only in conf
Makefile.kern.inc revision 1.273
      1 #	$NetBSD: Makefile.kern.inc,v 1.273 2020/06/19 00:58:17 simonb Exp $
      2 #
      3 # This file contains common `MI' targets and definitions and it is included
      4 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
      5 #
      6 # Each target in this file should be protected with `if !target(target)'
      7 # or `if !commands(target)' and each variable should only be conditionally
      8 # assigned `VAR ?= VALUE', so that everything can be overriden.
      9 #
     10 # DEBUG is set to -g if debugging.
     11 # PROF is set to -pg if profiling.
     12 #
     13 # To specify debugging, add the config line: makeoptions DEBUG="-g"
     14 # A better way is to specify -g only for a few files.
     15 #
     16 #	makeoptions DEBUGLIST="uvm* trap if_*"
     17 #
     18 # all ports are expected to include bsd.own.mk for toolchain settings
     19 
     20 # Default DEBUG to -g if kernel debug info is requested by MKKDEBUG=yes
     21 .if defined(MKKDEBUG) && ${MKKDEBUG} == "yes"
     22 DEBUG?=-g
     23 .endif
     24 
     25 ##
     26 ## (0) toolchain settings for things that aren't part of the standard
     27 ## toolchain
     28 ##
     29 HOST_SH?=	sh
     30 DBSYM?=		dbsym
     31 MKDEP?=		mkdep
     32 STRIP?=		strip
     33 OBJCOPY?=	objcopy
     34 OBJDUMP?=	objdump
     35 CSCOPE?=	cscope
     36 MKID?=		mkid
     37 UUDECODE?=	${TOOL_UUDECODE:Uuudecode}
     38 HEXDUMP?=	${TOOL_HEXDUMP:Uhexdump}
     39 GENASSYM?=	${TOOL_GENASSYM:Ugenassym}
     40 .MAKEOVERRIDES+=USETOOLS	# make sure proper value is propagated
     41 
     42 _MKMSG?=		@\#
     43 _MKSHMSG?=		echo
     44 _MKSHECHO?=		echo
     45 _MKSHNOECHO=		:
     46 _MKMSG_CREATE?=		:
     47 _MKTARGET_COMPILE?=	:
     48 _MKTARGET_CREATE?=	:
     49 
     50 ##
     51 ## (1) port independent source tree identification
     52 ##
     53 # source tree is located via $S relative to the compilation directory
     54 .ifndef S
     55 S!=	cd ../../../.. && pwd
     56 .endif
     57 
     58 ##
     59 ## (2) compile settings
     60 ##
     61 ## CPPFLAGS, CFLAGS, and AFLAGS must be set in the port's Makefile
     62 ##
     63 INCLUDES?=	-I. ${EXTRA_INCLUDES} -I${S}/../common/include -I$S/arch \
     64 		-I$S -nostdinc
     65 CPPFLAGS+=	${INCLUDES} ${IDENT} -D_KERNEL -D_KERNEL_OPT
     66 .if !defined(COVERITY_TOP_CONFIG)
     67 CPPFLAGS+=	-std=gnu99
     68 .endif
     69 .if ${KERNEL_DIR:Uno} == "yes"
     70 CPPFLAGS+=	-DKERNEL_DIR
     71 .endif
     72 DEFCOPTS?=	-O2
     73 COPTS?=		${DEFCOPTS}
     74 DBG=		# might contain unwanted -Ofoo
     75 CWARNFLAGS+=	-Wall -Wno-main -Wno-format-zero-length -Wpointer-arith
     76 CWARNFLAGS+=	-Wmissing-prototypes -Wstrict-prototypes
     77 CWARNFLAGS+=	-Wold-style-definition
     78 CWARNFLAGS+=	-Wswitch -Wshadow
     79 CWARNFLAGS+=	-Wcast-qual -Wwrite-strings
     80 CWARNFLAGS+=	-Wno-unreachable-code
     81 #CWARNFLAGS+=	-Wc++-compat -Wno-error=c++-compat
     82 CWARNFLAGS+=	-Wno-pointer-sign -Wno-attributes
     83 .  if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "x86_64" || \
     84 	${MACHINE_ARCH} == "sparc64" || ${MACHINE} == "prep"
     85 CWARNFLAGS+=	-Wextra -Wno-unused-parameter
     86 .  endif
     87 .  if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "x86_64"
     88 CWARNFLAGS+=	-Wold-style-definition
     89 .  endif
     90 # Add -Wno-sign-compare.  -Wsign-compare is included in -Wall as of GCC 3.3,
     91 # but our sources aren't up for it yet.
     92 CWARNFLAGS+=	-Wno-sign-compare
     93 
     94 CWARNFLAGS.clang+=	-Wno-unknown-pragmas -Wno-conversion \
     95 			-Wno-self-assign -Wno-error=address-of-packed-member \
     96 			-Wno-error=constant-conversion
     97 
     98 CWARNFLAGS.ah_regdomain.c= ${${ACTIVE_CC} == "clang":? \
     99     -Wno-shift-count-negative -Wno-shift-count-overflow:}
    100 
    101 CWARNFLAGS.ioconf.c= ${${ACTIVE_CC} == "clang":? -Wno-unused-const-variable :}
    102 
    103 CFLAGS+=	-ffreestanding -fno-zero-initialized-in-bss
    104 CFLAGS+=	${${ACTIVE_CC} == "gcc":? -fno-delete-null-pointer-checks :}
    105 CFLAGS+=	${DEBUG} ${COPTS}
    106 AFLAGS+=	-D_LOCORE -Wa,--fatal-warnings
    107 # example usage to find largest stack users in kernel compile directory:
    108 #    find . -name \*.su | xargs awk '{ printf "%6d %s\n", $2, $1 }' | sort -n
    109 .if ${MACHINE} != "vax"
    110 # GCC/vax 8.4 does not support -fstack-usage.
    111 CFLAGS+=	${${ACTIVE_CC} == "gcc":? -fstack-usage :}
    112 .endif
    113 
    114 # XXX
    115 .if defined(HAVE_GCC) || defined(HAVE_LLVM)
    116 CFLAGS+=	-fno-strict-aliasing
    117 CFLAGS+=	-fno-common
    118 .endif
    119 
    120 # Use the per-source COPTS variables to add -g to just those
    121 # files that match the shell patterns given in ${DEBUGLIST}
    122 #
    123 .for i in ${DEBUGLIST}
    124 . for j in ${ALLFILES:M*.c:T:M$i.c}
    125 COPTS.${j}+=-g
    126 . endfor
    127 .endfor
    128 
    129 # Always compile debugsyms.c with debug information.
    130 # This allows gdb to use type informations.
    131 #
    132 COPTS.debugsyms.c+=	-g
    133 
    134 # Add CTF sections for DTrace
    135 .if defined(CTFCONVERT)
    136 COMPILE_CTFCONVERT=	${_MKSHECHO}\
    137 			${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \
    138 			${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
    139 .else
    140 COMPILE_CTFCONVERT=	${_MKSHNOECHO}
    141 .endif
    142 
    143 KCOMPILE.c=	${CC} ${COPTS.${<:T}} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
    144 KCOMPILE.s=	${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${CPPFLAGS} -c $< -o $@
    145 KLINK.o=	${LD} -r ${LINKFORMAT} -Map=${.TARGET}.map -o ${.TARGET} ${.ALLSRC}
    146 
    147 # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
    148 # NOPROF and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
    149 NORMAL_C?=	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}" && \
    150 		${_MKSHECHO} ${KCOMPILE.c} ${PROF} && \
    151 		${KCOMPILE.c} ${PROF} && \
    152 		${COMPILE_CTFCONVERT}
    153 NOPROF_C?=	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}" && \
    154 		${_MKSHECHO} ${KCOMPILE.c} && \
    155 		${KCOMPILE.c} && \
    156 		${COMPILE_CTFCONVERT}
    157 NORMAL_S?=	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}" && \
    158 		${_MKSHECHO} ${KCOMPILE.s} && \
    159 		${KCOMPILE.s}
    160 
    161 # link rules:
    162 LINK_O?=	@${_MKSHMSG} "   link  ${.CURDIR:T}/${.TARGET}" && \
    163 		${_MKSHECHO} ${KLINK.o} && \
    164 		${KLINK.o}
    165 
    166 ##
    167 ## (3) libkern
    168 ##
    169 ## Set OPT_MODULAR in the port Makefile if module(7) is enabled,
    170 ## as documented in $S/lib/libkern/Makefile.inc.
    171 ##
    172 
    173 ### find out what to use for libkern
    174 .include "$S/lib/libkern/Makefile.inc"
    175 .ifndef PROF
    176 LIBKERN?=	${KERNLIB}
    177 .else
    178 LIBKERN?=	${KERNLIB_PROF}
    179 .endif
    180 
    181 LIBKERNLN?=	${KERNLIBLN}
    182 
    183 ##
    184 ## (4) local objects, compile rules, and dependencies
    185 ##
    186 ## Each port should have a corresponding section with settings for
    187 ## MD_CFILES, MD_SFILES, and MD_OBJS, along with build rules for same.
    188 ##
    189 
    190 .if !defined(___USE_SUFFIX_RULES___)
    191 _MD_OBJS=	${MD_OBJS:T}
    192 .else
    193 _MD_OBJS=	${MD_OBJS}
    194 .endif
    195 
    196 ##
    197 ## (5) link settings
    198 ##
    199 ## TEXTADDR (or LOADADDRESS), LINKFORMAT, LINKSCRIPT, and any EXTRA_LINKFLAGS
    200 ## must be set in the port's Makefile.  The port specific definitions for
    201 ## LINKFLAGS_NORMAL and LINKFLAGS_DEBUG will added to the LINKFLAGS
    202 ## depending on the value of DEBUG.
    203 ##
    204 # load lines for config "xxx" will be emitted as:
    205 # xxx: ${SYSTEM_DEP} swapxxxx.o vers.o build_kernel
    206 
    207 SYSTEM_LIB=	${MD_LIBS} ${LIBKERN}
    208 SYSTEM_OBJ?=	${_MD_OBJS} ${OBJS} ${SYSTEM_LIB}
    209 SYSTEM_DEP+=	Makefile ${SYSTEM_OBJ:O}
    210 .if defined(CTFMERGE)
    211 SYSTEM_CTFMERGE= ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o
    212 .else
    213 SYSTEM_CTFMERGE= ${_MKSHECHO}
    214 .endif
    215 
    216 REMOVE_SWAP=   [@]
    217 .for k in ${KERNELS}
    218 REMOVE_SWAP:=  ${REMOVE_SWAP}:Nswap${k}.o
    219 .endfor
    220 
    221 SYSTEM_LD_HEAD?=@rm -f $@
    222 SYSTEM_LD?=	${_MKSHMSG} "   link  ${.CURDIR:T}/${.TARGET}"; \
    223 		${_MKSHECHO}\
    224 		${LD} -Map ${.TARGET}.map --cref ${LINKFLAGS} -o ${.TARGET} \
    225 		'$${SYSTEM_OBJ:${REMOVE_SWAP}}' '$${EXTRA_OBJ}' vers.o \
    226 		${OBJS:M*swap${.TARGET}.o}; \
    227 		${LD} -Map ${.TARGET}.map --cref ${LINKFLAGS} -o ${.TARGET} \
    228 		${SYSTEM_OBJ:${REMOVE_SWAP}} ${EXTRA_OBJ} vers.o \
    229 		${OBJS:M*swap${.TARGET}.o}
    230 
    231 TEXTADDR?=	${LOADADDRESS}			# backwards compatibility
    232 LINKTEXT?=	${TEXTADDR:C/.+/-Ttext &/}
    233 LINKDATA?=	${DATAADDR:C/.+/-Tdata &/}
    234 ENTRYPOINT?=	start
    235 LINKENTRY?=	${ENTRYPOINT:C/.+/-e &/}
    236 LINKFLAGS?=	${LINKFORMAT} ${LINKSCRIPT} ${LINKTEXT} ${LINKDATA} ${LINKENTRY} \
    237 		${EXTRA_LINKFLAGS}
    238 
    239 LINKFLAGS_DEBUG?=	-X
    240 
    241 SYSTEM_LD_TAIL?=@${TOOL_SED} '/const char sccs/!d;s/.*@(.)//;s/" "//;s/\\.*//' vers.c && \
    242 		${SIZE} $@ && ${SYSTEM_CTFMERGE} && chmod 755 $@
    243 SYSTEM_LD_TAIL_DEBUG?=&& \
    244 		echo mv -f $@ $@.gdb && mv -f $@ $@.gdb && \
    245 		echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb && \
    246 		${STRIP} ${STRIPFLAGS} -o $@ $@.gdb && \
    247 		chmod 755 $@ $@.gdb
    248 LINKFLAGS_NORMAL?=	-S
    249 STRIPFLAGS?=	-g
    250 
    251 DEBUG?=
    252 .if !empty(DEBUG:M-g*)
    253 SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_DEBUG}
    254 LINKFLAGS+=	${LINKFLAGS_DEBUG}
    255 EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.gdb@}
    256 CTFFLAGS+=	-g
    257 TARGETSFX=	.gdb
    258 .elifndef PROF
    259 LINKFLAGS+=	${LINKFLAGS_NORMAL}
    260 .endif
    261 
    262 SYSTEM_LD_HEAD+=	${SYSTEM_LD_HEAD_EXTRA}
    263 SYSTEM_LD_TAIL_STAGE1=	${SYSTEM_LD_TAIL}
    264 SYSTEM_LD_TAIL_STAGE2=	${SYSTEM_LD_TAIL}
    265 .if defined(COPY_SYMTAB)
    266 SYSTEM_LD_TAIL_STAGE2+=	&& echo ${DBSYM} $@ && ${DBSYM} $@
    267 .if !empty(DEBUG:M-g)
    268 SYSTEM_LD_TAIL_STAGE2+=	&& echo ${DBSYM} $@.gdb && ${DBSYM} $@.gdb
    269 .endif
    270 .endif
    271 SYSTEM_LD_TAIL_STAGE2+=	${SYSTEM_LD_TAIL_EXTRA}
    272 
    273 ##
    274 ## (6) port independent targets and dependencies: assym.h, vers.o
    275 ##
    276 
    277 .if !defined(___USE_SUFFIX_RULES___)
    278 
    279 # Generate list of *.o files to pass to ${LD}, preserving order.
    280 #	x/y/z/a.[csS] -> a.[csS]
    281 #	a.[csS] -> a.o
    282 OBJS=	${ALLFILES:C|^.*/([^/]*\.[csS])$$|\1|:C|^(.*)\.[csS]$$|\1.o|}
    283 
    284 CFILES=	${ALLFILES:M*.c}
    285 SFILES=	${ALLFILES:M*.[sS]}
    286 OFILES=	${ALLFILES:M*.o}
    287 # absolute, generated (build directory), relative (under $S)
    288 _CFILES=${CFILES:M/*} ${CFILES:N/*:N*/*} ${CFILES:N/*:M*/*:C|^|$S/|}
    289 _SFILES=${SFILES:M/*} ${SFILES:N/*:N*/*} ${SFILES:N/*:M*/*:C|^|$S/|}
    290 _MD_CFILES=${MD_CFILES}
    291 _MD_SFILES=${MD_SFILES}
    292 CSRCS=	${_MD_CFILES} ${_CFILES}
    293 SSRCS=	${_MD_SFILES} ${_SFILES}
    294 SRCS=	${CSRCS} ${SSRCS}
    295 
    296 .else # ___USE_SUFFIX_RULES___
    297 OBJS=	${ALLFILES:C|\.[csS]$$|.o|}
    298 SRCS=	${ALLFILES:M*.[csS]}
    299 .endif # ___USE_SUFFIX_RULES___
    300 
    301 .if !defined(___USE_SUFFIX_RULES___)
    302 .for _s in ${_CFILES}
    303 .if !commands(${_s:T:R}.o)
    304 ${_s:T:R}.o: ${_s}
    305 	${NORMAL_C}
    306 .endif
    307 .endfor
    308 
    309 .for _s in ${_SFILES}
    310 .if !commands(${_s:T:R}.o)
    311 ${_s:T:R}.o: ${_s}
    312 	${NORMAL_S}
    313 .endif
    314 .endfor
    315 .endif # !___USE_SUFFIX_RULES___
    316 
    317 .include "${S}/conf/ldscript.mk"
    318 .include "${S}/conf/assym.mk"
    319 .include "${S}/conf/newvers.mk"
    320 .include "${S}/dev/splash/splash.mk"
    321 .include "${S}/conf/mdroot.mk"
    322 .include "${S}/conf/lint.mk"
    323 .include "${S}/conf/cscope.mk"
    324 .include "${S}/conf/gdbinit.mk"
    325 .include "${S}/conf/ssp.mk"
    326 .if "${_SKIP_DTS}" != "yes"
    327 .include "${S}/conf/dts.mk"
    328 .endif
    329 .include "${S}/conf/copts.mk"
    330 
    331 ##
    332 ## (7) misc targets: install, clean(dir), depend(all), lint, links, tags,
    333 ##                   cscope, mkid
    334 ##
    335 ## Any ports that have other stuff to be cleaned up should fill in
    336 ## EXTRA_CLEAN.  Some ports may want different settings for
    337 ## KERNLINTFLAGS, MKDEP_CFLAGS, or MKDEP_AFLAGS.
    338 ##
    339 
    340 ##
    341 ## clean
    342 ##
    343 
    344 .if !target(__CLEANKERNEL)
    345 __CLEANKERNEL: .USE
    346 	${_MKMSG} "${.TARGET}ing the kernel objects"
    347 	rm -f ${KERNELS} *.map *.[io] *.ko *.ln [a-z]*.s *.su vers.c \
    348 	    eddep tags [Ee]rrs linterrs makelinks assym.h.tmp assym.h \
    349 	    ${EXTRA_KERNELS} ${EXTRA_CLEAN}
    350 .endif
    351 
    352 .if !target(kernelnames)
    353 kernelnames:
    354 	@echo "${KERNELS} ${EXTRA_KERNELS}"
    355 .endif
    356 
    357 .if !target(__CLEANDEPEND)
    358 __CLEANDEPEND: .USE
    359 	echo .depend ${DEPS} | xargs rm -f --
    360 .endif
    361 
    362 # do not !target these, the kern and compat Makefiles augment them
    363 cleandir distclean: __CLEANKERNEL __CLEANDEPEND
    364 clean: __CLEANKERNEL
    365 depend: .depend
    366 dependall: depend .WAIT all
    367 
    368 ##
    369 ## depend
    370 ##
    371 
    372 .if !target(.depend)
    373 MKDEP_AFLAGS?=	${AFLAGS}
    374 MKDEP_CFLAGS?=	${CFLAGS}
    375 .if !defined(___USE_SUFFIX_RULES___)
    376 DEPS+=	${SRCS:T:R:S/$/.d/g}
    377 .else
    378 DEPS+=	${SRCS:R:S/$/.d/g}
    379 .endif
    380 
    381 .if !defined(___USE_SUFFIX_RULES___)
    382 .for _s in ${SSRCS}
    383 .if !commands(${_s:T:R}.d)
    384 ${_s:T:R}.d: ${_s}
    385 	${_MKTARGET_CREATE}
    386 	${MKDEP} -f ${.TARGET}.tmp -- ${MKDEP_AFLAGS} \
    387 	    ${CPPFLAGS} ${CPPFLAGS.${_s:T}} ${_s}
    388 	mv -f ${.TARGET}.tmp ${.TARGET}
    389 .endif
    390 .endfor
    391 
    392 .for _s in ${CSRCS}
    393 .if !commands(${_s:T:R}.d)
    394 ${_s:T:R}.d: ${_s}
    395 	${_MKTARGET_CREATE}
    396 	${MKDEP} -f ${.TARGET}.tmp -- ${MKDEP_CFLAGS} \
    397 	    ${CPPFLAGS} ${CPPFLAGS.${_s:T}} ${_s}
    398 	mv -f ${.TARGET}.tmp ${.TARGET}
    399 .endif
    400 .endfor
    401 .endif # !___USE_SUFFIX_RULES___
    402 
    403 .depend: ${DEPS:O}
    404 	${_MKTARGET_CREATE}
    405 	echo "${.ALLSRC}" | ${MKDEP} -D
    406 .endif
    407 
    408 ##
    409 ## install
    410 ##
    411 
    412 # List of kernel images that will be installed into the root file system.
    413 # Some platforms may need to install more than one (e.g. a netbsd.aout file
    414 # to be loaded directly by the firmware), so this can be overriden by them.
    415 KERNIMAGES?=	netbsd
    416 
    417 .if !target(install)
    418 # The install target can be redefined by putting a
    419 # install-kernel-${MACHINE_NAME} target into /etc/mk.conf
    420 MACHINE_NAME!=  uname -n
    421 install: install-kernel-${MACHINE_NAME}
    422 .if !target(install-kernel-${MACHINE_NAME})
    423 install-kernel-${MACHINE_NAME}:
    424 .for _K in ${KERNIMAGES}
    425 .if ${KERNEL_DIR:Uno} == "yes"
    426 	rm -fr ${DESTDIR}/o${_K}
    427 	mv ${DESTDIR}/${_K} ${DESTDIR}/o${_K}
    428 	mkdir -p ${DESTDIR}/${_K}
    429 	cp ${_K} ${DESTDIR}/${_K}/kernel
    430 .else
    431 	rm -f ${DESTDIR}/o${_K}
    432 	ln ${DESTDIR}/${_K} ${DESTDIR}/o${_K}
    433 	cp ${_K} ${DESTDIR}/n${_K}
    434 	mv ${DESTDIR}/n${_K} ${DESTDIR}/${_K}
    435 .endif
    436 .endfor
    437 .endif
    438 .endif
    439 
    440 ##
    441 ## the kernel
    442 ##
    443 
    444 AFLAGS+=	${AOPTS.${.IMPSRC:T}}
    445 CFLAGS+=	${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}}
    446 CPPFLAGS+=	${CPPFLAGS.${.IMPSRC:T}}
    447 CWARNFLAGS+=	${CWARNFLAGS.${.IMPSRC:T}}
    448 
    449 .for _v in CFLAGS CPPFLAGS CWARNFLAGS
    450 .for _c in ${CSRCS}
    451 ${_v}.${_c:T}+=${OPT.${_c:T}:@.o.@${${_v}.${.o.}}@}
    452 .endfor
    453 .endfor
    454 
    455 .MAIN: all
    456 all: .gdbinit
    457 .for k in ${KERNELS}
    458 all: .WAIT ${k}
    459 ${k}: ${SYSTEM_DEP:O} swap${k}.o vers.o build_kernel
    460 .endfor
    461 
    462 .if !defined(COPY_SYMTAB)
    463 build_kernel: .USE
    464 	${SYSTEM_LD_HEAD}
    465 	${SYSTEM_LD}
    466 	${SYSTEM_LD_TAIL_STAGE2}
    467 .else
    468 .for k in ${KERNELS}
    469 ${k}: $S/kern/kern_ksyms_buf.c
    470 .endfor
    471 build_kernel: .USE
    472 	${CC} ${CFLAGS} ${CPPFLAGS} \
    473 	    -c $S/kern/kern_ksyms_buf.c -o kern_ksyms_buf.o
    474 	${SYSTEM_LD_HEAD}
    475 	${SYSTEM_LD} kern_ksyms_buf.o
    476 	${SYSTEM_LD_TAIL_STAGE1}
    477 	${CC} ${CFLAGS} ${CPPFLAGS} \
    478 	    -DSYMTAB_SPACE=$$(${DBSYM} -P ${.TARGET}${TARGETSFX}) \
    479 	    -c $S/kern/kern_ksyms_buf.c -o kern_ksyms_buf_real.o
    480 	${SYSTEM_LD_HEAD}
    481 	${SYSTEM_LD} kern_ksyms_buf_real.o
    482 	${SYSTEM_LD_TAIL_STAGE2}
    483 .endif
    484 
    485 .include <bsd.files.mk>
    486 .include <bsd.clang-analyze.mk>
    487 
    488 ##
    489 ## suffix rules
    490 ##
    491 
    492 .if defined(___USE_SUFFIX_RULES___)
    493 .SUFFIXES: .s .d
    494 .s.d:
    495 	${_MKTARGET_CREATE}
    496 	${MKDEP} -f $@.tmp -- ${MKDEP_AFLAGS} ${CPPFLAGS} ${CPPFLAGS.${<:T}} $<
    497 	mv -f $@.tmp $@
    498 
    499 .SUFFIXES: .S .d
    500 .S.d:
    501 	${_MKTARGET_CREATE}
    502 	${MKDEP} -f $@.tmp -- ${MKDEP_AFLAGS} ${CPPFLAGS} ${CPPFLAGS.${<:T}} $<
    503 	mv -f $@.tmp $@
    504 
    505 .SUFFIXES: .c .d
    506 .c.d:
    507 	${_MKTARGET_CREATE}
    508 	${MKDEP} -f $@.tmp -- ${MKDEP_CFLAGS} ${CPPFLAGS} ${CPPFLAGS.${<:T}} $<
    509 	mv -f $@.tmp $@
    510 
    511 .SUFFIXES: .c .o .go .po
    512 .c.o:
    513 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    514 	@${_MKSHECHO} ${KCOMPILE.c}
    515 	@${KCOMPILE.c}
    516 	@${COMPILE_CTFCONVERT}
    517 .c.go:
    518 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    519 	@${_MKSHECHO} ${KCOMPILE.c} -g
    520 	@${KCOMPILE.c} -g
    521 	@${COMPILE_CTFCONVERT}
    522 .c.po:
    523 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    524 	@${_MKSHECHO} ${KCOMPILE.c} -pg
    525 	@${KCOMPILE.c} -pg
    526 	@${COMPILE_CTFCONVERT}
    527 
    528 .SUFFIXES: .s .o .go .po
    529 .s.o:
    530 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    531 	@${_MKSHECHO} ${KCOMPILE.s}
    532 	@${KCOMPILE.s}
    533 .s.go:
    534 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    535 	@${_MKSHECHO} ${KCOMPILE.s} -g
    536 	@${KCOMPILE.s} -g
    537 .s.po:
    538 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    539 	@${_MKSHECHO} ${KCOMPILE.s} -pg
    540 	@${KCOMPILE.s} -pg
    541 
    542 .S.o:
    543 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    544 	@${_MKSHECHO} ${KCOMPILE.s}
    545 	@${KCOMPILE.s}
    546 .S.go:
    547 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    548 	@${_MKSHECHO} ${KCOMPILE.s} -g
    549 	@${KCOMPILE.s} -g
    550 .S.po:
    551 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    552 	@${_MKSHECHO} ${KCOMPILE.s} -pg
    553 	@${KCOMPILE.s} -pg
    554 .endif # ___USE_SUFFIX_RULES___
    555 
    556 ##
    557 ## the end
    558 ##
    559