__aeabi_ldivmod: fix sign logic
[minix.git] / kernel / Makefile
blob7bcde0eeb177c69d39f9cb3d2f7c652d90e5efe6
1 # Makefile for kernel
2 .include <bsd.own.mk>
4 BINDIR= /usr/sbin
5 MAN=
6 PROG= kernel
8 .include "arch/${MACHINE_ARCH}/Makefile.inc"
10 SRCS+= clock.c cpulocals.c interrupt.c main.c proc.c system.c \
11 table.c utility.c usermapped_data.c
13 DPADD+= ${LIBTIMERS} ${LIBSYS} ${LIBEXEC} ${LIBMINLIB}
14 LDADD+= -ltimers -lsys -lexec -lminlib -L/usr/lib
16 LINKERSCRIPT= ${.CURDIR}/arch/${MACHINE_ARCH}/kernel.lds
18 LDFLAGS+= -T ${LINKERSCRIPT}
19 LDFLAGS+= -nostdlib
20 CFLAGS += -fno-stack-protector
22 CPPFLAGS+= -D_NETBSD_SOURCE -D_MINIX -D__kernel__
24 # kernel headers are always called through kernel/*.h
25 CPPFLAGS+= -I${NETBSDSRCDIR}
27 # kernel headers are always called through kernel/*.hi, this
28 # time for generated headers, during cross compilation
29 CPPFLAGS+= -I${.OBJDIR}/..
31 # Machine-dependent headers, order is important!
32 CPPFLAGS+= -I${.CURDIR}/arch/${MACHINE_ARCH}
33 CPPFLAGS+= -I${.CURDIR}/arch/${MACHINE_ARCH}/include
34 CPPFLAGS+= -I${NETBSDSRCDIR}/include/arch/${MACHINE_ARCH}/include
36 .include "system/Makefile.inc"
38 .ifdef CONFIG_SMP
39 SRCS+= smp.c
40 .endif
42 .if ${USE_WATCHDOG} != "no"
43 SRCS+= watchdog.c
44 CPPFLAGS+= -DUSE_WATCHDOG
45 .endif
47 .if ${USE_MCONTEXT} != "no"
48 SRCS+= do_mcontext.c
49 CPPFLAGS+= -DUSE_MCONTEXT
50 .endif
52 # Extra debugging routines
53 .if ${USE_SYSDEBUG} != "no"
54 SRCS+= debug.c
55 CPPFLAGS+= -DUSE_SYSDEBUG
56 .endif
58 # These come last, so the profiling buffer is at the end of the data segment
59 SRCS+= profile.c do_sprofile.c
61 .if ${USE_LIVEUPDATE} != "no"
62 CPPFLAGS+= -DUSE_UPDATE
63 .endif
65 .if ${USE_STATECTL} != "no"
66 CPPFLAGS+= -DUSE_STATECTL
67 .endif
69 .if ${USE_TRACE} != "no"
70 CPPFLAGS+= -DUSE_TRACE
71 .endif
73 CLEANFILES+=extracted-errno.h extracted-mfield.h extracted-mtype.h procoffsets.h
75 debug.d: extracted-errno.h extracted-mfield.h extracted-mtype.h
77 extracted-errno.h: extract-errno.sh ../include/errno.h
78 ${_MKTARGET_CREATE}
79 cd ${.CURDIR} ; ${HOST_SH} extract-errno.sh > ${.OBJDIR}/extracted-errno.h
81 extracted-mfield.h: extract-mfield.sh ../lib/libc/sys-minix/*.c ../lib/libsys/*.c
82 ${_MKTARGET_CREATE}
83 cd ${.CURDIR} ; ${HOST_SH} extract-mfield.sh > ${.OBJDIR}/extracted-mfield.h
85 extracted-mtype.h: extract-mtype.sh ../include/minix/com.h
86 ${_MKTARGET_CREATE}
87 cd ${.CURDIR} ; ${HOST_SH} extract-mtype.sh > ${.OBJDIR}/extracted-mtype.h
89 .include <minix.bootprog.mk>