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