Makefile.rumpkern revision 1.112
1# $NetBSD: Makefile.rumpkern,v 1.112 2011/11/25 17:54:15 christos 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 cprng_stub.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_disk_open.c \ 88 subr_evcnt.c \ 89 subr_extent.c \ 90 subr_hash.c \ 91 subr_humanize.c \ 92 subr_iostat.c \ 93 subr_kobj.c \ 94 subr_log.c \ 95 subr_lwp_specificdata.c \ 96 subr_once.c \ 97 subr_prf.c \ 98 subr_specificdata.c \ 99 subr_time.c \ 100 subr_workqueue.c \ 101 subr_xcall.c \ 102 sys_descrip.c \ 103 sys_generic.c \ 104 sys_module.c \ 105 sys_pipe.c \ 106 sys_select.c \ 107 syscalls.c 108 109# sys/uvm 110SRCS+= uvm_aobj.c uvm_readahead.c uvm_object.c 111 112# 4.4BSD secmodel. selection is hardcoded for now 113SRCS+= secmodel_suser.c 114 115# the funny bit. this doesn't really belong here, but helps with the 116# needs of kern_descrip.c. And since it's a fully dynamic interface, 117# it doesn't pull in other gunk. 118SRCS+= vnode_if.c 119 120# sys/dev 121SRCS+= clock_subr.c 122 123# compat 124SRCS+= kern_select_50.c 125 126# Flip the comment to the other line if you want to use malloc(3) 127# directly instead of the kernel allocators backed by malloc(3)/mmap(2). 128# Libc malloc is a few percent faster, but doesn't emulate all kernel 129# corner cases as well (not to mention if you want to debug the 130# allocators themselves). 131#CPPFLAGS+= -DRUMP_USE_UNREAL_ALLOCATORS 132SRCS+= subr_kmem.c subr_percpu.c subr_pool.c subr_vmem.c 133 134.ifdef RUMP_LOCKDEBUG 135SRCS+= subr_lockdebug.c 136.endif 137 138# no shlib_version because this is automatically in sync with lib/librump 139SHLIB_MAJOR= 0 140SHLIB_MINOR= 0 141 142CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpvfs 143CPPFLAGS+= -I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpdev 144AFLAGS+= -D_LOCORE -Wa,--fatal-warnings 145 146# 147# If archdir exists, it is required to provide: 148# 1) kobj_reloc() and kobj_machdep() 149# 2) rump_cpu_bootstrap() 150# 3) ...? 151# 4) PROFIT! 152# 153 154# 155# Check if we are building compat. In compat mode we need to provide 156# the kernel of our compat target (amd64->i386 & sparc64->sparc), so 157# take MD stuff from the right arch. 158# 159.ifdef MLIBDIR 160ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MLIBDIR} 161LIBKERN_ARCH= ${MLIBDIR} 162.elif exists(${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU}) 163ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU} 164.else 165ARCHDIR= ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH} 166.endif 167.if exists(${ARCHDIR}) 168.include "${ARCHDIR}/Makefile.inc" 169.PATH: ${ARCHDIR} 170.else 171SRCS+= kobj_stubs.c rumpcpu_generic.c 172.endif 173 174.if ${MACHINE} == "sun3" 175CPPFLAGS+= -Dsun3 176.endif 177 178# include libkern source files 179KERNDIR=${RUMPTOP}/../lib/libkern 180.ifdef RUMPKMOD 181KERNMISCCPPFLAGS+= -D_RUMPKERNEL 182.endif 183.include "${RUMPTOP}/../lib/libkern/Makefile.libkern" 184 185# Some architectures require a little special massage with atomic 186# compare-and-swap. This is because the kernel version is using 187# instructions or routines unavailable to us in userspace. 188# 189.if ${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "hppa" \ 190 || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \ 191 || ${MACHINE_CPU} == "vax" || ${MACHINE_ARCH} == "m68000" 192CPPFLAGS+= -I${RUMPTOP}/../../common/lib/libc/atomic 193SRCS+= atomic_cas_generic.c 194#SRCS+= rump_atomic_cas_up.c 195.endif 196 197.include <bsd.lib.mk> 198.include <bsd.klinks.mk> 199