Makefile.rumpkern revision 1.44
1#	$NetBSD: Makefile.rumpkern,v 1.44 2009/04/29 17:51:47 pooka Exp $
2#
3
4.include "${RUMPTOP}/Makefile.rump"
5
6LIB=		rump
7
8.PATH:	${RUMPTOP}/librump/rumpkern				\
9	${RUMPTOP}/../kern					\
10	${RUMPTOP}/../conf					\
11	${RUMPTOP}/../dev					\
12	${RUMPTOP}/../secmodel/bsd44 ${RUMPTOP}/../secmodel/securelevel
13
14#
15# Source modules, first the ones specifically implemented for librump.
16# 
17SRCS=	rump.c emul.c intr.c locks.c ltsleep.c percpu.c pool.c	\
18	sleepq.c sysproxy_socket.c vm.c
19
20# stubs
21#
22SRCS+=	misc_stub.c pmap_stub.c
23
24# autogenerated
25#
26SRCS+=	rump_syscalls.c
27
28#
29# Rest are from the std kernel sources.
30#
31# sys/kern
32SRCS+=	kern_auth.c kern_descrip.c kern_event.c kern_ksyms.c		\
33	kern_malloc_stdtype.c kern_module.c kern_rate.c kern_stub.c	\
34	kern_sysctl.c kern_timeout.c kern_uidinfo.c param.c		\
35	sys_descrip.c sys_generic.c
36
37# sys/kern subr (misc)
38SRCS+=	subr_devsw.c subr_callback.c subr_evcnt.c subr_hash.c		\
39	subr_iostat.c subr_kobj.c subr_log.c subr_once.c subr_prf.c	\
40	subr_specificdata.c subr_time.c subr_workqueue.c
41
42# 4.4BSD secmodel.  selection is hardcoded for now
43SRCS+=	secmodel_bsd44.c secmodel_bsd44_logic.c secmodel_bsd44_suser.c	\
44	secmodel_securelevel.c
45
46# the funny bit.  this doesn't really belong here, but helps with the
47# needs of kern_descrip.c.  And since it's a fully dynamic interface,
48# it doesn't pull in other gunk.
49SRCS+=	vnode_if.c
50
51# sys/dev
52SRCS+=	clock_subr.c
53
54# Comment these if you want to use malloc(3) directly instead of
55# the kernel allocators.  It's a few percent faster, but doesn't
56# emulate all kernel corner cases as well.
57#CPPFLAGS+=	-DRUMP_USE_REAL_ALLOCATORS
58#SRCS+=		subr_kmem.c subr_pool.c subr_vmem.c
59
60# no shlib_version because this is automatically in sync with lib/librump
61SHLIB_MAJOR=    0
62SHLIB_MINOR=    0
63
64CPPFLAGS+=	-I${RUMPTOP}/librump/rumpkern
65CPPFLAGS+=	-I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpvfs
66CFLAGS+=	-Wno-pointer-sign
67AFLAGS+=	-D_LOCORE -Wa,-fatal-warnings
68
69#
70# If archdir exists, it is required to provide:
71# 1) kobj_reloc() and kobj_machdep()
72# 2) ...?
73# 3) PROFIT!
74#
75
76#
77# Check if we are building compat.  In compat mode we need to provide
78# the kernel of our compat target (amd64->i386 & sparc64->sparc), so
79# take MD stuff from the right arch.
80#
81.ifdef LD32DIR
82ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${LD32DIR}
83LIBKERN_ARCH=	${LD32DIR}
84.else
85ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH}
86.endif
87.if exists(${ARCHDIR})
88.include "${ARCHDIR}/Makefile.inc"
89.PATH:	${ARCHDIR}
90.else
91SRCS+=	kobj_stubs.c
92.endif
93
94# include libkern source files
95KERNDIR=${RUMPTOP}/../lib/libkern
96.include "${RUMPTOP}/../lib/libkern/Makefile.libkern"
97
98# Some architectures require a little special massage with atomic
99# compare-and-swap.  This is because the kernel version is using
100# instructions or routines unavailable to us in userspace.  We
101# use effectively the multiprocessor version of the userspace ops.
102#
103.if ${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "hppa" \
104    || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \
105    || ${MACHINE_CPU} == "vax"
106CPPFLAGS+=	-I${RUMPTOP}/../../common/lib/libc/atomic
107SRCS+=		atomic_cas_generic.c
108.endif
109
110.include <bsd.lib.mk>
111.include <bsd.klinks.mk>
112