2 # This is a makefile fragment that's supposed to set the following
5 # KERNEL_CFLAGS - CFLAGS for kernel code
6 # KERNEL_LDFLAGS - LDFLAGS for kernel code
8 # The bit-ness (32- or 64-bit) is selected by setting BITS to 32 or 64.
10 # The following can be tweaked to change up the KERNEL_CFLAGS variables:
12 # KERNEL_CFLAGS - CFLAGS used by both 32- & 64-bit
13 # KERNEL_CFLAGS_${BITS}
14 # KERNEL_CFLAGS_${CONFIG_MACH}
15 # KERNEL_CFLAGS_${CONFIG_MACH32}
16 # KERNEL_CFLAGS_${CONFIG_MACH64}
17 # - CFLAGS used by specific builds
18 # KERNEL_INCLUDES - -Ifoo directives used by all builds
19 # KERNEL_INCLUDES_${CONFIG_MACH}
20 # - -Ifoo directives for specific build
21 # KERNEL_LDFLAGS - LDFLAGS used by both 32- & 64-bit
27 # TODO: -fstack-protector will fail for 'unix'
32 -fno-inline-functions \
35 -fdiagnostics-show-option \
46 -Wno-unknown-pragmas \
47 -Wno-unused-parameter \
48 -Wno-missing-field-initializers \
49 -fno-inline-small-functions \
50 -fno-inline-functions-called-once \
59 # TODO: support for debug builds
60 # KERNEL_CFLAGS += -DDEBUG
69 KERNEL_CFLAGS_i386
= \
73 KERNEL_CFLAGS_amd64
= \
84 -fno-strict-aliasing \
86 -fno-optimize-sibling-calls \
91 KERNEL_CFLAGS_sparcv7
=
92 KERNEL_CFLAGS_sparcv9
=
95 -I
${SRCTOP}/usr
/src
/uts
/common \
96 -I
${SRCTOP}/arch
/${CONFIG_MACH}/include \
99 KERNEL_INCLUDES_amd64
= \
100 -I
${SRCTOP}/usr
/src
/uts
/intel
102 KERNEL_INCLUDES_sparc
=
105 ${KERNEL_CFLAGS_ALL} \
106 ${KERNEL_CFLAGS_
${BITS}} \
107 ${KERNEL_CFLAGS_
${CONFIG_MACH
${BITS}}} \
108 ${KERNEL_CFLAGS_
${CONFIG_MACH}} \
110 ${KERNEL_INCLUDES_
${CONFIG_MACH}}
121 CC
=/opt
/gcc
/4.4.4/bin
/gcc
123 CTFCONVERT
=/opt
/onbld
/bin
/i386
/ctfconvert
124 CTFMERGE
=/opt
/onbld
/bin
/i386
/ctfmerge
129 .if
${VERBOSE
:Uno
} != "yes"
130 CC
:= @echo
" CC ($${BITS}) $${.IMPSRC}";${CC}
131 LD
:= @echo
" LD ($${BITS}) $${.TARGET}";${LD}
132 CTFCONVERT
:= @
${CTFCONVERT}