Makefile.rumpkern revision 1.92
11.92Spooka#	$NetBSD: Makefile.rumpkern,v 1.92 2010/07/19 15:33:16 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.92SpookaSRCS+=	compat.c
221.86Spooka
231.86Spooka# Multiprocessor or uniprocessor locking.  TODO: select right
241.86Spooka# locking at runtime.
251.87SpookaSRCS+=	locks.c
261.87Spooka#SRCS+=	locks_up.c
271.20Spooka
281.88Snjolyvers.c: ${RUMPTOP}/../conf/newvers.sh ${RUMPTOP}/../conf/osrelease.sh ${RUMPTOP}/../sys/param.h
291.69Spooka	${_MKMSG_CREATE} vers.c
301.70Spooka	${HOST_SH} ${RUMPTOP}/../conf/newvers.sh -i RUMP-ROAST -n
311.69SpookaSRCS+=		vers.c
321.69SpookaCLEANFILES+=	vers.c version
331.69Spooka
341.91Spooka# use MI pmap for archs not conforming to kernel ABI
351.91Spooka.ifndef RUMPKMOD
361.62SpookaSRCS+=	pmap_stub.c
371.91Spooka.endif
381.20Spooka
391.20Spooka# autogenerated
401.20Spooka#
411.56SpookaSRCS+=	rump_syscalls.c rumpkern_if_wrappers.c
421.1Spooka
431.82Spooka# "auto"generated
441.82SpookaSRCS+=	devsw.c
451.82Spooka
461.11Spooka#
471.11Spooka# Rest are from the std kernel sources.
481.11Spooka#
491.1Spooka# sys/kern
501.48SpookaSRCS+=	init_sysctl_base.c kern_auth.c kern_descrip.c kern_event.c	\
511.72Spooka	kern_hook.c kern_ksyms.c kern_malloc_stdtype.c kern_module.c	\
521.89Spooka	kern_mutex_obj.c kern_ntptime.c kern_proc.c kern_rate.c		\
531.89Spooka	kern_resource.c kern_stub.c kern_syscall.c kern_sysctl.c	\
541.89Spooka	kern_tc.c kern_timeout.c kern_uidinfo.c param.c sys_descrip.c	\
551.80Spooka	sys_generic.c sys_module.c sys_pipe.c sys_select.c syscalls.c
561.11Spooka
571.11Spooka# sys/kern subr (misc)
581.73SpookaSRCS+=	subr_devsw.c subr_callback.c subr_copy.c subr_device.c		\
591.73Spooka	subr_evcnt.c subr_extent.c subr_hash.c subr_humanize.c		\
601.75Spooka	subr_iostat.c subr_kobj.c subr_log.c subr_lwp_specificdata.c	\
611.75Spooka	subr_once.c subr_prf.c subr_specificdata.c subr_time.c		\
621.75Spooka	subr_workqueue.c subr_xcall.c
631.11Spooka
641.55Spooka# sys/uvm
651.55SpookaSRCS+=	uvm_readahead.c
661.55Spooka
671.43Spooka# 4.4BSD secmodel.  selection is hardcoded for now
681.50SeladSRCS+=	secmodel_suser.c
691.43Spooka
701.20Spooka# the funny bit.  this doesn't really belong here, but helps with the
711.20Spooka# needs of kern_descrip.c.  And since it's a fully dynamic interface,
721.20Spooka# it doesn't pull in other gunk.
731.20SpookaSRCS+=	vnode_if.c
741.1Spooka
751.11Spooka# sys/dev
761.11SpookaSRCS+=	clock_subr.c
771.11Spooka
781.65Spooka# Flip the comment to the other line if you want to use malloc(3)
791.65Spooka# directly instead of the kernel allocators backed by malloc(3)/mmap(2).
801.65Spooka# Libc malloc is a few percent faster, but doesn't emulate all kernel
811.65Spooka# corner cases as well (not to mention if you want to debug the
821.65Spooka# allocators themselves).
831.65Spooka#CPPFLAGS+=	-DRUMP_USE_UNREAL_ALLOCATORS
841.71SpookaSRCS+=		subr_kmem.c subr_percpu.c subr_pool.c subr_vmem.c
851.6Spooka
861.1Spooka# no shlib_version because this is automatically in sync with lib/librump
871.1SpookaSHLIB_MAJOR=    0
881.1SpookaSHLIB_MINOR=    0
891.1Spooka
901.47SpookaCPPFLAGS+=	-I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpvfs
911.47SpookaCPPFLAGS+=	-I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpdev
921.32SpookaAFLAGS+=	-D_LOCORE -Wa,-fatal-warnings
931.1Spooka
941.27Spooka#
951.27Spooka# If archdir exists, it is required to provide:
961.27Spooka# 1) kobj_reloc() and kobj_machdep()
971.52Spooka# 2) rump_cpu_bootstrap()
981.52Spooka# 3) ...?
991.52Spooka# 4) PROFIT!
1001.27Spooka#
1011.30Spooka
1021.30Spooka#
1031.34Spooka# Check if we are building compat.  In compat mode we need to provide
1041.34Spooka# the kernel of our compat target (amd64->i386 & sparc64->sparc), so
1051.34Spooka# take MD stuff from the right arch.
1061.30Spooka#
1071.67Smrg.ifdef MLIBDIR
1081.67SmrgARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MLIBDIR}
1091.67SmrgLIBKERN_ARCH=	${MLIBDIR}
1101.68Smatt.elif exists(${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU})
1111.68SmattARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU}
1121.30Spooka.else
1131.24SpookaARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH}
1141.30Spooka.endif
1151.24Spooka.if exists(${ARCHDIR})
1161.24Spooka.include "${ARCHDIR}/Makefile.inc"
1171.24Spooka.PATH:	${ARCHDIR}
1181.27Spooka.else
1191.52SpookaSRCS+=	kobj_stubs.c rumpcpu_generic.c
1201.24Spooka.endif
1211.24Spooka
1221.90Spooka.if ${MACHINE} == "sun3"
1231.90SpookaCPPFLAGS+=	-Dsun3
1241.90Spooka.endif
1251.90Spooka
1261.31Spooka# include libkern source files
1271.31SpookaKERNDIR=${RUMPTOP}/../lib/libkern
1281.84Spooka.ifdef RUMPKMOD
1291.84SpookaKERNMISCCPPFLAGS+=	-D_RUMPKERNEL
1301.84Spooka.endif
1311.31Spooka.include "${RUMPTOP}/../lib/libkern/Makefile.libkern"
1321.31Spooka
1331.36Spooka# Some architectures require a little special massage with atomic
1341.36Spooka# compare-and-swap.  This is because the kernel version is using
1351.36Spooka# instructions or routines unavailable to us in userspace.  We
1361.36Spooka# use effectively the multiprocessor version of the userspace ops.
1371.36Spooka#
1381.36Spooka.if ${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "hppa" \
1391.37Spooka    || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \
1401.54Schristos    || ${MACHINE_CPU} == "vax" || ${MACHINE_ARCH} == "m68000"
1411.36SpookaCPPFLAGS+=	-I${RUMPTOP}/../../common/lib/libc/atomic
1421.36SpookaSRCS+=		atomic_cas_generic.c
1431.36Spooka.endif
1441.36Spooka
1451.1Spooka.include <bsd.lib.mk>
1461.1Spooka.include <bsd.klinks.mk>
147