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