[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ]

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

Version: -  FREEBSD  -  FREEBSD7  -  FREEBSD70  -  FREEBSD6  -  FREEBSD63  -  FREEBSD62  -  FREEBSD61  -  FREEBSD60  -  FREEBSD5  -  FREEBSD55  -  FREEBSD54  -  FREEBSD53  -  FREEBSD52  -  FREEBSD51  -  FREEBSD50  -  FREEBSD4  -  FREEBSD3  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  OPENSOLARIS  -  minix-3-1-1  -  TRUSTEDBSD-SEBSD  -  FREEBSD-LIBC  -  FREEBSD7-LIBC  -  FREEBSD6-LIBC  -  GLIBC27 
SearchContext: -  none  -  excerpts  -  bigexcerpts 

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

[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ]


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