Makefile.mbr revision 1.2 1 # $NetBSD: Makefile.mbr,v 1.2 2003/05/05 02:47:42 dbj Exp $
2
3 S= ${.CURDIR}/../../../../../
4
5 NOMAN= # defined
6 STRIPFLAG=
7
8 .include <bsd.own.mk>
9
10 SRCS?= mbr.S
11
12 BINDIR= /usr/mdec
13 BINMODE=444
14
15 .PATH: ${.CURDIR}/..
16
17 LDFLAGS+= -e start
18 CPPFLAGS+= -I ${.CURDIR}/../../lib
19
20 .if ${MACHINE} == "amd64"
21 LDFLAGS+= -m elf_i386
22 AFLAGS+= -m32
23 .endif
24
25 CLEANFILES+= ${PROG}.tmp
26
27 ${PROG}: ${OBJS}
28 ${LD} -o ${PROG}.tmp ${LDFLAGS} -Ttext 0x600 ${OBJS}
29 @ set -- $$( ${NM} -t x ${PROG}.tmp | grep '\<mbr_space\>' ); \
30 echo "#### There are $$((0x$$1)) free bytes in ${PROG}"
31 ${OBJCOPY} -O binary ${PROG}.tmp ${PROG}
32 rm -f ${PROG}.tmp
33
34 .include <bsd.prog.mk>
35