Home | History | Annotate | Line # | Download | only in conf
Makefile.kern.inc revision 1.111.4.2
      1 #	$NetBSD: Makefile.kern.inc,v 1.111.4.2 2009/05/04 08:12:29 yamt 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 ##
     21 ## (0) toolchain settings for things that aren't part of the standard
     22 ## toolchain
     23 ##
     24 HOST_SH?=	sh
     25 DBSYM?=		dbsym
     26 MKDEP?=		mkdep
     27 STRIP?=		strip
     28 OBJCOPY?=	objcopy
     29 OBJDUMP?=	objdump
     30 CSCOPE?=	cscope
     31 MKID?=		mkid
     32 UUDECODE?=	${TOOL_UUDECODE:Uuudecode}
     33 HEXDUMP?=	${TOOL_HEXDUMP:Uhexdump}
     34 GENASSYM?=	${TOOL_GENASSYM:Ugenassym}
     35 .MAKEOVERRIDES+=USETOOLS	# make sure proper value is propagated
     36 
     37 _MKMSG?=		@\#
     38 _MKSHMSG?=		echo
     39 _MKSHECHO?=		echo
     40 _MKMSG_CREATE?=		:
     41 _MKTARGET_COMPILE?=	:
     42 _MKTARGET_CREATE?=	:
     43 
     44 ##
     45 ## (1) port independent source tree identification
     46 ##
     47 # source tree is located via $S relative to the compilation directory
     48 .ifndef S
     49 S!=	cd ../../../..; pwd
     50 .endif
     51 
     52 ##
     53 ## (2) compile settings
     54 ##
     55 ## CPPFLAGS, CFLAGS, and AFLAGS must be set in the port's Makefile
     56 ##
     57 INCLUDES?=	-I. ${EXTRA_INCLUDES} -I${S}/../common/include -I$S/arch \
     58 		-I$S -nostdinc
     59 CPPFLAGS+=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT
     60 DEFCOPTS?=	-O2
     61 COPTS?=		${DEFCOPTS}
     62 COPTS+=		-std=gnu99
     63 DBG=		# might contain unwanted -Ofoo
     64 DEFWARNINGS?=	yes
     65 .if (${DEFWARNINGS} == "yes")
     66 . if !defined(NOGCCERROR)
     67 CWARNFLAGS+=	-Werror
     68 . endif
     69 CWARNFLAGS+=	-Wall -Wno-main -Wno-format-zero-length -Wpointer-arith
     70 CWARNFLAGS+=	-Wmissing-prototypes -Wstrict-prototypes
     71 CWARNFLAGS+=	-Wswitch -Wshadow
     72 CWARNFLAGS+=	-Wcast-qual -Wwrite-strings
     73 CWARNFLAGS+=	-Wno-unreachable-code
     74 # Add -Wno-sign-compare.  -Wsign-compare is included in -Wall as of GCC 3.3,
     75 # but our sources aren't up for it yet.
     76 CWARNFLAGS+=	-Wno-sign-compare
     77 . if (defined(HAVE_GCC) && ${HAVE_GCC} > 3) || defined(HAVE_PCC)
     78 CWARNFLAGS+=	-Wno-pointer-sign -Wno-attributes
     79 .  if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "x86_64" || \
     80 	${MACHINE_ARCH} == "sparc64" || ${MACHINE} == "prep"
     81 CWARNFLAGS+=	-Wextra -Wno-unused-parameter
     82 .  endif
     83 . endif
     84 .endif
     85 
     86 CFLAGS+=	-ffreestanding -fno-zero-initialized-in-bss
     87 CFLAGS+=	${DEBUG} ${COPTS}
     88 AFLAGS+=	-D_LOCORE -Wa,-fatal-warnings
     89 
     90 # XXX
     91 .if defined(HAVE_GCC) && ${HAVE_GCC} > 3
     92 CFLAGS+=	-fno-strict-aliasing
     93 .endif
     94 
     95 .if ${USE_SSP:Uno} == "yes"
     96 CFLAGS+=-fstack-protector -Wstack-protector --param ssp-buffer-size=1
     97 LDFLAGS+=-fstack-protector -Wstack-protector --param ssp-buffer-size=1
     98 COPTS.kern_ssp.c+=	-fno-stack-protector -D__SSP__
     99 .endif
    100 
    101 # If we want the bpendtsleep: label in kern_synch.c, we need to use
    102 # -fno-reorder-blocks.  Don't make this a config(1) defflag without
    103 # making sure this fragment remains valid.
    104 .if defined(HAVE_GCC) && ${HAVE_GCC} > 3 && \
    105 	!empty(${CFLAGS:M-DKERN_SYNCH_BPENDTSLEEP_LABEL})
    106 COPTS.kern_synch.c+=	-fno-reorder-blocks
    107 .endif
    108 
    109 # Use the per-source COPTS variables to add -g to just those
    110 # files that match the shell patterns given in ${DEBUGLIST}
    111 #
    112 .for i in ${DEBUGLIST}
    113 . for j in ${CFILES:T:M$i.c}
    114 COPTS.${j}+=-g
    115 . endfor
    116 .endfor
    117 
    118 # Always compile subr_debug_info.c with debug informations.
    119 # This allows gdb to use type informations.
    120 #
    121 COPTS.debugsyms.c+=	-g
    122 
    123 # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
    124 # NOPROF and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
    125 NORMAL_C?=	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"; \
    126 		${_MKSHECHO}\
    127 		${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<; \
    128 		${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
    129 NOPROF_C?=	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"; \
    130 		${_MKSHECHO}\
    131 		${CC} ${CFLAGS} ${CPPFLAGS} -c $<; \
    132 		${CC} ${CFLAGS} ${CPPFLAGS} -c $<
    133 NORMAL_S?=	@${_MKSHMSG} "compile  ${.CURDIR:T}/${.TARGET}"; \
    134 		${_MKSHECHO}\
    135 		${CC} ${AFLAGS} ${CPPFLAGS} -c $<; \
    136 		${CC} ${AFLAGS} ${CPPFLAGS} -c $<
    137 
    138 ##
    139 ## (3) libkern and compat
    140 ##
    141 ## Set KERN_AS in the port Makefile to "obj" or "library".  The
    142 ## default is "library", as documented in $S/lib/libkern/Makefile.inc.
    143 ##
    144 
    145 ### find out what to use for libkern
    146 .include "$S/lib/libkern/Makefile.inc"
    147 .ifndef PROF
    148 LIBKERN?=	${KERNLIB}
    149 .else
    150 LIBKERN?=	${KERNLIB_PROF}
    151 .endif
    152 
    153 LIBKERNLN?=	${KERNLIBLN}
    154 
    155 ### find out what to use for libcompat
    156 .include "$S/compat/common/Makefile.inc"
    157 .ifndef PROF
    158 SYSLIBCOMPAT?=	${COMPATLIB}
    159 .else
    160 SYSLIBCOMPAT?=	${COMPATLIB_PROF}
    161 .endif
    162 
    163 SYSLIBCOMPATLN?=	${COMPATLIBLN}
    164 
    165 ##
    166 ## (4) local objects, compile rules, and dependencies
    167 ##
    168 ## Each port should have a corresponding section with settings for
    169 ## MD_CFILES, MD_SFILES, and MD_OBJS, along with build rules for same.
    170 ##
    171 MI_CFILES=devsw.c ioconf.c param.c
    172 # the need for a MI_SFILES variable is dubitable at best
    173 MI_OBJS=${MI_CFILES:S/.c/.o/}
    174 
    175 param.c: $S/conf/param.c
    176 	${_MKTARGET_CREATE}
    177 	rm -f param.c
    178 	cp $S/conf/param.c .
    179 
    180 param.o: Makefile
    181 
    182 .for _cfile in ${MI_CFILES}
    183 ${_cfile:T:R}.o: ${_cfile}
    184 	${NORMAL_C}
    185 .endfor
    186 
    187 ##
    188 ## (5) link settings
    189 ##
    190 ## TEXTADDR (or LOADADDRESS), LINKFORMAT, and any EXTRA_LINKFLAGS must
    191 ## be set in the port's Makefile.  The port specific definitions for
    192 ## LINKFLAGS_NORMAL and LINKFLAGS_DEBUG will added to the LINKFLAGS
    193 ## depending on the value of DEBUG.
    194 ##
    195 # load lines for config "xxx" will be emitted as:
    196 # xxx: ${SYSTEM_DEP} swapxxx.o
    197 #	${SYSTEM_LD_HEAD}
    198 #	${SYSTEM_LD} swapxxx.o
    199 #	${SYSTEM_LD_TAIL}
    200 SYSTEM_OBJ?=	${MD_OBJS} ${MI_OBJS} ${OBJS:O} ${SYSLIBCOMPAT} ${LIBKERN}
    201 SYSTEM_DEP?=	Makefile ${SYSTEM_OBJ:O} .gdbinit
    202 SYSTEM_LD_HEAD?=@rm -f $@
    203 SYSTEM_LD?=	@${_MKSHMSG} "   link  ${.CURDIR:T}/${.TARGET}"; \
    204 		${_MKSHECHO}\
    205 		${LD} -Map $@.map --cref ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' '$${EXTRA_OBJ}' vers.o; \
    206 		${LD} -Map $@.map --cref ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o
    207 SYSTEM_LD_TAIL?=@${TOOL_SED} '/const char sccs/!d;s/.*@(.)//;s/\\.*//' vers.c; \
    208 		${SIZE} $@; chmod 755 $@
    209 
    210 TEXTADDR?=	${LOADADDRESS}			# backwards compatibility
    211 LINKTEXT?=	${TEXTADDR:C/.+/-Ttext &/}
    212 LINKDATA?=	${DATAADDR:C/.+/-Tdata &/}
    213 ENTRYPOINT?=	start
    214 LINKENTRY?=	${ENTRYPOINT:C/.+/-e &/}
    215 LINKFLAGS?=	${LINKFORMAT} ${LINKTEXT} ${LINKDATA} ${LINKENTRY} \
    216 		${EXTRA_LINKFLAGS}
    217 
    218 LINKFLAGS_DEBUG?=	-X
    219 SYSTEM_LD_TAIL_DEBUG?=; \
    220 		echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \
    221 		echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
    222 		${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
    223 LINKFLAGS_NORMAL?=	-S
    224 STRIPFLAGS?=	-g
    225 
    226 DEBUG?=
    227 .if !empty(DEBUG:M-g*)
    228 SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_DEBUG}
    229 LINKFLAGS+=	${LINKFLAGS_DEBUG}
    230 EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.gdb@}
    231 .elifndef PROF
    232 LINKFLAGS+=	${LINKFLAGS_NORMAL}
    233 .endif
    234 
    235 SYSTEM_LD_TAIL+=; \
    236 	if grep '^\#define.*SYMTAB_SPACE' opt_ddbparam.h > /dev/null; then \
    237 		echo "${DBSYM} $@"; \
    238 		${DBSYM} $@; \
    239 	fi
    240 
    241 SYSTEM_LD_HEAD+=${SYSTEM_LD_HEAD_EXTRA}
    242 SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_EXTRA}
    243 
    244 ##
    245 ## (6) port independent targets and dependencies: assym.h, vers.o
    246 ##
    247 .if !target(assym.h)
    248 assym.h: ${GENASSYM_CONF} ${GENASSYM_EXTRAS}
    249 	${_MKTARGET_CREATE}
    250 	cat ${GENASSYM_CONF} ${GENASSYM_EXTRAS} | \
    251 	    ${GENASSYM} -- ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
    252 	    > assym.h.tmp && \
    253 	mv -f assym.h.tmp assym.h
    254 ${MD_SFILES:C/\.[Ss]/.o/} ${SFILES:C/\.[Ss]/.o/}: assym.h
    255 .endif
    256 
    257 MKREPRO?=no
    258 
    259 .if ${MKREPRO} == "yes"
    260 _NVFLAGS=-r
    261 .else
    262 _NVFLAGS=
    263 .endif
    264 
    265 .if !target(vers.o)
    266 newvers: vers.o
    267 vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} $S/conf/newvers.sh $S/conf/osrelease.sh
    268 	${_MKMSG_CREATE} vers.c
    269 	${HOST_SH} $S/conf/newvers.sh ${_NVFLAGS}
    270 	${_MKTARGET_COMPILE}
    271 	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
    272 .endif
    273 
    274 .if !target(config_time.h)
    275 BUILDSYMLINKS+=	config_time.src config_time.h
    276 .endif
    277 
    278 .if defined(MEMORY_DISK_IMAGE)
    279 md_root_image.h: ${MEMORY_DISK_IMAGE}
    280 	${_MKTARGET_CREATE}
    281 	${TOOL_HEXDUMP} -v -e '"\t" 8/1 "0x%02x, " "\n"' ${.ALLSRC} > ${.TARGET}
    282 
    283 # XXX This is only needed when building md_root.o
    284 CPPFLAGS+=	-DMEMORY_DISK_IMAGE
    285 md_root.o: md_root_image.h
    286 .endif
    287 
    288 # depend on MEMORY_DISK_IMAGE configuration
    289 md_root.o: Makefile
    290 
    291 # depend on root or device configuration
    292 autoconf.o conf.o: Makefile
    293 
    294 # depend on network or filesystem configuration
    295 uipc_proto.o vfs_conf.o: Makefile
    296 
    297 # depend on maxusers and CPU configuration
    298 assym.h machdep.o: Makefile
    299 
    300 ##
    301 ## (7) misc targets: install, clean(dir), depend(all), lint, links, tags,
    302 ##                   cscope, mkid
    303 ##
    304 ## Any ports that have other stuff to be cleaned up should fill in
    305 ## EXTRA_CLEAN.  Some ports may want different settings for
    306 ## KERNLINTFLAGS, MKDEP_CFLAGS, or MKDEP_AFLAGS.
    307 ##
    308 .if !target(__CLEANKERNEL)
    309 __CLEANKERNEL: .USE
    310 	${_MKMSG} "${.TARGET}ing the kernel objects"
    311 	rm -f ${KERNELS} eddep tags *.[io] *.ln [a-z]*.s vers.c \
    312 	    [Ee]rrs linterrs makelinks assym.h.tmp assym.h \
    313 	    ${EXTRA_KERNELS} ${EXTRA_CLEAN}
    314 .endif
    315 
    316 .if !target(kernelnames)
    317 kernelnames:
    318 	@echo "${KERNELS} ${EXTRA_KERNELS}"
    319 .endif
    320 
    321 .if !target(__CLEANDEPEND)
    322 __CLEANDEPEND: .USE
    323 	echo .depend ${DEPS} | xargs rm -f --
    324 .endif
    325 
    326 # do not !target these, the kern and compat Makefiles augment them
    327 cleandir distclean: __CLEANKERNEL __CLEANDEPEND
    328 clean: __CLEANKERNEL
    329 depend: .depend
    330 dependall: depend .WAIT all
    331 
    332 .if !target(.depend)
    333 MKDEP_AFLAGS?=	${AFLAGS}
    334 MKDEP_CFLAGS?=	${CFLAGS}
    335 SSRCS=${MD_SFILES} ${SFILES}
    336 CSRCS=${MD_CFILES} ${MI_CFILES} ${CFILES}
    337 SRCS=${SSRCS} ${CSRCS}
    338 DEPS=	${SRCS:T:O:u:R:S/$/.d/g}
    339 
    340 .for _s in ${SSRCS}
    341 ${_s:T:R}.d: ${_s} assym.h
    342 	${_MKTARGET_CREATE}
    343 	${MKDEP} -f ${.TARGET} -- ${MKDEP_AFLAGS} \
    344 	    ${CPPFLAGS} ${CPPFLAGS.${_s:T}} ${_s}
    345 .endfor
    346 .for _s in ${CSRCS}
    347 ${_s:T:R}.d: ${_s}
    348 	${_MKTARGET_CREATE}
    349 	${MKDEP} -f ${.TARGET} -- ${MKDEP_CFLAGS} \
    350 	    ${CPPFLAGS} ${CPPFLAGS.${_s:T}} ${_s}
    351 .endfor
    352 
    353 assym.d: assym.h
    354 	${_MKTARGET_CREATE}
    355 	cat ${GENASSYM_CONF} ${GENASSYM_EXTRAS} | \
    356 	    ${GENASSYM} -- ${MKDEP} -f assym.dep -- \
    357 	    ${CFLAGS} ${CPPFLAGS}
    358 	${TOOL_SED} -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >${.TARGET}
    359 	rm -f assym.dep
    360 
    361 DEPS+=	assym.d
    362 
    363 .depend: ${DEPS}
    364 	${_MKTARGET_CREATE}
    365 	echo "${.ALLSRC}" | ${MKDEP} -D
    366 .endif
    367 
    368 .if !target(lint)
    369 ALLSFILES?=	${MD_SFILES} ${SFILES}
    370 LINTSTUBS?=	${ALLSFILES:T:R:C/^.*$/LintStub_&.c/g}
    371 KERNLINTFLAGS?=	-bcehnxzFS
    372 NORMAL_LN?=	${LINT} ${KERNLINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i $<
    373 
    374 _lsrc=${CFILES} ${LINTSTUBS} ${MI_CFILES} ${MD_CFILES}
    375 LOBJS?= ${_lsrc:T:S/.c$/.ln/g} ${LIBKERNLN} ${SYSLIBCOMPATLN}
    376 
    377 .for _sfile in ${ALLSFILES}
    378 LintStub_${_sfile:T:R}.c: ${_sfile} assym.h
    379 	${_MKTARGET_COMPILE}
    380 	${CC} -E -C ${AFLAGS} ${CPPFLAGS} ${_sfile} | \
    381 	      ${TOOL_AWK} -f $S/kern/genlintstub.awk >${.TARGET}
    382 .endfor
    383 
    384 .for _cfile in ${CFILES} ${LINTSTUBS} ${MI_CFILES} ${MD_CFILES}
    385 ${_cfile:T:R}.ln: ${_cfile}
    386 	${_MKTARGET_COMPILE}
    387 	${NORMAL_LN}
    388 .endfor
    389 
    390 lint: ${LOBJS}
    391 	${LINT} ${KERNLINTFLAGS} ${CPPFLAGS:M-[IDU]*} ${LOBJS}
    392 .endif
    393 
    394 # Attempt to do a syntax-only compile of the entire kernel as one entity.
    395 # Alas, bugs in the GCC C frontend prevent this from completely effective
    396 # but information can be gleaned from the output.
    397 syntax-only: ${CFILES} ${MD_CFILES}
    398 	${CC} -fsyntax-only -combine ${CFLAGS} ${CPPFLAGS} \
    399 		${CFILES} ${MD_CFILES}
    400 
    401 # List of kernel images that will be installed into the root file system.
    402 # Some platforms may need to install more than one (e.g. a netbsd.aout file
    403 # to be loaded directly by the firmware), so this can be overriden by them.
    404 KERNIMAGES?=	netbsd
    405 
    406 .if !target(install)
    407 # The install target can be redefined by putting a
    408 # install-kernel-${MACHINE_NAME} target into /etc/mk.conf
    409 MACHINE_NAME!=  uname -n
    410 install: install-kernel-${MACHINE_NAME}
    411 .if !target(install-kernel-${MACHINE_NAME})
    412 install-kernel-${MACHINE_NAME}:
    413 .for _K in ${KERNIMAGES}
    414 	rm -f ${DESTDIR}/o${_K}
    415 	ln ${DESTDIR}/${_K} ${DESTDIR}/o${_K}
    416 	cp ${_K} ${DESTDIR}/n${_K}
    417 	mv ${DESTDIR}/n${_K} ${DESTDIR}/${_K}
    418 .endfor
    419 .endif
    420 .endif
    421 
    422 .if !target(tags)
    423 tags:
    424 	@echo "see $S/kern/Makefile for tags"
    425 .endif
    426 
    427 EXTRA_CLEAN+= cscope.out cscope.tmp
    428 .if !target(cscope.out)
    429 cscope.out: Makefile depend
    430 	${_MKTARGET_CREATE}
    431 	@${TOOL_SED} 's/[^:]*://;s/^ *//;s/ *\\ *$$//;' lib/kern/.depend \
    432 	    | tr -s ' ' '\n' \
    433 	    | ${TOOL_SED} ';s|^../../||;' \
    434 	    > cscope.tmp
    435 	@${TOOL_SED} 's/[^:]*://;s/^ *//;s/ *\\ *$$//;' lib/compat/.depend \
    436 	    | tr -s ' ' '\n' \
    437 	    | ${TOOL_SED} 's|^../../||;' \
    438 	    >> cscope.tmp
    439 	@echo ${SRCS} | cat - cscope.tmp | tr -s ' ' '\n' | sort -u | \
    440 	    ${CSCOPE} -k -i - -b `echo ${INCLUDES} | ${TOOL_SED} s/-nostdinc//`
    441 #	cscope doesn't write cscope.out if it's uptodate, so ensure
    442 #	make doesn't keep calling cscope when not needed.
    443 	@rm -f cscope.tmp; touch cscope.out
    444 .endif
    445 
    446 .if !target(cscope)
    447 cscope: cscope.out
    448 	@${CSCOPE} -d
    449 .endif
    450 
    451 EXTRA_CLEAN+= ID
    452 .if !target(mkid)
    453 .PHONY: mkid
    454 mkid: ID
    455 
    456 ID: Makefile depend
    457 	${_MKTARGET_CREATE}
    458 	@${MKID} \
    459 	    `${TOOL_SED} 's/[^:]*://;s/^ *//;s/ *\\\\ *$$//;' \
    460 			lib/kern/.depend lib/compat/.depend \
    461 		    | tr ' ' '\n' \
    462 		    | ${TOOL_SED} "s|^../../||" \
    463 		    | sort -u` \
    464 	    `${TOOL_SED} 's/[^:]*://;s/^ *//;s/ *\\\\ *$$//;' \
    465 			.depend \
    466 		    | tr ' ' '\n' \
    467 		    | sort -u`
    468 
    469 .endif
    470 
    471 .include "${S}/gdbscripts/Makefile.inc"
    472 
    473 EXTRA_CLEAN+= .gdbinit
    474 .gdbinit: Makefile ${S}/gdbscripts/Makefile.inc
    475 	${_MKTARGET_CREATE}
    476 	rm -f .gdbinit
    477 .for __gdbinit in ${SYS_GDBINIT}
    478 	echo "source ${S}/gdbscripts/${__gdbinit}" >> .gdbinit
    479 .endfor
    480 .if defined(GDBINIT) && !empty(GDBINIT)
    481 .for __gdbinit in ${GDBINIT}
    482 	echo "source ${__gdbinit}" >> .gdbinit
    483 .endfor
    484 .endif
    485 
    486 # The following files use alloca(3) or variable array allocations.
    487 # Their full name is noted as documentation.
    488 VARSTACK=dev/cgd.c kern/uipc_socket.c miscfs/genfs/genfs_vnops.c \
    489     nfs/nfs_bio.c uvm/uvm_bio.c \
    490     uvm/uvm_pager.c dev/ic/aic7xxx.c dev/ic/aic79xx.c arch/xen/i386/gdt.c \
    491     dev/ofw/ofw_subr.c
    492 
    493 . if (defined(HAVE_GCC) && ${HAVE_GCC} > 3) || defined(HAVE_PCC)
    494 .for __varstack in ${VARSTACK}
    495 COPTS.${__varstack:T} += -Wno-stack-protector
    496 .endfor
    497 .endif
    498 
    499 AFLAGS+=	${AOPTS.${.IMPSRC:T}}
    500 CFLAGS+=	${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}}
    501 CPPFLAGS+=	${CPPFLAGS.${.IMPSRC:T}}
    502 CWARNFLAGS+=	${CWARNFLAGS.${.IMPSRC:T}}
    503 
    504 .include <bsd.files.mk>
    505 
    506 ##
    507 ## the end
    508 ##
    509