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