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