2009-09-07 17:02:37 +04:00
|
|
|
# $NetBSD: Makefile.rump,v 1.39 2009/09/07 13:02:37 pooka Exp $
|
2007-08-06 02:28:00 +04:00
|
|
|
#
|
|
|
|
|
2009-02-12 16:23:17 +03:00
|
|
|
WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet
|
2008-07-29 17:17:40 +04:00
|
|
|
NOLINT= # kernel code
|
2007-08-06 02:28:00 +04:00
|
|
|
|
2008-12-31 00:31:10 +03:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2008-12-30 01:16:15 +03:00
|
|
|
# use kernel ABI instead of rump ABI (needs md code)
|
2009-01-18 23:42:11 +03:00
|
|
|
.ifndef RUMPKMOD
|
2008-12-30 01:16:15 +03:00
|
|
|
CPPFLAGS:= -I${RUMPTOP}/include ${CPPFLAGS}
|
|
|
|
.endif
|
|
|
|
|
2009-01-02 01:16:35 +03:00
|
|
|
CFLAGS+= -ffreestanding -fno-strict-aliasing
|
2009-01-23 22:14:30 +03:00
|
|
|
CPPFLAGS+= -D_RUMPKERNEL
|
2009-01-02 14:13:38 +03:00
|
|
|
CPPFLAGS+= -D_KERNEL -DMULTIPROCESSOR -D_MODULE -DMODULAR
|
2009-01-01 22:43:57 +03:00
|
|
|
CPPFLAGS+= -DMAXUSERS=32
|
2008-12-29 21:53:57 +03:00
|
|
|
CPPFLAGS+= -DDIAGNOSTIC
|
2009-01-23 22:14:30 +03:00
|
|
|
CPPFLAGS+= -DCOMPAT_50
|
2009-05-03 20:53:54 +04:00
|
|
|
CPPFLAGS+= -DDEBUGPRINT
|
2008-12-17 02:17:17 +03:00
|
|
|
CPPFLAGS+= -I${.CURDIR} -I.
|
2008-12-17 02:16:46 +03:00
|
|
|
CPPFLAGS+= -I${RUMPTOP}/../../common/include -I${RUMPTOP}/../arch
|
2008-12-30 01:16:15 +03:00
|
|
|
CPPFLAGS+= -I${RUMPTOP}/include
|
2009-01-01 22:43:57 +03:00
|
|
|
CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern/opt
|
2008-07-29 17:17:40 +04:00
|
|
|
CPPFLAGS+= -nostdinc -I${RUMPTOP}/..
|
|
|
|
#CPPFLAGS+= -DDEBUG
|
2007-08-16 02:13:15 +04:00
|
|
|
|
2009-09-07 17:02:37 +04:00
|
|
|
# make sure __NetBSD__ gets defined (for builds on non-NetBSD)
|
|
|
|
CPPFLAGS+= -D__NetBSD__
|
|
|
|
|
2008-07-30 00:18:25 +04:00
|
|
|
RUMPKERNEL= This is NetBSD and I am the rump. Good evening.
|
|
|
|
|
2008-12-08 15:57:33 +03:00
|
|
|
# workaround: evbppc is not a well-defined arch
|
|
|
|
.if (${MACHINE} == "evbppc")
|
2008-12-17 02:49:48 +03:00
|
|
|
CPPFLAGS+= -DPPC_OEA
|
2008-12-08 15:57:33 +03:00
|
|
|
.endif
|
|
|
|
|
2009-01-08 23:00:12 +03:00
|
|
|
# If this file changes, we need a full rebuild
|
|
|
|
DPSRCS+= ${RUMPTOP}/Makefile.rump
|
2009-01-08 21:42:42 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Rename library symbols before use. If a symbol does not already belong
|
|
|
|
# to a rump namespace ("rump" or "RUMP"), prefix it with "rumpns". This
|
|
|
|
# avoids accidentally linking any kernel symbol against host platform
|
|
|
|
# libraries. The only non-renamed symbols are linkset delimiters and
|
|
|
|
# the GOT, which are more a property of the compiler than the kernel.
|
|
|
|
#
|
2009-01-12 05:22:55 +03:00
|
|
|
# Some toolchains generate unresolved symbols which are supposed to be
|
|
|
|
# satisfied by the toolchain itself when the program is linked.
|
|
|
|
# Unfortunately, we do not know which of the symbols are generated by
|
|
|
|
# the toolchain. Worse, they vary from platform to platform and
|
|
|
|
# toolchain to toolchain. The good news, however, is that this will
|
|
|
|
# be detected by a compile-time failure, so we can fairly easily manage
|
|
|
|
# a quirktable here.
|
|
|
|
.if ${MACHINE_CPU} == "mips"
|
|
|
|
_SYMQUIRK='|_gp_disp'
|
|
|
|
.elif ${MACHINE_CPU} == "hppa"
|
|
|
|
_SYMQUIRK='|\$$\$$'
|
|
|
|
.endif
|
2009-01-08 21:42:42 +03:00
|
|
|
__archivebuild: .USE
|
|
|
|
${_MKTARGET_BUILD}
|
|
|
|
rm -f ${.TARGET}
|
2009-03-19 15:01:50 +03:00
|
|
|
${AR} ${_ARFL} ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
|
2009-01-08 21:42:42 +03:00
|
|
|
${NM} -go ${.TARGET} | ${TOOL_AWK} ' \
|
2009-01-12 05:22:55 +03:00
|
|
|
$$NF!~/^(rump|RUMP|__|_GLOBAL_OFFSET_TABLE'${_SYMQUIRK}')/ \
|
2009-01-08 21:42:42 +03:00
|
|
|
{printf "%s rumpns_%s\n", $$NF, $$NF}' \
|
|
|
|
| sort | uniq > renametab.${.TARGET}
|
2009-04-27 00:45:37 +04:00
|
|
|
${OBJCOPY} --preserve-dates --redefine-syms \
|
|
|
|
renametab.${.TARGET} ${.TARGET}
|
2009-01-08 21:42:42 +03:00
|
|
|
rm -f renametab.${.TARGET}
|
2009-04-01 21:51:12 +04:00
|
|
|
${AR} ${_ARRANFL} ${.TARGET}
|