Makefile.rumpkern revision 1.97
1# $NetBSD: Makefile.rumpkern,v 1.97 2010/09/06 20:10:20 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 lwproc.c klock.c \ 19 kobj_rename.c ltsleep.c memalloc.c scheduler.c \ 20 signals.c sleepq.c 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_prot.c \ 63 kern_rate.c \ 64 kern_resource.c \ 65 kern_stub.c \ 66 kern_syscall.c \ 67 kern_sysctl.c \ 68 kern_tc.c \ 69 kern_timeout.c \ 70 kern_uidinfo.c \ 71 param.c \ 72 subr_devsw.c \ 73 subr_callback.c \ 74 subr_copy.c \ 75 subr_device.c \ 76 subr_evcnt.c \ 77 subr_extent.c \ 78 subr_hash.c \ 79 subr_humanize.c \ 80 subr_iostat.c \ 81 subr_kobj.c \ 82 subr_log.c \ 83 subr_lwp_specificdata.c \ 84 subr_once.c \ 85 subr_prf.c \ 86 subr_specificdata.c \ 87 subr_time.c \ 88 subr_workqueue.c \ 89 subr_xcall.c \ 90 sys_descrip.c \ 91 sys_generic.c \ 92 sys_module.c \ 93 sys_pipe.c \ 94 sys_select.c \ 95 syscalls.c 96 97# sys/uvm 98SRCS+= uvm_aobj.c uvm_readahead.c 99 100# 4.4BSD secmodel. selection is hardcoded for now 101SRCS+= secmodel_suser.c 102 103# the funny bit. this doesn't really belong here, but helps with the 104# needs of kern_descrip.c. And since it's a fully dynamic interface, 105# it doesn't pull in other gunk. 106SRCS+= vnode_if.c 107 108# sys/dev 109SRCS+= clock_subr.c 110 111# Flip the comment to the other line if you want to use malloc(3) 112# directly instead of the kernel allocators backed by malloc(3)/mmap(2). 113# Libc malloc is a few percent faster, but doesn't emulate all kernel 114# corner cases as well (not to mention if you want to debug the 115# allocators themselves). 116#CPPFLAGS+= -DRUMP_USE_UNREAL_ALLOCATORS 117SRCS+= subr_kmem.c subr_percpu.c subr_pool.c subr_vmem.c 118 119# no shlib_version because this is automatically in sync with lib/librump 120SHLIB_MAJOR= 0 121SHLIB_MINOR= 0 122 123CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpvfs 124CPPFLAGS+= -I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpdev 125AFLAGS+= -D_LOCORE -Wa,-fatal-warnings 126 127# 128# If archdir exists, it is required to provide: 129# 1) kobj_reloc() and kobj_machdep() 130# 2) rump_cpu_bootstrap() 131# 3) ...? 132# 4) PROFIT! 133# 134 135# 136# Check if we are building compat. In compat mode we need to provide 137# the kernel of our compat target (amd64->i386 & sparc64->sparc), so 138# take MD stuff from the right arch. 139# 140.ifdef MLIBDIR 141ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MLIBDIR} 142LIBKERN_ARCH= ${MLIBDIR} 143.elif exists(${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU}) 144ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU} 145.else 146ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH} 147.endif 148.if exists(${ARCHDIR}) 149.include "${ARCHDIR}/Makefile.inc" 150.PATH: ${ARCHDIR} 151.else 152SRCS+= kobj_stubs.c rumpcpu_generic.c 153.endif 154 155.if ${MACHINE} == "sun3" 156CPPFLAGS+= -Dsun3 157.endif 158 159# include libkern source files 160KERNDIR=${RUMPTOP}/../lib/libkern 161.ifdef RUMPKMOD 162KERNMISCCPPFLAGS+= -D_RUMPKERNEL 163.endif 164.include "${RUMPTOP}/../lib/libkern/Makefile.libkern" 165 166# Some architectures require a little special massage with atomic 167# compare-and-swap. This is because the kernel version is using 168# instructions or routines unavailable to us in userspace. We 169# use effectively the multiprocessor version of the userspace ops. 170# 171.if ${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "hppa" \ 172 || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \ 173 || ${MACHINE_CPU} == "vax" || ${MACHINE_ARCH} == "m68000" 174CPPFLAGS+= -I${RUMPTOP}/../../common/lib/libc/atomic 175SRCS+= atomic_cas_generic.c 176.endif 177 178.include <bsd.lib.mk> 179.include <bsd.klinks.mk> 180