Annotation of src/sys/rump/Makefile.rump, Revision 1.49
1.49 ! pooka 1: # $NetBSD: Makefile.rump,v 1.48 2010/02/03 21:15:39 pooka Exp $
1.1 pooka 2: #
3:
1.33 lukem 4: WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet
1.10 pooka 5: NOLINT= # kernel code
1.1 pooka 6:
1.20 pooka 7: .include <bsd.own.mk>
8:
1.18 pooka 9: # use kernel ABI instead of rump ABI (needs md code)
1.31 he 10: .ifndef RUMPKMOD
1.18 pooka 11: CPPFLAGS:= -I${RUMPTOP}/include ${CPPFLAGS}
12: .endif
13:
1.22 pooka 14: CFLAGS+= -ffreestanding -fno-strict-aliasing
1.40 pooka 15: CWARNFLAGS+= -Wno-format-zero-length
1.32 pooka 16: CPPFLAGS+= -D_RUMPKERNEL
1.23 pooka 17: CPPFLAGS+= -D_KERNEL -DMULTIPROCESSOR -D_MODULE -DMODULAR
1.21 pooka 18: CPPFLAGS+= -DMAXUSERS=32
1.17 pooka 19: CPPFLAGS+= -DDIAGNOSTIC
1.32 pooka 20: CPPFLAGS+= -DCOMPAT_50
1.38 pooka 21: CPPFLAGS+= -DDEBUGPRINT
1.15 pooka 22: CPPFLAGS+= -I${.CURDIR} -I.
1.14 pooka 23: CPPFLAGS+= -I${RUMPTOP}/../../common/include -I${RUMPTOP}/../arch
1.18 pooka 24: CPPFLAGS+= -I${RUMPTOP}/include
1.21 pooka 25: CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern/opt
1.10 pooka 26: CPPFLAGS+= -nostdinc -I${RUMPTOP}/..
1.45 pooka 27: LDFLAGS+= -T ${RUMPTOP}/ldscript.rump
1.10 pooka 28: #CPPFLAGS+= -DDEBUG
1.1 pooka 29:
1.42 pooka 30: # kernel libs should not get linked against libc
1.43 pooka 31: # XXX: actually, we would like to enable this but cannot, since it
32: # also leaves out libgcc, it causes problems on some platforms.
33: # revisit some day.
34: #LDFLAGS+= -nodefaultlibs
1.42 pooka 35:
1.39 pooka 36: # make sure __NetBSD__ gets defined (for builds on non-NetBSD)
37: CPPFLAGS+= -D__NetBSD__
38:
1.11 pooka 39: RUMPKERNEL= This is NetBSD and I am the rump. Good evening.
40:
1.13 pooka 41: # workaround: evbppc is not a well-defined arch
42: .if (${MACHINE} == "evbppc")
1.16 pooka 43: CPPFLAGS+= -DPPC_OEA
1.13 pooka 44: .endif
45:
1.25 pooka 46: # If this file changes, we need a full rebuild
47: DPSRCS+= ${RUMPTOP}/Makefile.rump
1.24 pooka 48:
49: #
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.
55: #
1.29 pooka 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
62: # a quirktable here.
1.46 pooka 63: #
64: # We also allow calling ourselves externally with e.g.:
65: # make -f /sys/rump/Makefile.rump RUMP_SYMREN=ffs.kobj
66: #
1.29 pooka 67: .if ${MACHINE_CPU} == "mips"
68: _SYMQUIRK='|_gp_disp'
69: .elif ${MACHINE_CPU} == "hppa"
70: _SYMQUIRK='|\$$\$$'
71: .endif
1.46 pooka 72:
73: rump_symren: __archivebuild
74: .if !defined(RUMP_SYMREN)
75: @echo "Must supply RUMP_SYMREN for target rump_symren"
76: @false
77: .endif
78:
79: # if we are called from lib build (RUMP_SYMREN is not specified),
80: # build the arrrrchive. otherwise just rename symbols.
1.24 pooka 81: __archivebuild: .USE
1.46 pooka 82: .if defined(RUMP_SYMREN) && defined(RUMPTOP)
83: @echo "ERROR: RUMP_SYMREN can only be used standalone"
84: @false
85: .endif
86: .if defined(RUMP_SYMREN)
87: ${_MKMSG} " symbol rename " ${RUMP_SYMREN}
88: .else
1.24 pooka 89: ${_MKTARGET_BUILD}
90: rm -f ${.TARGET}
1.34 pooka 91: ${AR} ${_ARFL} ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
1.46 pooka 92: .endif
93: ${NM} -go ${RUMP_SYMREN:U${.TARGET}} | ${TOOL_AWK} ' \
1.29 pooka 94: $$NF!~/^(rump|RUMP|__|_GLOBAL_OFFSET_TABLE'${_SYMQUIRK}')/ \
1.24 pooka 95: {printf "%s rumpns_%s\n", $$NF, $$NF}' \
96: | sort | uniq > renametab.${.TARGET}
1.37 pooka 97: ${OBJCOPY} --preserve-dates --redefine-syms \
1.46 pooka 98: renametab.${.TARGET} ${RUMP_SYMREN:U${.TARGET}}
1.24 pooka 99: rm -f renametab.${.TARGET}
1.46 pooka 100: .if !defined(RUMP_SYMREN)
1.36 perry 101: ${AR} ${_ARRANFL} ${.TARGET}
1.46 pooka 102: .endif
1.47 pooka 103:
104: # If IOCONFIG is defined, autocreate ioconf.c and locators.h.
105: # This is useful mainly for devices.
106: .if !empty(IOCONFIG)
107: ioconf.c: ${IOCONFIG}
1.49 ! pooka 108: ${TOOL_CONFIG} -b ${.OBJDIR} -s ${RUMPTOP}/.. ${.CURDIR}/${IOCONFIG}
1.47 pooka 109: # config doesn't change the files if they're unchanged. however,
110: # here we want to satisfy our make dependency, so force a
111: # timestamp update
112: touch ioconf.c locators.h
113:
1.48 pooka 114: locators.h: ioconf.c
115:
1.47 pooka 116: CLEANFILES+= ioconf.c locators.h
117: DPSRCS+= ioconf.c locators.h
118: .endif
119:
1.44 pooka 120: .-include "${NETBSDSRCDIR}/sys/arch/${MACHINE_CPU}/include/Makefile.inc"
121: .-include "${NETBSDSRCDIR}/sys/arch/${MACHINE}/include/Makefile.inc"
CVSweb <webmaster@jp.NetBSD.org>