Remove building with NOCRYPTO option
[minix.git] / minix / kernel / Makefile
blobec4c160fa1c7c96f02a793cfabe38e5ead7c1ffe
1 # Makefile for kernel
2 .include <bsd.own.mk>
4 PROG= kernel
5 BINDIR= /usr/sbin
6 MAN=
8 .if ${MACHINE_ARCH} == "earm" && ${MKLLVM:Uno} == "yes"
9 # BJG - problems with optimisation of the kernel by llvm
10 DBG=-O0
11 .endif
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} != ""
23 CFLAGS+= -fno-common
24 .endif
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"
47 CPPFLAGS+= -DPAE=1
48 .endif
50 .ifdef CONFIG_SMP
51 SRCS+= smp.c
52 .endif
54 .if ${USE_WATCHDOG} != "no"
55 SRCS+= watchdog.c
56 CPPFLAGS+= -DUSE_WATCHDOG=1
57 .endif
59 # Extra debugging routines
60 .if ${USE_SYSDEBUG} != "no"
61 SRCS+= debug.c
62 CPPFLAGS+= -DUSE_SYSDEBUG=1
63 .endif
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
70 .endif
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
77 ${_MKTARGET_CREATE}
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
81 ${_MKTARGET_CREATE}
82 cd ${.CURDIR} ; ${HOST_SH} extract-mfield.sh > ${.OBJDIR}/extracted-mfield.h
84 extracted-mtype.h: extract-mtype.sh ../include/minix/com.h
85 ${_MKTARGET_CREATE}
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..
96 kernel: kernel.bcl.o
97 ${_MKTARGET_LINK}
98 ${_CCLINK.kernel} \
99 ${_LDFLAGS.kernel} \
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
105 .endif
107 # Disable magic and ASR passes for the kernel.
108 USE_MAGIC=no
110 # Disable coverage profiling for the kernel, at least for now.
111 MKCOVERAGE=no
113 .include <minix.service.mk>