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