The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/conf/kern.pre.mk

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 # $FreeBSD: releng/8.4/sys/conf/kern.pre.mk 247670 2013-03-02 21:59:07Z np $
    2 
    3 # Part of a unified Makefile for building kernels.  This part contains all
    4 # of the definitions that need to be before %BEFORE_DEPEND.
    5 
    6 .include <bsd.own.mk>
    7 
    8 # Can be overridden by makeoptions or /etc/make.conf
    9 KERNEL_KO?=     kernel
   10 KERNEL?=        kernel
   11 KODIR?=         /boot/${KERNEL}
   12 LDSCRIPT_NAME?= ldscript.$M
   13 LDSCRIPT?=      $S/conf/${LDSCRIPT_NAME}
   14 
   15 M=      ${MACHINE_ARCH}
   16 
   17 AWK?=           awk
   18 CP?=            cp
   19 LINT?=          lint
   20 NM?=            nm
   21 OBJCOPY?=       objcopy
   22 SIZE?=          size
   23 
   24 .if ${CC} == "icc"
   25 COPTFLAGS?=     -O
   26 .else
   27 . if defined(DEBUG)
   28 _MINUS_O=       -O
   29 CTFFLAGS+=      -g
   30 . else
   31 _MINUS_O=       -O2
   32 . endif
   33 . if ${MACHINE_ARCH} == "amd64"
   34 COPTFLAGS?=-O2 -frename-registers -pipe
   35 . else
   36 COPTFLAGS?=${_MINUS_O} -pipe
   37 . endif
   38 . if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing)
   39 COPTFLAGS+= -fno-strict-aliasing
   40 . endif
   41 .endif
   42 .if !defined(NO_CPU_COPTFLAGS)
   43 . if ${CC} == "icc"
   44 COPTFLAGS+= ${_ICC_CPUCFLAGS:C/(-x[^M^K^W]+)[MKW]+|-x[MKW]+/\1/}
   45 . else
   46 COPTFLAGS+= ${_CPUCFLAGS}
   47 . endif
   48 .endif
   49 .if ${CC} == "icc"
   50 C_DIALECT=
   51 NOSTDINC= -X
   52 .else
   53 C_DIALECT= -std=c99
   54 NOSTDINC= -nostdinc
   55 .endif
   56 
   57 INCLUDES= ${NOSTDINC} ${INCLMAGIC} -I. -I$S
   58 
   59 # This hack lets us use the OpenBSD altq code without spamming a new
   60 # include path into contrib'ed source files.
   61 INCLUDES+= -I$S/contrib/altq
   62 
   63 .if make(depend) || make(kernel-depend)
   64 
   65 # ... and the same for ipfilter
   66 INCLUDES+= -I$S/contrib/ipfilter
   67 
   68 # ... and the same for pf
   69 INCLUDES+= -I$S/contrib/pf
   70 
   71 # ... and the same for ath
   72 INCLUDES+= -I$S/dev/ath -I$S/dev/ath/ath_hal
   73 
   74 # ... and the same for the NgATM stuff
   75 INCLUDES+= -I$S/contrib/ngatm
   76 
   77 # ... and the same for twa
   78 INCLUDES+= -I$S/dev/twa
   79 
   80 # ... and the same for XFS
   81 INCLUDES+= -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs
   82 
   83 # ... and the same for cxgb and cxgbe
   84 INCLUDES+= -I$S/dev/cxgb -I$S/dev/cxgbe
   85 
   86 .endif
   87 
   88 CFLAGS= ${COPTFLAGS} ${C_DIALECT} ${DEBUG} ${CWARNFLAGS}
   89 CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
   90 .if ${CC} != "icc"
   91 CFLAGS+= -fno-common -finline-limit=${INLINE_LIMIT}
   92 .if ${MACHINE_ARCH} != "mips"
   93 CFLAGS+= --param inline-unit-growth=100
   94 CFLAGS+= --param large-function-growth=1000
   95 .else
   96 # XXX Actually a gross hack just for Octeon because of the Simple Executive.
   97 CFLAGS+= --param inline-unit-growth=1000
   98 CFLAGS+= --param large-function-growth=100000
   99 .endif
  100 WERROR?= -Werror
  101 .endif
  102 
  103 # XXX LOCORE means "don't declare C stuff" not "for locore.s".
  104 ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS}
  105 
  106 .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1
  107 .if ${CC} == "icc"
  108 .error "Profiling doesn't work with icc yet"
  109 .endif
  110 CFLAGS+=        -DGPROF -falign-functions=16
  111 .if ${PROFLEVEL} >= 2
  112 CFLAGS+=        -DGPROF4 -DGUPROF
  113 PROF=   -pg -mprofiler-epilogue
  114 .else
  115 PROF=   -pg
  116 .endif
  117 .endif
  118 DEFINED_PROF=   ${PROF}
  119 
  120 # Put configuration-specific C flags last (except for ${PROF}) so that they
  121 # can override the others.
  122 CFLAGS+=        ${CONF_CFLAGS}
  123 
  124 # Optional linting. This can be overridden in /etc/make.conf.
  125 LINTFLAGS=      ${LINTOBJKERNFLAGS}
  126 
  127 NORMAL_C= ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
  128 NORMAL_S= ${CC} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}
  129 PROFILE_C= ${CC} -c ${CFLAGS} ${WERROR} ${.IMPSRC}
  130 NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${PROF} ${.IMPSRC}
  131 
  132 NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \
  133           ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c
  134 
  135 NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC}
  136 NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -warn-common -r \
  137         -o ${.TARGET} ${.ALLSRC:M*.fw}
  138 
  139 .if ${MK_CTF} != "no"
  140 NORMAL_CTFCONVERT=      ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
  141 .else
  142 NORMAL_CTFCONVERT=      @:
  143 .endif
  144 
  145 NORMAL_LINT=    ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC}
  146 
  147 GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/}
  148 SYSTEM_CFILES= config.c env.c hints.c vnode_if.c
  149 SYSTEM_DEP= Makefile ${SYSTEM_OBJS}
  150 SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS}
  151 SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o}
  152 SYSTEM_OBJS+= hack.So
  153 SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} --no-warn-mismatch \
  154         -warn-common -export-dynamic -dynamic-linker /red/herring \
  155         -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o
  156 SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \
  157         ${SIZE} ${.TARGET} ; chmod 755 ${.TARGET}
  158 SYSTEM_DEP+= ${LDSCRIPT}
  159 
  160 # MKMODULESENV is set here so that port makefiles can augment
  161 # them.
  162 
  163 MKMODULESENV=   MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR}
  164 .if (${KERN_IDENT} == LINT)
  165 MKMODULESENV+=  ALL_MODULES=LINT
  166 .endif
  167 .if defined(MODULES_OVERRIDE)
  168 MKMODULESENV+=  MODULES_OVERRIDE="${MODULES_OVERRIDE}"
  169 .endif
  170 .if defined(DEBUG)
  171 MKMODULESENV+=  DEBUG_FLAGS="${DEBUG}"
  172 .endif

Cache object: fbe591f2842113aa83f33b97edffc78d


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.