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