tools: stop building tools version of ctf{diff,dump,convert,merge}
[unleashed.git] / kernel / mk / defines.mk
blob7d9aef7ca7fcb06d40be45ab971c65e394fbb761
2 # This is a makefile fragment that's supposed to set the following
3 # variables:
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
25 # CFLAGS
27 # TODO: -fstack-protector will fail for 'unix'
28 KERNEL_CFLAGS_ALL = \
29 -pipe \
30 -fident \
31 -finline \
32 -fno-inline-functions \
33 -fno-builtin \
34 -fno-asm \
35 -fdiagnostics-show-option \
36 -nodefaultlibs \
37 -D_ASM_INLINES \
38 -ffreestanding \
39 -std=gnu99 \
40 -g \
41 -Wall \
42 -Wextra \
43 -Werror \
44 -Wno-missing-braces \
45 -Wno-sign-compare \
46 -Wno-unknown-pragmas \
47 -Wno-unused-parameter \
48 -Wno-missing-field-initializers \
49 -fno-inline-small-functions \
50 -fno-inline-functions-called-once \
51 -fno-ipa-cp \
52 -fstack-protector \
53 -D_KERNEL \
54 -D_SYSCALL32 \
55 -D_DDI_STRICT \
56 -D__sun \
57 -nostdinc
59 # TODO: support for debug builds
60 # KERNEL_CFLAGS += -DDEBUG
62 KERNEL_CFLAGS_32 = \
63 -m32
65 KERNEL_CFLAGS_64 = \
66 -m64 \
67 -D_ELF64
69 KERNEL_CFLAGS_i386 = \
70 -O \
71 -march=pentiumpro
73 KERNEL_CFLAGS_amd64 = \
74 -mno-mmx \
75 -mno-sse \
76 -O2 \
77 -Dsun \
78 -D__SVR4 \
79 -Ui386 \
80 -U__i386 \
81 -mtune=opteron \
82 -msave-args \
83 -mcmodel=kernel \
84 -fno-strict-aliasing \
85 -fno-unit-at-a-time \
86 -fno-optimize-sibling-calls \
87 -mno-red-zone \
88 -D_SYSCALL32_IMPL
90 KERNEL_CFLAGS_sparc =
91 KERNEL_CFLAGS_sparcv7 =
92 KERNEL_CFLAGS_sparcv9 =
94 KERNEL_INCLUDES = \
95 -I${SRCTOP}/usr/src/uts/common \
96 -I${SRCTOP}/arch/${CONFIG_MACH}/include \
97 -I${SRCTOP}/include
99 KERNEL_INCLUDES_amd64 = \
100 -I${SRCTOP}/usr/src/uts/intel
102 KERNEL_INCLUDES_sparc =
104 KERNEL_CFLAGS = \
105 ${KERNEL_CFLAGS_ALL} \
106 ${KERNEL_CFLAGS_${BITS}} \
107 ${KERNEL_CFLAGS_${CONFIG_MACH${BITS}}} \
108 ${KERNEL_CFLAGS_${CONFIG_MACH}} \
109 ${KERNEL_INCLUDES} \
110 ${KERNEL_INCLUDES_${CONFIG_MACH}}
113 # LDFLAGS
115 KERNEL_LDFLAGS = \
119 # Programs
121 CC=/opt/gcc/4.4.4/bin/gcc
122 LD=/usr/bin/ld
123 CTFCONVERT=/usr/bin/ctfconvert
124 CTFMERGE=/usr/bin/ctfmerge
127 # Verbosity
129 .if ${VERBOSE:Uno} != "yes"
130 CC := @echo " CC ($${BITS}) $${.IMPSRC}";${CC}
131 LD := @echo " LD ($${BITS}) $${.TARGET}";${LD}
132 CTFCONVERT := @${CTFCONVERT}
133 .endif