[BACK]Return to Makefile.kern.inc CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / conf

Annotation of src/sys/conf/Makefile.kern.inc, Revision 1.113

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

CVSweb <webmaster@jp.NetBSD.org>