1 # $NetBSD: Makefile.rump,v 1.44 2009/11/27 13:36:30 pooka Exp $
4 WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet
9 # use kernel ABI instead of rump ABI (needs md code)
11 CPPFLAGS:= -I${RUMPTOP}/include ${CPPFLAGS}
14 CFLAGS+= -ffreestanding -fno-strict-aliasing
15 CWARNFLAGS+= -Wno-format-zero-length
16 CPPFLAGS+= -D_RUMPKERNEL
17 CPPFLAGS+= -D_KERNEL -DMULTIPROCESSOR -D_MODULE -DMODULAR
18 CPPFLAGS+= -DMAXUSERS=32
19 CPPFLAGS+= -DDIAGNOSTIC
20 CPPFLAGS+= -DCOMPAT_50
21 CPPFLAGS+= -DDEBUGPRINT
22 CPPFLAGS+= -I${.CURDIR} -I.
23 CPPFLAGS+= -I${RUMPTOP}/../../common/include -I${RUMPTOP}/../arch
24 CPPFLAGS+= -I${RUMPTOP}/include
25 CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern/opt
26 CPPFLAGS+= -nostdinc -I${RUMPTOP}/..
27 LDFLAGS+= -T ${RUMPTOP}/ldscript.rump
30 # kernel libs should not get linked against libc
31 # XXX: actually, we would like to enable this but cannot, since it
32 # also leaves out libgcc, it causes problems on some platforms.
34 #LDFLAGS+= -nodefaultlibs
36 # make sure __NetBSD__ gets defined (for builds on non-NetBSD)
37 CPPFLAGS+= -D__NetBSD__
39 RUMPKERNEL= This is NetBSD and I am the rump. Good evening.
41 # workaround: evbppc is not a well-defined arch
42 .if (${MACHINE} == "evbppc")
46 # If this file changes, we need a full rebuild
47 DPSRCS+= ${RUMPTOP}/Makefile.rump
50 # Rename library symbols before use. If a symbol does not already belong
51 # to a rump namespace ("rump" or "RUMP"), prefix it with "rumpns". This
52 # avoids accidentally linking any kernel symbol against host platform
53 # libraries. The only non-renamed symbols are linkset delimiters and
54 # the GOT, which are more a property of the compiler than the kernel.
56 # Some toolchains generate unresolved symbols which are supposed to be
57 # satisfied by the toolchain itself when the program is linked.
58 # Unfortunately, we do not know which of the symbols are generated by
59 # the toolchain. Worse, they vary from platform to platform and
60 # toolchain to toolchain. The good news, however, is that this will
61 # be detected by a compile-time failure, so we can fairly easily manage
63 .if ${MACHINE_CPU} == "mips"
65 .elif ${MACHINE_CPU} == "hppa"
71 ${AR} ${_ARFL} ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
72 ${NM} -go ${.TARGET} | ${TOOL_AWK} ' \
73 $$NF!~/^(rump|RUMP|__|_GLOBAL_OFFSET_TABLE'${_SYMQUIRK}')/ \
74 {printf "%s rumpns_%s\n", $$NF, $$NF}' \
75 | sort | uniq > renametab.${.TARGET}
76 ${OBJCOPY} --preserve-dates --redefine-syms \
77 renametab.${.TARGET} ${.TARGET}
78 rm -f renametab.${.TARGET}
79 ${AR} ${_ARRANFL} ${.TARGET}
81 .-include "${NETBSDSRCDIR}/sys/arch/${MACHINE_CPU}/include/Makefile.inc"
82 .-include "${NETBSDSRCDIR}/sys/arch/${MACHINE}/include/Makefile.inc"