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