Makefile.rumpkern revision 1.67
11.67Smrg#	$NetBSD: Makefile.rumpkern,v 1.67 2009/12/13 08:25:20 mrg 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.59SpookaSRCS=	rump.c rumpcopy.c emul.c intr.c locks.c ltsleep.c	\
191.60Spooka	memalloc.c percpu.c scheduler.c sleepq.c		\
201.61Spooka	sysproxy_socket.c threads.c vm.c
211.20Spooka
221.14Spooka# stubs
231.20Spooka#
241.62SpookaSRCS+=	pmap_stub.c
251.20Spooka
261.20Spooka# autogenerated
271.20Spooka#
281.56SpookaSRCS+=	rump_syscalls.c rumpkern_if_wrappers.c
291.1Spooka
301.11Spooka#
311.11Spooka# Rest are from the std kernel sources.
321.11Spooka#
331.1Spooka# sys/kern
341.48SpookaSRCS+=	init_sysctl_base.c kern_auth.c kern_descrip.c kern_event.c	\
351.57Spooka	kern_ksyms.c kern_malloc_stdtype.c kern_module.c		\
361.57Spooka	kern_mutex_obj.c kern_rate.c kern_stub.c kern_sysctl.c		\
371.57Spooka	kern_timeout.c kern_uidinfo.c param.c				\
381.64Spooka	sys_descrip.c sys_generic.c sys_pipe.c sys_select.c syscalls.c
391.11Spooka
401.11Spooka# sys/kern subr (misc)
411.58SpookaSRCS+=	subr_devsw.c subr_callback.c subr_copy.c subr_evcnt.c		\
421.58Spooka	subr_extent.c subr_hash.c subr_humanize.c subr_iostat.c		\
431.58Spooka	subr_kobj.c subr_log.c subr_once.c subr_prf.c			\
441.66Spooka	subr_specificdata.c subr_time.c subr_workqueue.c subr_xcall.c
451.11Spooka
461.55Spooka# sys/uvm
471.55SpookaSRCS+=	uvm_readahead.c
481.55Spooka
491.43Spooka# 4.4BSD secmodel.  selection is hardcoded for now
501.50SeladSRCS+=	secmodel_suser.c
511.43Spooka
521.20Spooka# the funny bit.  this doesn't really belong here, but helps with the
531.20Spooka# needs of kern_descrip.c.  And since it's a fully dynamic interface,
541.20Spooka# it doesn't pull in other gunk.
551.20SpookaSRCS+=	vnode_if.c
561.1Spooka
571.11Spooka# sys/dev
581.11SpookaSRCS+=	clock_subr.c
591.11Spooka
601.65Spooka# Flip the comment to the other line if you want to use malloc(3)
611.65Spooka# directly instead of the kernel allocators backed by malloc(3)/mmap(2).
621.65Spooka# Libc malloc is a few percent faster, but doesn't emulate all kernel
631.65Spooka# corner cases as well (not to mention if you want to debug the
641.65Spooka# allocators themselves).
651.65Spooka#CPPFLAGS+=	-DRUMP_USE_UNREAL_ALLOCATORS
661.63SpookaSRCS+=		subr_kmem.c subr_pool.c subr_vmem.c
671.6Spooka
681.1Spooka# no shlib_version because this is automatically in sync with lib/librump
691.1SpookaSHLIB_MAJOR=    0
701.1SpookaSHLIB_MINOR=    0
711.1Spooka
721.47SpookaCPPFLAGS+=	-I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpvfs
731.47SpookaCPPFLAGS+=	-I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpdev
741.1SpookaCFLAGS+=	-Wno-pointer-sign
751.32SpookaAFLAGS+=	-D_LOCORE -Wa,-fatal-warnings
761.1Spooka
771.27Spooka#
781.27Spooka# If archdir exists, it is required to provide:
791.27Spooka# 1) kobj_reloc() and kobj_machdep()
801.52Spooka# 2) rump_cpu_bootstrap()
811.52Spooka# 3) ...?
821.52Spooka# 4) PROFIT!
831.27Spooka#
841.30Spooka
851.30Spooka#
861.34Spooka# Check if we are building compat.  In compat mode we need to provide
871.34Spooka# the kernel of our compat target (amd64->i386 & sparc64->sparc), so
881.34Spooka# take MD stuff from the right arch.
891.30Spooka#
901.67Smrg.ifdef MLIBDIR
911.67SmrgARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MLIBDIR}
921.67SmrgLIBKERN_ARCH=	${MLIBDIR}
931.30Spooka.else
941.24SpookaARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH}
951.30Spooka.endif
961.24Spooka.if exists(${ARCHDIR})
971.24Spooka.include "${ARCHDIR}/Makefile.inc"
981.24Spooka.PATH:	${ARCHDIR}
991.27Spooka.else
1001.52SpookaSRCS+=	kobj_stubs.c rumpcpu_generic.c
1011.24Spooka.endif
1021.24Spooka
1031.31Spooka# include libkern source files
1041.31SpookaKERNDIR=${RUMPTOP}/../lib/libkern
1051.31Spooka.include "${RUMPTOP}/../lib/libkern/Makefile.libkern"
1061.31Spooka
1071.36Spooka# Some architectures require a little special massage with atomic
1081.36Spooka# compare-and-swap.  This is because the kernel version is using
1091.36Spooka# instructions or routines unavailable to us in userspace.  We
1101.36Spooka# use effectively the multiprocessor version of the userspace ops.
1111.36Spooka#
1121.36Spooka.if ${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "hppa" \
1131.37Spooka    || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \
1141.54Schristos    || ${MACHINE_CPU} == "vax" || ${MACHINE_ARCH} == "m68000"
1151.36SpookaCPPFLAGS+=	-I${RUMPTOP}/../../common/lib/libc/atomic
1161.36SpookaSRCS+=		atomic_cas_generic.c
1171.36Spooka.endif
1181.36Spooka
1191.1Spooka.include <bsd.lib.mk>
1201.1Spooka.include <bsd.klinks.mk>
121