Makefile.rumpkern revision 1.87
11.87Spooka#	$NetBSD: Makefile.rumpkern,v 1.87 2010/05/18 16:30:22 pooka Exp $
21.1Spooka#
31.1Spooka
41.1Spooka.include "${RUMPTOP}/Makefile.rump"
51.1Spooka
61.1SpookaLIB=		rump
71.1Spooka
81.1Spooka.PATH:	${RUMPTOP}/librump/rumpkern				\
91.31Spooka	${RUMPTOP}/../kern					\
101.55Spooka	${RUMPTOP}/../uvm					\
111.31Spooka	${RUMPTOP}/../conf					\
121.43Spooka	${RUMPTOP}/../dev					\
131.50Selad	${RUMPTOP}/../secmodel/suser
141.1Spooka
151.11Spooka#
161.14Spooka# Source modules, first the ones specifically implemented for librump.
171.11Spooka# 
181.85SpookaSRCS=	rump.c rumpcopy.c emul.c intr.c klock.c kobj_rename.c	\
191.86Spooka	ltsleep.c memalloc.c scheduler.c signals.c sleepq.c	\
201.86Spooka	sysproxy_socket.c threads.c vm.c
211.86Spooka
221.86Spooka# Multiprocessor or uniprocessor locking.  TODO: select right
231.86Spooka# locking at runtime.
241.87SpookaSRCS+=	locks.c
251.87Spooka#SRCS+=	locks_up.c
261.20Spooka
271.69Spookavers.c: ${RUMPTOP}/../conf/newvers.sh ${RUMPTOP}/../conf/osrelease.sh
281.69Spooka	${_MKMSG_CREATE} vers.c
291.70Spooka	${HOST_SH} ${RUMPTOP}/../conf/newvers.sh -i RUMP-ROAST -n
301.69SpookaSRCS+=		vers.c
311.69SpookaCLEANFILES+=	vers.c version
321.69Spooka
331.14Spooka# stubs
341.20Spooka#
351.62SpookaSRCS+=	pmap_stub.c
361.20Spooka
371.20Spooka# autogenerated
381.20Spooka#
391.56SpookaSRCS+=	rump_syscalls.c rumpkern_if_wrappers.c
401.1Spooka
411.82Spooka# "auto"generated
421.82SpookaSRCS+=	devsw.c
431.82Spooka
441.11Spooka#
451.11Spooka# Rest are from the std kernel sources.
461.11Spooka#
471.1Spooka# sys/kern
481.48SpookaSRCS+=	init_sysctl_base.c kern_auth.c kern_descrip.c kern_event.c	\
491.72Spooka	kern_hook.c kern_ksyms.c kern_malloc_stdtype.c kern_module.c	\
501.79Spooka	kern_mutex_obj.c kern_ntptime.c kern_rate.c kern_resource.c	\
511.79Spooka	kern_stub.c kern_syscall.c kern_sysctl.c kern_tc.c		\
521.79Spooka	kern_timeout.c kern_uidinfo.c param.c sys_descrip.c		\
531.80Spooka	sys_generic.c sys_module.c sys_pipe.c sys_select.c syscalls.c
541.11Spooka
551.11Spooka# sys/kern subr (misc)
561.73SpookaSRCS+=	subr_devsw.c subr_callback.c subr_copy.c subr_device.c		\
571.73Spooka	subr_evcnt.c subr_extent.c subr_hash.c subr_humanize.c		\
581.75Spooka	subr_iostat.c subr_kobj.c subr_log.c subr_lwp_specificdata.c	\
591.75Spooka	subr_once.c subr_prf.c subr_specificdata.c subr_time.c		\
601.75Spooka	subr_workqueue.c subr_xcall.c
611.11Spooka
621.55Spooka# sys/uvm
631.55SpookaSRCS+=	uvm_readahead.c
641.55Spooka
651.43Spooka# 4.4BSD secmodel.  selection is hardcoded for now
661.50SeladSRCS+=	secmodel_suser.c
671.43Spooka
681.20Spooka# the funny bit.  this doesn't really belong here, but helps with the
691.20Spooka# needs of kern_descrip.c.  And since it's a fully dynamic interface,
701.20Spooka# it doesn't pull in other gunk.
711.20SpookaSRCS+=	vnode_if.c
721.1Spooka
731.11Spooka# sys/dev
741.11SpookaSRCS+=	clock_subr.c
751.11Spooka
761.65Spooka# Flip the comment to the other line if you want to use malloc(3)
771.65Spooka# directly instead of the kernel allocators backed by malloc(3)/mmap(2).
781.65Spooka# Libc malloc is a few percent faster, but doesn't emulate all kernel
791.65Spooka# corner cases as well (not to mention if you want to debug the
801.65Spooka# allocators themselves).
811.65Spooka#CPPFLAGS+=	-DRUMP_USE_UNREAL_ALLOCATORS
821.71SpookaSRCS+=		subr_kmem.c subr_percpu.c subr_pool.c subr_vmem.c
831.6Spooka
841.1Spooka# no shlib_version because this is automatically in sync with lib/librump
851.1SpookaSHLIB_MAJOR=    0
861.1SpookaSHLIB_MINOR=    0
871.1Spooka
881.47SpookaCPPFLAGS+=	-I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpvfs
891.47SpookaCPPFLAGS+=	-I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpdev
901.32SpookaAFLAGS+=	-D_LOCORE -Wa,-fatal-warnings
911.1Spooka
921.27Spooka#
931.27Spooka# If archdir exists, it is required to provide:
941.27Spooka# 1) kobj_reloc() and kobj_machdep()
951.52Spooka# 2) rump_cpu_bootstrap()
961.52Spooka# 3) ...?
971.52Spooka# 4) PROFIT!
981.27Spooka#
991.30Spooka
1001.30Spooka#
1011.34Spooka# Check if we are building compat.  In compat mode we need to provide
1021.34Spooka# the kernel of our compat target (amd64->i386 & sparc64->sparc), so
1031.34Spooka# take MD stuff from the right arch.
1041.30Spooka#
1051.67Smrg.ifdef MLIBDIR
1061.67SmrgARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MLIBDIR}
1071.67SmrgLIBKERN_ARCH=	${MLIBDIR}
1081.68Smatt.elif exists(${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU})
1091.68SmattARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU}
1101.30Spooka.else
1111.24SpookaARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH}
1121.30Spooka.endif
1131.24Spooka.if exists(${ARCHDIR})
1141.24Spooka.include "${ARCHDIR}/Makefile.inc"
1151.24Spooka.PATH:	${ARCHDIR}
1161.27Spooka.else
1171.52SpookaSRCS+=	kobj_stubs.c rumpcpu_generic.c
1181.24Spooka.endif
1191.24Spooka
1201.31Spooka# include libkern source files
1211.31SpookaKERNDIR=${RUMPTOP}/../lib/libkern
1221.84Spooka.ifdef RUMPKMOD
1231.84SpookaKERNMISCCPPFLAGS+=	-D_RUMPKERNEL
1241.84Spooka.endif
1251.31Spooka.include "${RUMPTOP}/../lib/libkern/Makefile.libkern"
1261.31Spooka
1271.36Spooka# Some architectures require a little special massage with atomic
1281.36Spooka# compare-and-swap.  This is because the kernel version is using
1291.36Spooka# instructions or routines unavailable to us in userspace.  We
1301.36Spooka# use effectively the multiprocessor version of the userspace ops.
1311.36Spooka#
1321.36Spooka.if ${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "hppa" \
1331.37Spooka    || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \
1341.54Schristos    || ${MACHINE_CPU} == "vax" || ${MACHINE_ARCH} == "m68000"
1351.36SpookaCPPFLAGS+=	-I${RUMPTOP}/../../common/lib/libc/atomic
1361.36SpookaSRCS+=		atomic_cas_generic.c
1371.36Spooka.endif
1381.36Spooka
1391.1Spooka.include <bsd.lib.mk>
1401.1Spooka.include <bsd.klinks.mk>
141