8 .if
${MACHINE_ARCH} == "earm" && ${MKLLVM
:Uno
} == "yes"
9 # BJG - problems with optimisation of the kernel by llvm
13 .
include "arch/${MACHINE_ARCH}/Makefile.inc"
15 SRCS
+= clock.c cpulocals.c interrupt.c main.c proc.c system.c \
16 table.c utility.c usermapped_data.c
18 LDADD
+= -ltimers
-lsys
-lexec
20 LINKERSCRIPT
= ${.CURDIR
}/arch
/${MACHINE_ARCH}/kernel.lds
22 .if
${HAVE_GOLD
:U
} != ""
25 LDFLAGS
+= -T
${LINKERSCRIPT}
26 LDFLAGS
+= -nostdlib
-L
${DESTDIR}/usr
/lib
27 CFLAGS
+= -fno-stack-protector
29 CPPFLAGS
+= -D__kernel__
31 # kernel headers are always called through kernel/*.h
32 CPPFLAGS
+= -I
${NETBSDSRCDIR}/minix
34 # kernel headers are always called through kernel/*.h, this
35 # time for generated headers, during cross compilation
36 CPPFLAGS
+= -I
${.OBJDIR
}/..
38 # Machine-dependent headers, order is important!
39 CPPFLAGS
+= -I
${.CURDIR
}/arch
/${MACHINE_ARCH}
40 CPPFLAGS
+= -I
${.CURDIR
}/arch
/${MACHINE_ARCH}/include
41 CPPFLAGS
+= -I
${.CURDIR
}/arch
/${MACHINE_ARCH}/bsp
/include
42 CPPFLAGS
+= -I
${NETBSDSRCDIR}/minix
/include/arch
/${MACHINE_ARCH}/include
44 .
include "system/Makefile.inc"
46 .if
${MKPAE
:Uno
} != "no"
54 .if
${USE_WATCHDOG} != "no"
56 CPPFLAGS
+= -DUSE_WATCHDOG
=1
59 # Extra debugging routines
60 .if
${USE_SYSDEBUG} != "no"
62 CPPFLAGS
+= -DUSE_SYSDEBUG
=1
65 # These come last, so the profiling buffer is at the end of the data segment
66 SRCS
+= profile.c do_sprofile.c
68 .if
${USE_LIVEUPDATE} != "no"
69 CPPFLAGS
+= -DUSE_UPDATE
=1
72 CLEANFILES
+=extracted-errno.h extracted-mfield.h extracted-mtype.h procoffsets.h
74 debug.o debug.d
: extracted-errno.h extracted-mfield.h extracted-mtype.h
76 extracted-errno.h
: extract-errno.sh ..
/..
/include/errno.h
78 cd
${.CURDIR
} ; ${HOST_SH} extract-errno.sh
> ${.OBJDIR
}/extracted-errno.h
80 extracted-mfield.h
: extract-mfield.sh ..
/lib
/libc
/sys
/*.c ..
/lib
/libsys
/*.c
82 cd
${.CURDIR
} ; ${HOST_SH} extract-mfield.sh
> ${.OBJDIR
}/extracted-mfield.h
84 extracted-mtype.h
: extract-mtype.sh ..
/include/minix
/com.h
86 cd
${.CURDIR
} ; ${HOST_SH} extract-mtype.sh
> ${.OBJDIR
}/extracted-mtype.h
88 .if
${USE_BITCODE
:Uno
} == "yes"
89 # dcvmoole: this is a copy of the "${_P}: ${_P}.bcl.o" block from bsd.prog.mk,
90 # with two changes: 1) ${OBJS} is added so as to link in objects that have not
91 # been compiled with bitcode, and 2) we are directly loading the gold plugin
92 # rather than through ${BITCODE_LD_FLAGS_2ND.kernel}, because LLVMgold will
93 # not load libLTO when no LTO can be performed (due to the non- bitcode
94 # objects), causing it to fail on unrecognized -disable-opt/-disable-inlining
95 # options. At least I think that's what's going on? I'm no expert here..
100 -L
${DESTDIR}/usr
/lib \
101 ${_LDSTATIC.kernel
} -o
${.TARGET
} \
102 ${.TARGET
}.bcl.o
${OBJS} ${_PROGLDOPTS} ${_LDADD.kernel
} \
103 -Wl
,-plugin
=${GOLD_PLUGIN} \
104 -Wl
,--allow-multiple-definition
107 # Disable magic and ASR passes for the kernel.
110 # Disable coverage profiling for the kernel, at least for now.
113 .
include <minix.service.mk
>