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
= \
77 KERNEL_CFLAGS_amd64
= \
86 -fno-strict-aliasing \
88 -fno-optimize-sibling-calls \
93 KERNEL_CFLAGS_sparcv7
=
94 KERNEL_CFLAGS_sparcv9
=
97 -I
${SRCTOP}/usr
/src
/uts
/common \
98 -I
${SRCTOP}/arch
/${CONFIG_MACH}/include \
101 KERNEL_INCLUDES_i386
= \
102 -I
${SRCTOP}/usr
/src
/uts
/intel
104 KERNEL_INCLUDES_sparc
=
107 ${KERNEL_CFLAGS_ALL} \
108 ${KERNEL_CFLAGS_
${BITS}} \
109 ${KERNEL_CFLAGS_
${CONFIG_MACH
${BITS}}} \
110 ${KERNEL_CFLAGS_
${CONFIG_MACH}} \
112 ${KERNEL_INCLUDES_
${CONFIG_MACH}}
123 CC
=/opt
/gcc
/4.4.4/bin
/gcc
125 CTFCONVERT
=/opt
/onbld
/bin
/i386
/ctfconvert
126 CTFMERGE
=/opt
/onbld
/bin
/i386
/ctfmerge
131 .if
${VERBOSE
:Uno
} != "yes"
132 CC
:= @echo
" CC ($${BITS}) $${.IMPSRC}";${CC}
133 LD
:= @echo
" LD ($${BITS}) $${.TARGET}";${LD}
134 CTFCONVERT
:= @
${CTFCONVERT}