Makefile.rumpkern revision 1.87
1# $NetBSD: Makefile.rumpkern,v 1.87 2010/05/18 16:30:22 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 klock.c kobj_rename.c \ 19 ltsleep.c memalloc.c scheduler.c signals.c sleepq.c \ 20 sysproxy_socket.c threads.c vm.c 21 22# Multiprocessor or uniprocessor locking. TODO: select right 23# locking at runtime. 24SRCS+= locks.c 25#SRCS+= locks_up.c 26 27vers.c: ${RUMPTOP}/../conf/newvers.sh ${RUMPTOP}/../conf/osrelease.sh 28 ${_MKMSG_CREATE} vers.c 29 ${HOST_SH} ${RUMPTOP}/../conf/newvers.sh -i RUMP-ROAST -n 30SRCS+= vers.c 31CLEANFILES+= vers.c version 32 33# stubs 34# 35SRCS+= pmap_stub.c 36 37# autogenerated 38# 39SRCS+= rump_syscalls.c rumpkern_if_wrappers.c 40 41# "auto"generated 42SRCS+= devsw.c 43 44# 45# Rest are from the std kernel sources. 46# 47# sys/kern 48SRCS+= init_sysctl_base.c kern_auth.c kern_descrip.c kern_event.c \ 49 kern_hook.c kern_ksyms.c kern_malloc_stdtype.c kern_module.c \ 50 kern_mutex_obj.c kern_ntptime.c kern_rate.c kern_resource.c \ 51 kern_stub.c kern_syscall.c kern_sysctl.c kern_tc.c \ 52 kern_timeout.c kern_uidinfo.c param.c sys_descrip.c \ 53 sys_generic.c sys_module.c sys_pipe.c sys_select.c syscalls.c 54 55# sys/kern subr (misc) 56SRCS+= subr_devsw.c subr_callback.c subr_copy.c subr_device.c \ 57 subr_evcnt.c subr_extent.c subr_hash.c subr_humanize.c \ 58 subr_iostat.c subr_kobj.c subr_log.c subr_lwp_specificdata.c \ 59 subr_once.c subr_prf.c subr_specificdata.c subr_time.c \ 60 subr_workqueue.c subr_xcall.c 61 62# sys/uvm 63SRCS+= uvm_readahead.c 64 65# 4.4BSD secmodel. selection is hardcoded for now 66SRCS+= secmodel_suser.c 67 68# the funny bit. this doesn't really belong here, but helps with the 69# needs of kern_descrip.c. And since it's a fully dynamic interface, 70# it doesn't pull in other gunk. 71SRCS+= vnode_if.c 72 73# sys/dev 74SRCS+= clock_subr.c 75 76# Flip the comment to the other line if you want to use malloc(3) 77# directly instead of the kernel allocators backed by malloc(3)/mmap(2). 78# Libc malloc is a few percent faster, but doesn't emulate all kernel 79# corner cases as well (not to mention if you want to debug the 80# allocators themselves). 81#CPPFLAGS+= -DRUMP_USE_UNREAL_ALLOCATORS 82SRCS+= subr_kmem.c subr_percpu.c subr_pool.c subr_vmem.c 83 84# no shlib_version because this is automatically in sync with lib/librump 85SHLIB_MAJOR= 0 86SHLIB_MINOR= 0 87 88CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpvfs 89CPPFLAGS+= -I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpdev 90AFLAGS+= -D_LOCORE -Wa,-fatal-warnings 91 92# 93# If archdir exists, it is required to provide: 94# 1) kobj_reloc() and kobj_machdep() 95# 2) rump_cpu_bootstrap() 96# 3) ...? 97# 4) PROFIT! 98# 99 100# 101# Check if we are building compat. In compat mode we need to provide 102# the kernel of our compat target (amd64->i386 & sparc64->sparc), so 103# take MD stuff from the right arch. 104# 105.ifdef MLIBDIR 106ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MLIBDIR} 107LIBKERN_ARCH= ${MLIBDIR} 108.elif exists(${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU}) 109ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU} 110.else 111ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH} 112.endif 113.if exists(${ARCHDIR}) 114.include "${ARCHDIR}/Makefile.inc" 115.PATH: ${ARCHDIR} 116.else 117SRCS+= kobj_stubs.c rumpcpu_generic.c 118.endif 119 120# include libkern source files 121KERNDIR=${RUMPTOP}/../lib/libkern 122.ifdef RUMPKMOD 123KERNMISCCPPFLAGS+= -D_RUMPKERNEL 124.endif 125.include "${RUMPTOP}/../lib/libkern/Makefile.libkern" 126 127# Some architectures require a little special massage with atomic 128# compare-and-swap. This is because the kernel version is using 129# instructions or routines unavailable to us in userspace. We 130# use effectively the multiprocessor version of the userspace ops. 131# 132.if ${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "hppa" \ 133 || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \ 134 || ${MACHINE_CPU} == "vax" || ${MACHINE_ARCH} == "m68000" 135CPPFLAGS+= -I${RUMPTOP}/../../common/lib/libc/atomic 136SRCS+= atomic_cas_generic.c 137.endif 138 139.include <bsd.lib.mk> 140.include <bsd.klinks.mk> 141