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