Makefile.rumpkern revision 1.85
1#	$NetBSD: Makefile.rumpkern,v 1.85 2010/05/18 15:12:19 pooka Exp $
2#
3
4.include "${RUMPTOP}/Makefile.rump"
5
6LIB=		rump
7
8.PATH:	${RUMPTOP}/librump/rumpkern				\
9	${RUMPTOP}/../kern					\
10	${RUMPTOP}/../uvm					\
11	${RUMPTOP}/../conf					\
12	${RUMPTOP}/../dev					\
13	${RUMPTOP}/../secmodel/suser
14
15#
16# Source modules, first the ones specifically implemented for librump.
17# 
18SRCS=	rump.c rumpcopy.c emul.c intr.c klock.c kobj_rename.c	\
19	locks.c ltsleep.c memalloc.c scheduler.c signals.c	\
20	sleepq.c sysproxy_socket.c threads.c vm.c
21
22vers.c: ${RUMPTOP}/../conf/newvers.sh ${RUMPTOP}/../conf/osrelease.sh
23	${_MKMSG_CREATE} vers.c
24	${HOST_SH} ${RUMPTOP}/../conf/newvers.sh -i RUMP-ROAST -n
25SRCS+=		vers.c
26CLEANFILES+=	vers.c version
27
28# stubs
29#
30SRCS+=	pmap_stub.c
31
32# autogenerated
33#
34SRCS+=	rump_syscalls.c rumpkern_if_wrappers.c
35
36# "auto"generated
37SRCS+=	devsw.c
38
39#
40# Rest are from the std kernel sources.
41#
42# sys/kern
43SRCS+=	init_sysctl_base.c kern_auth.c kern_descrip.c kern_event.c	\
44	kern_hook.c kern_ksyms.c kern_malloc_stdtype.c kern_module.c	\
45	kern_mutex_obj.c kern_ntptime.c kern_rate.c kern_resource.c	\
46	kern_stub.c kern_syscall.c kern_sysctl.c kern_tc.c		\
47	kern_timeout.c kern_uidinfo.c param.c sys_descrip.c		\
48	sys_generic.c sys_module.c sys_pipe.c sys_select.c syscalls.c
49
50# sys/kern subr (misc)
51SRCS+=	subr_devsw.c subr_callback.c subr_copy.c subr_device.c		\
52	subr_evcnt.c subr_extent.c subr_hash.c subr_humanize.c		\
53	subr_iostat.c subr_kobj.c subr_log.c subr_lwp_specificdata.c	\
54	subr_once.c subr_prf.c subr_specificdata.c subr_time.c		\
55	subr_workqueue.c subr_xcall.c
56
57# sys/uvm
58SRCS+=	uvm_readahead.c
59
60# 4.4BSD secmodel.  selection is hardcoded for now
61SRCS+=	secmodel_suser.c
62
63# the funny bit.  this doesn't really belong here, but helps with the
64# needs of kern_descrip.c.  And since it's a fully dynamic interface,
65# it doesn't pull in other gunk.
66SRCS+=	vnode_if.c
67
68# sys/dev
69SRCS+=	clock_subr.c
70
71# Flip the comment to the other line if you want to use malloc(3)
72# directly instead of the kernel allocators backed by malloc(3)/mmap(2).
73# Libc malloc is a few percent faster, but doesn't emulate all kernel
74# corner cases as well (not to mention if you want to debug the
75# allocators themselves).
76#CPPFLAGS+=	-DRUMP_USE_UNREAL_ALLOCATORS
77SRCS+=		subr_kmem.c subr_percpu.c subr_pool.c subr_vmem.c
78
79# no shlib_version because this is automatically in sync with lib/librump
80SHLIB_MAJOR=    0
81SHLIB_MINOR=    0
82
83CPPFLAGS+=	-I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpvfs
84CPPFLAGS+=	-I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpdev
85AFLAGS+=	-D_LOCORE -Wa,-fatal-warnings
86
87#
88# If archdir exists, it is required to provide:
89# 1) kobj_reloc() and kobj_machdep()
90# 2) rump_cpu_bootstrap()
91# 3) ...?
92# 4) PROFIT!
93#
94
95#
96# Check if we are building compat.  In compat mode we need to provide
97# the kernel of our compat target (amd64->i386 & sparc64->sparc), so
98# take MD stuff from the right arch.
99#
100.ifdef MLIBDIR
101ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MLIBDIR}
102LIBKERN_ARCH=	${MLIBDIR}
103.elif exists(${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU})
104ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU}
105.else
106ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH}
107.endif
108.if exists(${ARCHDIR})
109.include "${ARCHDIR}/Makefile.inc"
110.PATH:	${ARCHDIR}
111.else
112SRCS+=	kobj_stubs.c rumpcpu_generic.c
113.endif
114
115# include libkern source files
116KERNDIR=${RUMPTOP}/../lib/libkern
117.ifdef RUMPKMOD
118KERNMISCCPPFLAGS+=	-D_RUMPKERNEL
119.endif
120.include "${RUMPTOP}/../lib/libkern/Makefile.libkern"
121
122# Some architectures require a little special massage with atomic
123# compare-and-swap.  This is because the kernel version is using
124# instructions or routines unavailable to us in userspace.  We
125# use effectively the multiprocessor version of the userspace ops.
126#
127.if ${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "hppa" \
128    || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \
129    || ${MACHINE_CPU} == "vax" || ${MACHINE_ARCH} == "m68000"
130CPPFLAGS+=	-I${RUMPTOP}/../../common/lib/libc/atomic
131SRCS+=		atomic_cas_generic.c
132.endif
133
134.include <bsd.lib.mk>
135.include <bsd.klinks.mk>
136