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