Home | History | Annotate | Line # | Download | only in rumpkern
Makefile.rumpkern revision 1.148.4.1
      1 #	$NetBSD: Makefile.rumpkern,v 1.148.4.1 2019/09/03 12:30:46 martin Exp $
      2 #
      3 
      4 .include "${RUMPTOP}/Makefile.rump"
      5 
      6 .include <bsd.own.mk>
      7 
      8 LIB=		rump
      9 
     10 .PATH:	${RUMPTOP}/librump/rumpkern				\
     11 	${RUMPTOP}/librump/rumpkern/arch/generic		\
     12 	${RUMPTOP}/../kern					\
     13 	${RUMPTOP}/../uvm					\
     14 	${RUMPTOP}/../conf					\
     15 	${RUMPTOP}/../dev					\
     16 	${RUMPTOP}/../crypto/nist_hash_drbg			\
     17 	${RUMPTOP}/../crypto/cprng_fast				\
     18 	${RUMPTOP}/../secmodel					\
     19 	${RUMPTOP}/../secmodel/suser				\
     20 	${RUMPTOP}/../compat/common
     21 
     22 #
     23 # Source modules, first the ones specifically implemented for librump.
     24 # 
     25 SRCS+=	rump.c rumpcopy.c cons.c emul.c etfs_wrap.c intr.c	\
     26 	lwproc.c klock.c kobj_rename.c ltsleep.c scheduler.c	\
     27 	signals.c sleepq.c threads.c vm.c hyperentropy.c	\
     28 	accessors.c
     29 
     30 SRCS+=	rumpkern_syscalls.c
     31 
     32 # autogenerated into the correct namespace
     33 RUMPOBJ_NORENAME= rump_syscalls.o rump_syscalls.pico rump_syscalls.po
     34 
     35 .ifdef RUMP_KERNEL_IS_LIBC
     36 CPPFLAGS+= -DRUMP_KERNEL_IS_LIBC
     37 .endif
     38 
     39 # optional hypervisor interfaces
     40 #SRCS+=	hyperstubs.c
     41 
     42 # Multiprocessor or uniprocessor locking.  TODO: select right
     43 # locking at runtime.
     44 .if ${RUMP_LOCKS_UP:Uno} == "yes"
     45 SRCS+=	locks_up.c
     46 .else
     47 SRCS+=	locks.c
     48 .endif
     49 
     50 MKREPRO?=no
     51 
     52 .if ${MKREPRO} == "yes"
     53 _NVFLAGS=-r
     54 .else
     55 _NVFLAGS=
     56 .endif
     57 
     58 vers.c: ${RUMPTOP}/../conf/newvers.sh ${RUMPTOP}/../conf/osrelease.sh \
     59 		${RUMPTOP}/../sys/param.h ${_NETBSD_VERSION_DEPENDS}
     60 	${_MKMSG_CREATE} vers.c
     61 	${HOST_SH} ${RUMPTOP}/../conf/newvers.sh -i RUMP-ROAST -n ${_NVFLAGS}
     62 SRCS+=		vers.c
     63 CLEANFILES+=	vers.c version
     64 
     65 # autogenerated
     66 #
     67 SRCS+=	rump_syscalls.c rumpkern_if_wrappers.c
     68 
     69 # "auto"generated
     70 SRCS+=	devsw.c
     71 
     72 #
     73 # std kernel sources
     74 #
     75 # sys/kern
     76 SRCS+=	init_sysctl_base.c	\
     77 	kern_auth.c		\
     78 	kern_cfglock.c		\
     79 	kern_descrip.c		\
     80 	kern_event.c		\
     81 	kern_hook.c		\
     82 	kern_ksyms.c		\
     83 	kern_malloc.c		\
     84 	kern_module.c		\
     85 	kern_mutex_obj.c	\
     86 	kern_ntptime.c		\
     87 	kern_proc.c		\
     88 	kern_prot.c		\
     89 	kern_rate.c		\
     90 	kern_resource.c		\
     91 	kern_rndpool.c		\
     92 	kern_rndq.c		\
     93 	kern_rndsink.c		\
     94 	kern_stub.c		\
     95 	kern_syscall.c		\
     96 	kern_sysctl.c		\
     97 	kern_tc.c		\
     98 	kern_time.c		\
     99 	kern_timeout.c		\
    100 	kern_uidinfo.c		\
    101 	kern_xxx.c		\
    102 	param.c			\
    103 	subr_devsw.c		\
    104 	subr_callback.c		\
    105 	subr_copy.c		\
    106 	subr_cprng.c		\
    107 	subr_device.c		\
    108 	subr_evcnt.c		\
    109 	subr_extent.c		\
    110 	subr_hash.c		\
    111 	subr_humanize.c		\
    112 	subr_iostat.c		\
    113 	subr_kcpuset.c		\
    114 	subr_kobj.c		\
    115 	subr_log.c		\
    116 	subr_lwp_specificdata.c	\
    117 	subr_once.c		\
    118 	subr_pcq.c		\
    119 	subr_percpu.c		\
    120 	subr_prf.c		\
    121 	subr_pserialize.c	\
    122 	subr_specificdata.c	\
    123 	subr_time.c		\
    124 	subr_vmem.c		\
    125 	subr_workqueue.c	\
    126 	subr_xcall.c		\
    127 	sys_descrip.c		\
    128 	sys_generic.c		\
    129 	sys_module.c		\
    130 	sys_pipe.c		\
    131 	sys_select.c		\
    132 	syscalls.c		\
    133 	uipc_sem.c
    134 
    135 # sys/uvm
    136 SRCS+=	uvm_aobj.c uvm_readahead.c uvm_object.c uvm_swapstub.c
    137 
    138 # 4.4BSD secmodel.  selection is hardcoded for now
    139 SRCS+=	secmodel.c
    140 SRCS+=	secmodel_suser.c
    141 
    142 # the funny bit.  this doesn't really belong here, but helps with the
    143 # needs of kern_descrip.c.  And since it's a fully dynamic interface,
    144 # it doesn't pull in other gunk.
    145 SRCS+=	vnode_if.c
    146 
    147 # sys/dev
    148 SRCS+=	clock_subr.c
    149 
    150 # sys/dev/crypto
    151 # Note: these are here only for cprng.  More crypto algos for drivers
    152 # are available from the rumpkern_crypto component
    153 SRCS+=	nist_hash_drbg.c
    154 SRCS+=	cprng_fast.c
    155 
    156 # compat
    157 SRCS+=	kern_select_50.c
    158 SRCS+=	kern_time_50.c
    159 
    160 # Set RUMP_UNREAL_ALLOCATORS to "yes" to use memory allocation hypercalls
    161 # directly instead of the kmem/pool allocators backed by hypercalls.
    162 # Direct hypercalls may be a few percent faster, but don't emulate
    163 # all kernel corner cases as well (not to mention if you want to debug the
    164 # allocators themselves).
    165 .if defined(RUMP_UNREAL_ALLOCATORS) && ${RUMP_UNREAL_ALLOCATORS} == "yes"
    166 SRCS+=		memalloc.c
    167 .else
    168 SRCS+=		subr_kmem.c subr_pool.c
    169 .endif
    170 
    171 .ifdef RUMP_LOCKDEBUG
    172 SRCS+=		subr_lockdebug.c
    173 .endif
    174 
    175 .if ${RUMP_KTRACE} == "yes"
    176 SRCS+=		kern_ktrace.c
    177 .endif
    178 
    179 # no shlib_version because this is automatically in sync with lib/librump
    180 SHLIB_MAJOR=    0
    181 SHLIB_MINOR=    0
    182 
    183 CPPFLAGS+=	-I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpvfs
    184 CPPFLAGS+=	-I${RUMPTOP}/librump/rumpnet -I${RUMPTOP}/librump/rumpdev
    185 AFLAGS+=	-D_LOCORE -Wa,--fatal-warnings
    186 
    187 #
    188 # If archdir exists, it is required to provide:
    189 # 1) kobj_reloc() and kobj_machdep()
    190 # 2) rump_cpu_bootstrap()
    191 # 3) ...?
    192 # 4) PROFIT!
    193 #
    194 
    195 #
    196 # Check if we are building compat.  In compat mode we need to provide
    197 # the kernel of our compat target (amd64->i386 & sparc64->sparc), so
    198 # take MD stuff from the right arch.
    199 #
    200 .ifdef MLIBDIR
    201 ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MLIBDIR}
    202 LIBKERN_ARCH=	${MLIBDIR}
    203 .elif exists(${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU})
    204 ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MACHINE_CPU}
    205 .else
    206 ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH}
    207 .endif
    208 .if !exists(${ARCHDIR})
    209 ARCHDIR=	${RUMPTOP}/librump/rumpkern/arch/generic
    210 .endif
    211 
    212 .include "${ARCHDIR}/Makefile.inc"
    213 .PATH:	${ARCHDIR}
    214 
    215 .if ${MACHINE} == "sun3"
    216 CPPFLAGS+=	-Dsun3
    217 .endif
    218 
    219 # include libkern source files
    220 KERNDIR=${RUMPTOP}/../lib/libkern
    221 .if "${_RUMP_NATIVEABI}" == "yes"
    222 KERNMISCCPPFLAGS+=	-D_RUMPKERNEL
    223 .endif
    224 .include "${RUMPTOP}/../lib/libkern/Makefile.libkern"
    225 
    226 # Some architectures require a little special massage with atomic
    227 # compare-and-swap.  This is because the kernel version is using
    228 # instructions or routines unavailable to us in userspace.
    229 #
    230 .if (${MACHINE_CPU} == "arm" && "${FEAT_LDREX}" != "yes") \
    231     || ${MACHINE_ARCH} == "coldfire" || ${MACHINE_CPU} == "hppa" \
    232     || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \
    233     || ${MACHINE_ARCH} == "vax" || ${MACHINE_ARCH} == "m68000"
    234 CPPFLAGS+=	-I${RUMPTOP}/../../common/lib/libc/atomic
    235 SRCS+=		atomic_cas_generic.c
    236 #SRCS+=		rump_atomic_cas_up.c
    237 .endif
    238 
    239 .include <bsd.lib.mk>
    240 .include <bsd.klinks.mk>
    241