Makefile.rump revision 1.27
1#	$NetBSD: Makefile.rump,v 1.27 2009/01/10 23:38:40 pooka Exp $
2#
3
4WARNS?=		4
5NOLINT=		# kernel code
6
7.include <bsd.own.mk>
8
9# use kernel ABI instead of rump ABI (needs md code)
10.ifndef(RUMPKMOD)
11CPPFLAGS:=	-I${RUMPTOP}/include ${CPPFLAGS}
12.endif
13
14CFLAGS+=	-ffreestanding -fno-strict-aliasing
15CPPFLAGS+=	-D_RUMPKERNEL	# XXX: this should die
16CPPFLAGS+=	-D_KERNEL -DMULTIPROCESSOR -D_MODULE -DMODULAR
17CPPFLAGS+=	-DMAXUSERS=32
18CPPFLAGS+=	-DDIAGNOSTIC
19CPPFLAGS+=	-I${.CURDIR} -I.
20CPPFLAGS+=	-I${RUMPTOP}/../../common/include -I${RUMPTOP}/../arch
21CPPFLAGS+=	-I${RUMPTOP}/include
22CPPFLAGS+=	-I${RUMPTOP}/librump/rumpkern/opt
23CPPFLAGS+=	-nostdinc -I${RUMPTOP}/..
24#CPPFLAGS+=	-DDEBUG
25
26RUMPKERNEL=	This is NetBSD and I am the rump.  Good evening.
27
28# workaround: evbppc is not a well-defined arch
29.if (${MACHINE} == "evbppc")
30CPPFLAGS+=	-DPPC_OEA
31.endif
32
33# If this file changes, we need a full rebuild
34DPSRCS+=	${RUMPTOP}/Makefile.rump
35
36#
37# Rename library symbols before use.  If a symbol does not already belong
38# to a rump namespace ("rump" or "RUMP"), prefix it with "rumpns".  This
39# avoids accidentally linking any kernel symbol against host platform
40# libraries.  The only non-renamed symbols are linkset delimiters and
41# the GOT, which are more a property of the compiler than the kernel.
42#
43
44__archivebuild: .USE
45	${_MKTARGET_BUILD}
46	rm -f ${.TARGET}
47	${AR} cq ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
48.if ${MACHINE_CPU} != "mips" && ${MACHINE_CPU} != "sh3" \
49 && ${MACHINE_CPU} != "arm" && ${MACHINE_CPU} != "vax"
50	${NM} -go ${.TARGET} | ${TOOL_AWK} '	\
51	    $$NF!~/^(rump|RUMP|__(start|stop)_link_set|_GLOBAL_OFFSET_TABLE)/ \
52	      {printf "%s rumpns_%s\n", $$NF, $$NF}' \
53	    | sort | uniq  > renametab.${.TARGET}
54	${OBJCOPY} --redefine-syms renametab.${.TARGET} ${.TARGET}
55	rm -f renametab.${.TARGET}
56.endif
57	${RANLIB} ${.TARGET}
58