custom message type for VM_INFO
[minix3.git] / sys / arch / i386 / stand / mbr / Makefile.mbr
blob3e18e2feb3b82d7366f90cca0070b0cf321242f6
1 #       $NetBSD: Makefile.mbr,v 1.18 2011/05/20 15:05:02 joerg Exp $
3 S=              ${.CURDIR}/../../../../..
5 NOMAN=          # defined
7 LIBCRT0=        # nothing
8 LIBCRTBEGIN=    # nothing
9 LIBCRTEND=      # nothing
10 LIBC=           # nothing
12 PIE_CFLAGS=
13 PIE_LDFLAGS=
14 PIE_AFLAGS=
16 .include <bsd.own.mk>
18 STRIPFLAG=      # override
20 SRCS?=          mbr.S
22 BINDIR=         /usr/mdec
23 BINMODE=        444
25 .PATH:          ${.CURDIR}/..
27 LDFLAGS+=       -nostdlib -Wl,-e,start
28 CPPFLAGS+=      -I. -I${.CURDIR}/../../lib -I${S}
30 .if ${MACHINE_ARCH} == "x86_64"
31 LDFLAGS+=       -Wl,-m,elf_i386
32 AFLAGS+=        -m32
33 .endif
35 BUILDSYMLINKS+= $S/arch/i386/include    machine \
36                 $S/arch/x86/include     x86
38 DPSRCS+=        machine x86
40 CLEANFILES+=    ${PROG}.tmp
42 LOADADDR=       0x8800
44 AFLAGS.mbr.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
45 AFLAGS.gpt.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
47 .if defined(__MINIX)
48 CPPFLAGS+= -DLOADADDR=${LOADADDR}
49 AFLAGS.mbr.S+=  -Wa,--divide
51 BUILDSYMLINKS+= \
52         ${NETBSDSRCDIR}/include/arch/i386/include/stackframe.h machine/stackframe.h \
53         ${NETBSDSRCDIR}/include/arch/i386/include/fpu.h machine/fpu.h
55 DPSRCS+= machine/stackframe.h  machine/fpu.h
56 .endif # defined(__MINIX)
58 ${PROG}: ${OBJS}
59         ${_MKTARGET_LINK}
60 .if defined(__MINIX)
61         ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,--section-start=.text=${LOADADDR} ${OBJS}
62 .else
63         ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${LOADADDR} ${OBJS}
64 .endif
65         @ set -- $$( ${NM} -t d ${PROG}.tmp | grep '\<mbr_space\>' \
66                     | ${TOOL_SED} 's/^0*//'  ); \
67                 echo "#### There are $$1 free bytes in ${PROG}"
68         ${OBJCOPY} -O binary ${PROG}.tmp ${PROG}
69         rm -f ${PROG}.tmp
71 .include <bsd.prog.mk>