Makefile.rumpkern revision 1.105
1#	$NetBSD: Makefile.rumpkern,v 1.105 2011/01/04 16:23:36 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 lwproc.c klock.c	\
19	kobj_rename.c ltsleep.c memalloc.c scheduler.c		\
20	signals.c sleepq.c threads.c vm.c
21SRCS+=	compat.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# Flip the comment to the other line if you want to use malloc(3)
121# directly instead of the kernel allocators backed by malloc(3)/mmap(2).
122# Libc malloc is a few percent faster, but doesn't emulate all kernel
123# corner cases as well (not to mention if you want to debug the
124# allocators themselves).
125#CPPFLAGS+=	-DRUMP_USE_UNREAL_ALLOCATORS
126SRCS+=		subr_kmem.c subr_percpu.c subr_pool.c subr_vmem.c
127
128# no shlib_version because this is automatically in sync with lib/librump
129SHLIB_MAJOR=    0
130SHLIB_MINOR=    0
131
132CPPFLAGS+=	-I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpvfs
133CPPFLAGS+=	-I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpdev
134AFLAGS+=	-D_LOCORE -Wa,-fatal-warnings
135
136#
137# If archdir exists, it is required to provide:
138# 1) kobj_reloc() and kobj_machdep()
139# 2) rump_cpu_bootstrap()
140# 3) ...?
141# 4) PROFIT!
142#
143
144#
145# Check if we are building compat.  In compat mode we need to provide
146# the kernel of our compat target (amd64->i386 & sparc64->sparc), so
147# take MD stuff from the right arch.
148#
149.ifdef MLIBDIR
150ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MLIBDIR}
151LIBKERN_ARCH=	${MLIBDIR}
152.elif exists(${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU})
153ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU}
154.else
155ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH}
156.endif
157.if exists(${ARCHDIR})
158.include "${ARCHDIR}/Makefile.inc"
159.PATH:	${ARCHDIR}
160.else
161SRCS+=	kobj_stubs.c rumpcpu_generic.c
162.endif
163
164.if ${MACHINE} == "sun3"
165CPPFLAGS+=	-Dsun3
166.endif
167
168# include libkern source files
169KERNDIR=${RUMPTOP}/../lib/libkern
170.ifdef RUMPKMOD
171KERNMISCCPPFLAGS+=	-D_RUMPKERNEL
172.endif
173.include "${RUMPTOP}/../lib/libkern/Makefile.libkern"
174
175# Some architectures require a little special massage with atomic
176# compare-and-swap.  This is because the kernel version is using
177# instructions or routines unavailable to us in userspace.
178#
179.if ${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "hppa" \
180    || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \
181    || ${MACHINE_CPU} == "vax" || ${MACHINE_ARCH} == "m68000"
182CPPFLAGS+=	-I${RUMPTOP}/../../common/lib/libc/atomic
183SRCS+=		atomic_cas_generic.c
184#SRCS+=		rump_atomic_cas_up.c
185.endif
186
187.include <bsd.lib.mk>
188.include <bsd.klinks.mk>
189