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