Makefile.rumpkern revision 1.135
1# $NetBSD: Makefile.rumpkern,v 1.135 2014/01/17 01:32:53 pooka Exp $ 2# 3 4.include "${RUMPTOP}/Makefile.rump" 5 6.include <bsd.own.mk> 7 8LIB= rump 9 10.PATH: ${RUMPTOP}/librump/rumpkern \ 11 ${RUMPTOP}/../kern \ 12 ${RUMPTOP}/../uvm \ 13 ${RUMPTOP}/../conf \ 14 ${RUMPTOP}/../dev \ 15 ${RUMPTOP}/../crypto/nist_ctr_drbg \ 16 ${RUMPTOP}/../crypto/rijndael \ 17 ${RUMPTOP}/../secmodel \ 18 ${RUMPTOP}/../secmodel/suser \ 19 ${RUMPTOP}/../compat/common 20 21# 22# Source modules, first the ones specifically implemented for librump. 23# 24SRCS+= rump.c rumpcopy.c cons.c emul.c intr.c lwproc.c klock.c \ 25 kobj_rename.c ltsleep.c scheduler.c \ 26 signals.c sleepq.c threads.c vm.c hyperentropy.c 27 28# autogenerated into the correct namespace 29RUMPOBJ_NORENAME= rump_syscalls.*o 30 31.ifdef RUMP_KERNEL_IS_LIBC 32CPPFLAGS+= -DRUMP_KERNEL_IS_LIBC 33.endif 34 35# optional hypervisor interfaces 36#SRCS+= hyperstubs.c 37 38# Multiprocessor or uniprocessor locking. TODO: select right 39# locking at runtime. 40SRCS+= locks.c 41#SRCS+= locks_up.c 42 43MKREPRO?=no 44 45.if ${MKREPRO} == "yes" 46_NVFLAGS=-r 47.else 48_NVFLAGS= 49.endif 50 51vers.c: ${RUMPTOP}/../conf/newvers.sh ${RUMPTOP}/../conf/osrelease.sh \ 52 ${RUMPTOP}/../sys/param.h ${_NETBSD_VERSION_DEPENDS} 53 ${_MKMSG_CREATE} vers.c 54 ${HOST_SH} ${RUMPTOP}/../conf/newvers.sh -i RUMP-ROAST -n ${_NVFLAGS} 55SRCS+= vers.c 56CLEANFILES+= vers.c version 57 58# use MI pmap for archs not conforming to kernel ABI 59.ifndef RUMPKMOD 60SRCS+= pmap_stub.c 61.endif 62 63# autogenerated 64# 65SRCS+= rump_syscalls.c rumpkern_if_wrappers.c 66 67# "auto"generated 68SRCS+= devsw.c 69 70# 71# std kernel sources 72# 73# sys/kern 74SRCS+= init_sysctl_base.c \ 75 kern_auth.c \ 76 kern_cfglock.c \ 77 kern_descrip.c \ 78 kern_event.c \ 79 kern_hook.c \ 80 kern_ksyms.c \ 81 kern_malloc.c \ 82 kern_module.c \ 83 kern_mutex_obj.c \ 84 kern_ntptime.c \ 85 kern_proc.c \ 86 kern_prot.c \ 87 kern_rate.c \ 88 kern_resource.c \ 89 kern_rndpool.c \ 90 kern_rndq.c \ 91 kern_rndsink.c \ 92 kern_stub.c \ 93 kern_syscall.c \ 94 kern_sysctl.c \ 95 kern_tc.c \ 96 kern_timeout.c \ 97 kern_uidinfo.c \ 98 kern_xxx.c \ 99 param.c \ 100 subr_devsw.c \ 101 subr_callback.c \ 102 subr_copy.c \ 103 subr_cprng.c \ 104 subr_device.c \ 105 subr_evcnt.c \ 106 subr_extent.c \ 107 subr_hash.c \ 108 subr_humanize.c \ 109 subr_iostat.c \ 110 subr_kcpuset.c \ 111 subr_kobj.c \ 112 subr_log.c \ 113 subr_lwp_specificdata.c \ 114 subr_once.c \ 115 subr_percpu.c \ 116 subr_prf.c \ 117 subr_pserialize.c \ 118 subr_specificdata.c \ 119 subr_time.c \ 120 subr_vmem.c \ 121 subr_workqueue.c \ 122 subr_xcall.c \ 123 sys_descrip.c \ 124 sys_generic.c \ 125 sys_module.c \ 126 sys_pipe.c \ 127 sys_select.c \ 128 syscalls.c \ 129 uipc_sem.c 130 131# sys/uvm 132SRCS+= uvm_aobj.c uvm_readahead.c uvm_object.c 133 134# 4.4BSD secmodel. selection is hardcoded for now 135SRCS+= secmodel.c 136SRCS+= secmodel_suser.c 137 138# the funny bit. this doesn't really belong here, but helps with the 139# needs of kern_descrip.c. And since it's a fully dynamic interface, 140# it doesn't pull in other gunk. 141SRCS+= vnode_if.c 142 143# sys/dev 144SRCS+= clock_subr.c 145 146# sys/dev/crypto 147# Note: these are here only for cprng. More crypto algos for drivers 148# are available from the rumpkern_crypto component 149SRCS+= nist_ctr_drbg.c 150SRCS+= rijndael-alg-fst.c 151SRCS+= rijndael-api-fst.c 152SRCS+= rijndael.c 153 154# compat 155SRCS+= kern_select_50.c 156 157# Set RUMP_UNREAL_ALLOCATORS to "yes" to use memory allocation hypercalls 158# directly instead of the kmem/pool allocators backed by hypercalls. 159# Direct hypercalls may be a few percent faster, but don't emulate 160# all kernel corner cases as well (not to mention if you want to debug the 161# allocators themselves). 162.if defined(RUMP_UNREAL_ALLOCATORS) && ${RUMP_UNREAL_ALLOCATORS} == "yes" 163SRCS+= memalloc.c 164.else 165SRCS+= subr_kmem.c subr_pool.c 166.endif 167 168.ifdef RUMP_LOCKDEBUG 169SRCS+= subr_lockdebug.c 170.endif 171 172.if ${RUMP_KTRACE} == "yes" 173SRCS+= kern_ktrace.c 174.endif 175 176# no shlib_version because this is automatically in sync with lib/librump 177SHLIB_MAJOR= 0 178SHLIB_MINOR= 0 179 180CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpvfs 181CPPFLAGS+= -I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpdev 182AFLAGS+= -D_LOCORE -Wa,--fatal-warnings 183 184# 185# If archdir exists, it is required to provide: 186# 1) kobj_reloc() and kobj_machdep() 187# 2) rump_cpu_bootstrap() 188# 3) ...? 189# 4) PROFIT! 190# 191 192# 193# Check if we are building compat. In compat mode we need to provide 194# the kernel of our compat target (amd64->i386 & sparc64->sparc), so 195# take MD stuff from the right arch. 196# 197.ifdef MLIBDIR 198ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MLIBDIR} 199LIBKERN_ARCH= ${MLIBDIR} 200.elif exists(${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU}) 201ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU} 202.else 203ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH} 204.endif 205.if exists(${ARCHDIR}) 206.include "${ARCHDIR}/Makefile.inc" 207.PATH: ${ARCHDIR} 208.else 209SRCS+= kobj_stubs.c rumpcpu_generic.c 210.endif 211 212.if ${MACHINE} == "sun3" 213CPPFLAGS+= -Dsun3 214.endif 215 216# include libkern source files 217KERNDIR=${RUMPTOP}/../lib/libkern 218.ifdef RUMPKMOD 219KERNMISCCPPFLAGS+= -D_RUMPKERNEL 220.endif 221.include "${RUMPTOP}/../lib/libkern/Makefile.libkern" 222 223# Some architectures require a little special massage with atomic 224# compare-and-swap. This is because the kernel version is using 225# instructions or routines unavailable to us in userspace. 226# 227.if (${MACHINE_CPU} == "arm" && empty(ARMV6) && empty(ARMV7)) \ 228 || ${MACHINE_ARCH} == "coldfire" || ${MACHINE_CPU} == "hppa" \ 229 || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \ 230 || ${MACHINE_ARCH} == "vax" || ${MACHINE_ARCH} == "m68000" 231CPPFLAGS+= -I${RUMPTOP}/../../common/lib/libc/atomic 232SRCS+= atomic_cas_generic.c 233#SRCS+= rump_atomic_cas_up.c 234.endif 235 236.include <bsd.lib.mk> 237.include <bsd.klinks.mk> 238