1 # $NetBSD: Makefile.rumpkern,v 1.45 2009/05/02 14:16:52 pooka Exp $ 2 # 3 4 .include "${RUMPTOP}/Makefile.rump" 5 6 LIB= rump 7 8 .PATH: ${RUMPTOP}/librump/rumpkern \ 9 ${RUMPTOP}/../kern \ 10 ${RUMPTOP}/../conf \ 11 ${RUMPTOP}/../dev \ 12 ${RUMPTOP}/../secmodel/bsd44 13 14 # 15 # Source modules, first the ones specifically implemented for librump. 16 # 17 SRCS= rump.c emul.c intr.c locks.c ltsleep.c percpu.c pool.c \ 18 sleepq.c sysproxy_socket.c vm.c 19 20 # stubs 21 # 22 SRCS+= misc_stub.c pmap_stub.c 23 24 # autogenerated 25 # 26 SRCS+= rump_syscalls.c 27 28 # 29 # Rest are from the std kernel sources. 30 # 31 # sys/kern 32 SRCS+= kern_auth.c kern_descrip.c kern_event.c kern_ksyms.c \ 33 kern_malloc_stdtype.c kern_module.c kern_rate.c kern_stub.c \ 34 kern_sysctl.c kern_timeout.c kern_uidinfo.c param.c \ 35 sys_descrip.c sys_generic.c 36 37 # sys/kern subr (misc) 38 SRCS+= subr_devsw.c subr_callback.c subr_evcnt.c subr_hash.c \ 39 subr_iostat.c subr_kobj.c subr_log.c subr_once.c subr_prf.c \ 40 subr_specificdata.c subr_time.c subr_workqueue.c 41 42 # 4.4BSD secmodel. selection is hardcoded for now 43 SRCS+= secmodel_bsd44.c secmodel_bsd44_logic.c secmodel_bsd44_suser.c 44 45 # the funny bit. this doesn't really belong here, but helps with the 46 # needs of kern_descrip.c. And since it's a fully dynamic interface, 47 # it doesn't pull in other gunk. 48 SRCS+= vnode_if.c 49 50 # sys/dev 51 SRCS+= clock_subr.c 52 53 # Comment these if you want to use malloc(3) directly instead of 54 # the kernel allocators. It's a few percent faster, but doesn't 55 # emulate all kernel corner cases as well. 56 #CPPFLAGS+= -DRUMP_USE_REAL_ALLOCATORS 57 #SRCS+= subr_kmem.c subr_pool.c subr_vmem.c 58 59 # no shlib_version because this is automatically in sync with lib/librump 60 SHLIB_MAJOR= 0 61 SHLIB_MINOR= 0 62 63 CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern 64 CPPFLAGS+= -I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpvfs 65 CFLAGS+= -Wno-pointer-sign 66 AFLAGS+= -D_LOCORE -Wa,-fatal-warnings 67 68 # 69 # If archdir exists, it is required to provide: 70 # 1) kobj_reloc() and kobj_machdep() 71 # 2) ...? 72 # 3) PROFIT! 73 # 74 75 # 76 # Check if we are building compat. In compat mode we need to provide 77 # the kernel of our compat target (amd64->i386 & sparc64->sparc), so 78 # take MD stuff from the right arch. 79 # 80 .ifdef LD32DIR 81 ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${LD32DIR} 82 LIBKERN_ARCH= ${LD32DIR} 83 .else 84 ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH} 85 .endif 86 .if exists(${ARCHDIR}) 87 .include "${ARCHDIR}/Makefile.inc" 88 .PATH: ${ARCHDIR} 89 .else 90 SRCS+= kobj_stubs.c 91 .endif 92 93 # include libkern source files 94 KERNDIR=${RUMPTOP}/../lib/libkern 95 .include "${RUMPTOP}/../lib/libkern/Makefile.libkern" 96 97 # Some architectures require a little special massage with atomic 98 # compare-and-swap. This is because the kernel version is using 99 # instructions or routines unavailable to us in userspace. We 100 # use effectively the multiprocessor version of the userspace ops. 101 # 102 .if ${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "hppa" \ 103 || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \ 104 || ${MACHINE_CPU} == "vax" 105 CPPFLAGS+= -I${RUMPTOP}/../../common/lib/libc/atomic 106 SRCS+= atomic_cas_generic.c 107 .endif 108 109 .include <bsd.lib.mk> 110 .include <bsd.klinks.mk> 111