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