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

Cache object: c874bc0085779ef912ffc9645706c3cd


[ 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.