Makefile.kern.inc revision 1.278       1 #	$NetBSD: Makefile.kern.inc,v 1.278 2021/04/05 06:22:00 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 CWARNFLAGS.gcc+=	${GCC_NO_ADDR_OF_PACKED_MEMBER}
     98 
     99 CWARNFLAGS.ah_regdomain.c= ${${ACTIVE_CC} == "clang":? \
    100     -Wno-shift-count-negative -Wno-shift-count-overflow:}
    101 
    102 CWARNFLAGS.ioconf.c= ${${ACTIVE_CC} == "clang":? -Wno-unused-const-variable :}
    103 
    104 CFLAGS+=	-ffreestanding -fno-zero-initialized-in-bss
    105 CFLAGS+=	${${ACTIVE_CC} == "gcc":? -fno-delete-null-pointer-checks :}
    106 CFLAGS+=	${DEBUG} ${COPTS}
    107 AFLAGS+=	-D_LOCORE -Wa,--fatal-warnings
    108 
    109 # example usage to find largest stack users in kernel compile directory:
    110 #    find . -name \*.su | xargs awk '{ printf "%6d %s\n", $2, $1 }' | sort -n
    111 .if ${MACHINE} != "vax"
    112 # GCC/vax 8.4 does not support -fstack-usage.
    113 CFLAGS+=	${${ACTIVE_CC} == "gcc":? -fstack-usage -Wstack-usage=3584 :}
    114 .endif
    115 CWARNFLAGS+=	-Walloca
    116 
    117 # XXX
    118 .if defined(HAVE_GCC) || defined(HAVE_LLVM)
    119 CFLAGS+=	-fno-strict-aliasing
    120 CFLAGS+=	-fno-common
    121 .endif
    122 
    123 # Use the per-source COPTS variables to add -g to just those
    124 # files that match the shell patterns given in ${DEBUGLIST}
    125 #
    126 .for i in ${DEBUGLIST}
    127 . for j in ${ALLFILES:M*.c:T:M$i.c}
    128 COPTS.${j}+=-g
    129 . endfor
    130 .endfor
    131 
    132 # Always compile debugsyms.c with debug information.
    133 # This allows gdb to use type informations.
    134 #
    135 COPTS.debugsyms.c+=	-g
    136 
    137 # Add CTF sections for DTrace
    138 .if defined(CTFCONVERT)
    139 COMPILE_CTFCONVERT=	${_MKSHECHO}\
    140 			${CTFCONVERT} ${CTFFLAGS} ${.TARGET} && \
    141 			${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
    142 .else
    143 COMPILE_CTFCONVERT=	${_MKSHNOECHO}
    144 .endif
    145 
    146 KCOMPILE.c=	${CC} ${COPTS.${<:T}} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
    147 KCOMPILE.s=	${CC} ${AFLAGS} ${AFLAGS.${<:T}} ${CPPFLAGS} -c $< -o $@
    148 KLINK.o=	${LD} -r ${LINKFORMAT} -Map=${.TARGET}.map -o ${.TARGET} ${.ALLSRC}
    149 
    150 # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
    151 # NOPROF and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
    152 NORMAL_C?=	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}" && \
    153 		${_MKSHECHO} ${KCOMPILE.c} ${PROF} && \
    154 		${KCOMPILE.c} ${PROF} && \
    155 		${COMPILE_CTFCONVERT}
    156 NOPROF_C?=	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}" && \
    157 		${_MKSHECHO} ${KCOMPILE.c} && \
    158 		${KCOMPILE.c} && \
    159 		${COMPILE_CTFCONVERT}
    160 NORMAL_S?=	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}" && \
    161 		${_MKSHECHO} ${KCOMPILE.s} && \
    162 		${KCOMPILE.s}
    163 
    164 # link rules:
    165 LINK_O?=	@${_MKSHMSG} "   link  ${.CURDIR:T}/${.TARGET}" && \
    166 		${_MKSHECHO} ${KLINK.o} && \
    167 		${KLINK.o}
    168 
    169 ##
    170 ## (3) libkern
    171 ##
    172 ## Set OPT_MODULAR in the port Makefile if module(7) is enabled,
    173 ## as documented in $S/lib/libkern/Makefile.inc.
    174 ##
    175 
    176 ### find out what to use for libkern
    177 .include "$S/lib/libkern/Makefile.inc"
    178 .ifndef PROF
    179 LIBKERN?=	${KERNLIB}
    180 .else
    181 LIBKERN?=	${KERNLIB_PROF}
    182 .endif
    183 
    184 LIBKERNLN?=	${KERNLIBLN}
    185 
    186 ##
    187 ## (4) local objects, compile rules, and dependencies
    188 ##
    189 ## Each port should have a corresponding section with settings for
    190 ## MD_CFILES, MD_SFILES, and MD_OBJS, along with build rules for same.
    191 ##
    192 
    193 .if !defined(___USE_SUFFIX_RULES___)
    194 _MD_OBJS=	${MD_OBJS:T}
    195 .else
    196 _MD_OBJS=	${MD_OBJS}
    197 .endif
    198 
    199 ##
    200 ## (5) link settings
    201 ##
    202 ## TEXTADDR (or LOADADDRESS), LINKFORMAT, LINKSCRIPT, and any EXTRA_LINKFLAGS
    203 ## must be set in the port's Makefile.  The port specific definitions for
    204 ## LINKFLAGS_NORMAL and LINKFLAGS_DEBUG will added to the LINKFLAGS
    205 ## depending on the value of DEBUG.
    206 ##
    207 # load lines for config "xxx" will be emitted as:
    208 # xxx: ${SYSTEM_DEP} swapxxxx.o vers.o build_kernel
    209 
    210 SYSTEM_LIB=	${MD_LIBS} ${LIBKERN}
    211 SYSTEM_OBJ?=	${_MD_OBJS} ${OBJS} ${SYSTEM_LIB}
    212 SYSTEM_DEP+=	Makefile ${SYSTEM_OBJ:O}
    213 
    214 REMOVE_SWAP=   [@]
    215 .for k in ${KERNELS}
    216 REMOVE_SWAP:=  ${REMOVE_SWAP}:Nswap${k}.o
    217 .endfor
    218 
    219 SYSTEM_LD_HEAD?=@rm -f $@
    220 SYSTEM_LD?=	${_MKSHMSG} "   link  ${.CURDIR:T}/${.TARGET}"; \
    221 		${_MKSHECHO}\
    222 		${LD} -Map ${.TARGET}.map --cref ${LINKFLAGS} -o ${.TARGET} \
    223 		'$${SYSTEM_OBJ:${REMOVE_SWAP}}' '$${EXTRA_OBJ}' vers.o \
    224 		${OBJS:M*swap${.TARGET}.o}; \
    225 		${LD} -Map ${.TARGET}.map --cref ${LINKFLAGS} -o ${.TARGET} \
    226 		${SYSTEM_OBJ:${REMOVE_SWAP}} ${EXTRA_OBJ} vers.o \
    227 		${OBJS:M*swap${.TARGET}.o}
    228 
    229 TEXTADDR?=	${LOADADDRESS}			# backwards compatibility
    230 LINKTEXT?=	${TEXTADDR:C/.+/-Ttext &/}
    231 LINKDATA?=	${DATAADDR:C/.+/-Tdata &/}
    232 ENTRYPOINT?=	start
    233 LINKENTRY?=	${ENTRYPOINT:C/.+/-e &/}
    234 LINKFLAGS?=	${LINKFORMAT} ${LINKSCRIPT} ${LINKTEXT} ${LINKDATA} ${LINKENTRY} \
    235 		${EXTRA_LINKFLAGS}
    236 
    237 LINKFLAGS_DEBUG?=	-X
    238 
    239 SYSTEM_LD_TAIL?=@${TOOL_SED} '/const char sccs/!d;s/.*@(.)//;s/" "//;s/\\.*//' vers.c && \
    240 		${SIZE} $@ && chmod 755 $@
    241 SYSTEM_LD_TAIL_DEBUG?=&& \
    242 		echo mv -f $@ $@.gdb && mv -f $@ $@.gdb && \
    243 		echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb && \
    244 		${STRIP} ${STRIPFLAGS} -o $@ $@.gdb && \
    245 		chmod 755 $@ $@.gdb
    246 LINKFLAGS_NORMAL?=	-S
    247 STRIPFLAGS?=	-g
    248 
    249 DEBUG?=
    250 .if !empty(DEBUG:M-g*)
    251 SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_DEBUG}
    252 LINKFLAGS+=	${LINKFLAGS_DEBUG}
    253 EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.gdb@}
    254 CTFFLAGS+=	-g
    255 TARGETSFX=	.gdb
    256 .elifndef PROF
    257 LINKFLAGS+=	${LINKFLAGS_NORMAL}
    258 .endif
    259 
    260 SYSTEM_LD_HEAD+=	${SYSTEM_LD_HEAD_EXTRA}
    261 SYSTEM_LD_TAIL_STAGE1=	${SYSTEM_LD_TAIL}
    262 SYSTEM_LD_TAIL_STAGE2=	${SYSTEM_LD_TAIL}
    263 .if defined(CTFMERGE)
    264 SYSTEM_LD_TAIL_STAGE2+= && echo ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ... \
    265 			&& time -t ${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} \
    266 			    ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o
    267 .endif
    268 .if defined(COPY_SYMTAB)
    269 SYSTEM_LD_TAIL_STAGE2+=	&& echo ${DBSYM} $@ && ${DBSYM} $@
    270 .if !empty(DEBUG:M-g)
    271 SYSTEM_LD_TAIL_STAGE2+=	&& echo ${DBSYM} $@.gdb && ${DBSYM} $@.gdb
    272 .endif
    273 .endif
    274 SYSTEM_LD_TAIL_STAGE2+=	${SYSTEM_LD_TAIL_EXTRA}
    275 
    276 ##
    277 ## (6) port independent targets and dependencies: assym.h, vers.o
    278 ##
    279 
    280 .if !defined(___USE_SUFFIX_RULES___)
    281 
    282 # Generate list of *.o files to pass to ${LD}, preserving order.
    283 #	x/y/z/a.[csS] -> a.[csS]
    284 #	a.[csS] -> a.o
    285 OBJS=	${ALLFILES:C|^.*/([^/]*\.[csS])$|\1|:C|^(.*)\.[csS]$|\1.o|}
    286 
    287 CFILES=	${ALLFILES:M*.c}
    288 SFILES=	${ALLFILES:M*.[sS]}
    289 OFILES=	${ALLFILES:M*.o}
    290 # absolute, generated (build directory), relative (under $S)
    291 _CFILES=${CFILES:M/*} ${CFILES:N/*:N*/*} ${CFILES:N/*:M*/*:C|^|$S/|}
    292 _SFILES=${SFILES:M/*} ${SFILES:N/*:N*/*} ${SFILES:N/*:M*/*:C|^|$S/|}
    293 _MD_CFILES=${MD_CFILES}
    294 _MD_SFILES=${MD_SFILES}
    295 CSRCS=	${_MD_CFILES} ${_CFILES}
    296 SSRCS=	${_MD_SFILES} ${_SFILES}
    297 SRCS=	${CSRCS} ${SSRCS}
    298 
    299 .else # ___USE_SUFFIX_RULES___
    300 OBJS=	${ALLFILES:C|\.[csS]$|.o|}
    301 SRCS=	${ALLFILES:M*.[csS]}
    302 .endif # ___USE_SUFFIX_RULES___
    303 
    304 .if !defined(___USE_SUFFIX_RULES___)
    305 .for _s in ${_CFILES}
    306 .if !commands(${_s:T:R}.o)
    307 ${_s:T:R}.o: ${_s}
    308 	${NORMAL_C}
    309 .endif
    310 .endfor
    311 
    312 .for _s in ${_SFILES}
    313 .if !commands(${_s:T:R}.o)
    314 ${_s:T:R}.o: ${_s}
    315 	${NORMAL_S}
    316 .endif
    317 .endfor
    318 .endif # !___USE_SUFFIX_RULES___
    319 
    320 .include "${S}/conf/ldscript.mk"
    321 .include "${S}/conf/assym.mk"
    322 .include "${S}/conf/newvers.mk"
    323 .include "${S}/dev/splash/splash.mk"
    324 .include "${S}/conf/mdroot.mk"
    325 .include "${S}/conf/lint.mk"
    326 .include "${S}/conf/cscope.mk"
    327 .include "${S}/conf/gdbinit.mk"
    328 .include "${S}/conf/ssp.mk"
    329 .if "${_SKIP_DTS}" != "yes"
    330 .include "${S}/conf/dts.mk"
    331 .endif
    332 .include "${S}/conf/copts.mk"
    333 
    334 ##
    335 ## (7) misc targets: install, clean(dir), depend(all), lint, links, tags,
    336 ##                   cscope, mkid
    337 ##
    338 ## Any ports that have other stuff to be cleaned up should fill in
    339 ## EXTRA_CLEAN.  Some ports may want different settings for
    340 ## KERNLINTFLAGS, MKDEP_CFLAGS, or MKDEP_AFLAGS.
    341 ##
    342 
    343 ##
    344 ## clean
    345 ##
    346 
    347 .if !target(__CLEANKERNEL)
    348 __CLEANKERNEL: .USE
    349 	${_MKMSG} "${.TARGET}ing the kernel objects"
    350 	rm -f ${KERNELS} *.map *.[io] *.ko *.ln [a-z]*.s *.su vers.c \
    351 	    eddep tags [Ee]rrs linterrs makelinks assym.h.tmp assym.h \
    352 	    ${EXTRA_KERNELS} ${EXTRA_CLEAN}
    353 .endif
    354 
    355 .if !target(kernelnames)
    356 kernelnames:
    357 	@echo "${KERNELS} ${EXTRA_KERNELS}"
    358 .endif
    359 
    360 .if !target(__CLEANDEPEND)
    361 __CLEANDEPEND: .USE
    362 	echo .depend ${DEPS} | xargs rm -f --
    363 .endif
    364 
    365 # do not !target these, the kern and compat Makefiles augment them
    366 cleandir distclean: __CLEANKERNEL __CLEANDEPEND
    367 clean: __CLEANKERNEL
    368 depend: .depend
    369 dependall: depend .WAIT all
    370 
    371 ##
    372 ## depend
    373 ##
    374 
    375 .if !target(.depend)
    376 MKDEP_AFLAGS?=	${AFLAGS}
    377 MKDEP_CFLAGS?=	${CFLAGS}
    378 .if !defined(___USE_SUFFIX_RULES___)
    379 DEPS+=	${SRCS:T:R:S/$/.d/g}
    380 .else
    381 DEPS+=	${SRCS:R:S/$/.d/g}
    382 .endif
    383 
    384 .if !defined(___USE_SUFFIX_RULES___)
    385 .for _s in ${SSRCS}
    386 .if !commands(${_s:T:R}.d)
    387 ${_s:T:R}.d: ${_s}
    388 	${_MKTARGET_CREATE}
    389 	${MKDEP} -f ${.TARGET}.tmp -- ${MKDEP_AFLAGS} \
    390 	    ${CPPFLAGS} ${CPPFLAGS.${_s:T}} ${_s}
    391 	mv -f ${.TARGET}.tmp ${.TARGET}
    392 .endif
    393 .endfor
    394 
    395 .for _s in ${CSRCS}
    396 .if !commands(${_s:T:R}.d)
    397 ${_s:T:R}.d: ${_s}
    398 	${_MKTARGET_CREATE}
    399 	${MKDEP} -f ${.TARGET}.tmp -- ${MKDEP_CFLAGS} \
    400 	    ${CPPFLAGS} ${CPPFLAGS.${_s:T}} ${_s}
    401 	mv -f ${.TARGET}.tmp ${.TARGET}
    402 .endif
    403 .endfor
    404 .endif # !___USE_SUFFIX_RULES___
    405 
    406 .depend: ${DEPS:O}
    407 	${_MKTARGET_CREATE}
    408 	echo "${.ALLSRC}" | ${MKDEP} -D
    409 .endif
    410 
    411 ##
    412 ## install
    413 ##
    414 
    415 # List of kernel images that will be installed into the root file system.
    416 # Some platforms may need to install more than one (e.g. a netbsd.aout file
    417 # to be loaded directly by the firmware), so this can be overriden by them.
    418 KERNIMAGES?=	netbsd
    419 
    420 .if !target(install)
    421 # The install target can be redefined by putting a
    422 # install-kernel-${MACHINE_NAME} target into /etc/mk.conf
    423 MACHINE_NAME!=  uname -n
    424 install: install-kernel-${MACHINE_NAME}
    425 .if !target(install-kernel-${MACHINE_NAME})
    426 install-kernel-${MACHINE_NAME}:
    427 .for _K in ${KERNIMAGES}
    428 .if ${KERNEL_DIR:Uno} == "yes"
    429 	rm -fr ${DESTDIR}/o${_K}
    430 	mv ${DESTDIR}/${_K} ${DESTDIR}/o${_K}
    431 	mkdir -p ${DESTDIR}/${_K}
    432 	cp ${_K} ${DESTDIR}/${_K}/kernel
    433 .else
    434 	rm -f ${DESTDIR}/o${_K}
    435 	ln ${DESTDIR}/${_K} ${DESTDIR}/o${_K}
    436 	cp ${_K} ${DESTDIR}/n${_K}
    437 	mv ${DESTDIR}/n${_K} ${DESTDIR}/${_K}
    438 .endif
    439 .endfor
    440 .endif
    441 .endif
    442 
    443 ##
    444 ## the kernel
    445 ##
    446 
    447 AFLAGS+=	${AOPTS.${.IMPSRC:T}}
    448 CFLAGS+=	${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}}
    449 CPPFLAGS+=	${CPPFLAGS.${.IMPSRC:T}}
    450 CWARNFLAGS+=	${CWARNFLAGS.${.IMPSRC:T}}
    451 
    452 .for _v in CFLAGS CPPFLAGS CWARNFLAGS
    453 .for _c in ${CSRCS}
    454 ${_v}.${_c:T}+=${OPT.${_c:T}:@.o.@${${_v}.${.o.}}@}
    455 .endfor
    456 .endfor
    457 
    458 .MAIN: all
    459 all: .gdbinit
    460 .for k in ${KERNELS}
    461 all: .WAIT ${k}
    462 ${k}: ${SYSTEM_DEP:O} swap${k}.o vers.o build_kernel
    463 .endfor
    464 
    465 .if !defined(COPY_SYMTAB)
    466 build_kernel: .USE
    467 	${SYSTEM_LD_HEAD}
    468 	${SYSTEM_LD}
    469 	${SYSTEM_LD_TAIL_STAGE2}
    470 .else
    471 .for k in ${KERNELS}
    472 ${k}: $S/kern/kern_ksyms_buf.c
    473 .endfor
    474 build_kernel: .USE
    475 	${CC} ${CFLAGS} ${CPPFLAGS} \
    476 	    -c $S/kern/kern_ksyms_buf.c -o kern_ksyms_buf.o
    477 	${SYSTEM_LD_HEAD}
    478 	${SYSTEM_LD} kern_ksyms_buf.o
    479 	${SYSTEM_LD_TAIL_STAGE1}
    480 	${CC} ${CFLAGS} ${CPPFLAGS} \
    481 	    -DSYMTAB_SPACE=$$(${DBSYM} -P ${.TARGET}${TARGETSFX}) \
    482 	    -c $S/kern/kern_ksyms_buf.c -o kern_ksyms_buf_real.o
    483 	${SYSTEM_LD_HEAD}
    484 	${SYSTEM_LD} kern_ksyms_buf_real.o
    485 	${SYSTEM_LD_TAIL_STAGE2}
    486 .endif
    487 
    488 .include <bsd.files.mk>
    489 .include <bsd.clang-analyze.mk>
    490 
    491 ##
    492 ## suffix rules
    493 ##
    494 
    495 .if defined(___USE_SUFFIX_RULES___)
    496 .SUFFIXES: .s .d
    497 .s.d:
    498 	${_MKTARGET_CREATE}
    499 	${MKDEP} -f $@.tmp -- ${MKDEP_AFLAGS} ${CPPFLAGS} ${CPPFLAGS.${<:T}} $<
    500 	mv -f $@.tmp $@
    501 
    502 .SUFFIXES: .S .d
    503 .S.d:
    504 	${_MKTARGET_CREATE}
    505 	${MKDEP} -f $@.tmp -- ${MKDEP_AFLAGS} ${CPPFLAGS} ${CPPFLAGS.${<:T}} $<
    506 	mv -f $@.tmp $@
    507 
    508 .SUFFIXES: .c .d
    509 .c.d:
    510 	${_MKTARGET_CREATE}
    511 	${MKDEP} -f $@.tmp -- ${MKDEP_CFLAGS} ${CPPFLAGS} ${CPPFLAGS.${<:T}} $<
    512 	mv -f $@.tmp $@
    513 
    514 .SUFFIXES: .c .o .go .po
    515 .c.o:
    516 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    517 	@${_MKSHECHO} ${KCOMPILE.c}
    518 	@${KCOMPILE.c}
    519 	@${COMPILE_CTFCONVERT}
    520 .c.go:
    521 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    522 	@${_MKSHECHO} ${KCOMPILE.c} -g
    523 	@${KCOMPILE.c} -g
    524 	@${COMPILE_CTFCONVERT}
    525 .c.po:
    526 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    527 	@${_MKSHECHO} ${KCOMPILE.c} -pg
    528 	@${KCOMPILE.c} -pg
    529 	@${COMPILE_CTFCONVERT}
    530 
    531 .SUFFIXES: .s .o .go .po
    532 .s.o:
    533 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    534 	@${_MKSHECHO} ${KCOMPILE.s}
    535 	@${KCOMPILE.s}
    536 .s.go:
    537 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    538 	@${_MKSHECHO} ${KCOMPILE.s} -g
    539 	@${KCOMPILE.s} -g
    540 .s.po:
    541 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    542 	@${_MKSHECHO} ${KCOMPILE.s} -pg
    543 	@${KCOMPILE.s} -pg
    544 
    545 .S.o:
    546 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    547 	@${_MKSHECHO} ${KCOMPILE.s}
    548 	@${KCOMPILE.s}
    549 .S.go:
    550 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    551 	@${_MKSHECHO} ${KCOMPILE.s} -g
    552 	@${KCOMPILE.s} -g
    553 .S.po:
    554 	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"
    555 	@${_MKSHECHO} ${KCOMPILE.s} -pg
    556 	@${KCOMPILE.s} -pg
    557 .endif # ___USE_SUFFIX_RULES___
    558 
    559 ##
    560 ## the end
    561 ##
    562