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