Makefile.rump revision 1.26
11.26Spooka#	$NetBSD: Makefile.rump,v 1.26 2009/01/10 20:19:43 pooka Exp $
21.1Spooka#
31.1Spooka
41.1SpookaWARNS?=		4
51.10SpookaNOLINT=		# kernel code
61.1Spooka
71.20Spooka.include <bsd.own.mk>
81.20Spooka
91.18Spooka# use kernel ABI instead of rump ABI (needs md code)
101.20Spooka.ifndef(RUMPKMOD)
111.18SpookaCPPFLAGS:=	-I${RUMPTOP}/include ${CPPFLAGS}
121.18Spooka.endif
131.18Spooka
141.22SpookaCFLAGS+=	-ffreestanding -fno-strict-aliasing
151.17SpookaCPPFLAGS+=	-D_RUMPKERNEL	# XXX: this should die
161.23SpookaCPPFLAGS+=	-D_KERNEL -DMULTIPROCESSOR -D_MODULE -DMODULAR
171.21SpookaCPPFLAGS+=	-DMAXUSERS=32
181.17SpookaCPPFLAGS+=	-DDIAGNOSTIC
191.15SpookaCPPFLAGS+=	-I${.CURDIR} -I.
201.14SpookaCPPFLAGS+=	-I${RUMPTOP}/../../common/include -I${RUMPTOP}/../arch
211.18SpookaCPPFLAGS+=	-I${RUMPTOP}/include
221.21SpookaCPPFLAGS+=	-I${RUMPTOP}/librump/rumpkern/opt
231.10SpookaCPPFLAGS+=	-nostdinc -I${RUMPTOP}/..
241.10Spooka#CPPFLAGS+=	-DDEBUG
251.1Spooka
261.11SpookaRUMPKERNEL=	This is NetBSD and I am the rump.  Good evening.
271.11Spooka
281.13Spooka# workaround: evbppc is not a well-defined arch
291.13Spooka.if (${MACHINE} == "evbppc")
301.16SpookaCPPFLAGS+=	-DPPC_OEA
311.13Spooka.endif
321.13Spooka
331.25Spooka# If this file changes, we need a full rebuild
341.25SpookaDPSRCS+=	${RUMPTOP}/Makefile.rump
351.24Spooka
361.24Spooka#
371.24Spooka# Rename library symbols before use.  If a symbol does not already belong
381.24Spooka# to a rump namespace ("rump" or "RUMP"), prefix it with "rumpns".  This
391.24Spooka# avoids accidentally linking any kernel symbol against host platform
401.24Spooka# libraries.  The only non-renamed symbols are linkset delimiters and
411.24Spooka# the GOT, which are more a property of the compiler than the kernel.
421.24Spooka#
431.26Spooka
441.24Spooka__archivebuild: .USE
451.24Spooka	${_MKTARGET_BUILD}
461.24Spooka	rm -f ${.TARGET}
471.24Spooka	${AR} cq ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
481.26Spooka.if ${MACHINE_CPU} != "mips" && ${MACHINE_CPU} != "sh3" \
491.26Spooka && ${MACHINE_CPU} != "arm" && ${MACHINE_CPU} != "sparc"
501.24Spooka	${NM} -go ${.TARGET} | ${TOOL_AWK} '	\
511.24Spooka	    $$NF!~/^(rump|RUMP|__(start|stop)_link_set|_GLOBAL_OFFSET_TABLE)/ \
521.24Spooka	      {printf "%s rumpns_%s\n", $$NF, $$NF}' \
531.24Spooka	    | sort | uniq  > renametab.${.TARGET}
541.24Spooka	${OBJCOPY} --redefine-syms renametab.${.TARGET} ${.TARGET}
551.24Spooka	rm -f renametab.${.TARGET}
561.26Spooka.endif
571.24Spooka	${RANLIB} ${.TARGET}
58