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