1 1.10 lukem # $NetBSD: Makefile.mbr,v 1.10 2006/06/29 06:24:50 lukem Exp $ 2 1.1 dsl 3 1.1 dsl S= ${.CURDIR}/../../../../../ 4 1.1 dsl 5 1.4 simonb NOMAN= # defined 6 1.4 simonb 7 1.4 simonb LIBCRT0= # nothing 8 1.4 simonb LIBCRTBEGIN= # nothing 9 1.4 simonb LIBCRTEND= # nothing 10 1.4 simonb LIBC= # nothing 11 1.1 dsl 12 1.1 dsl .include <bsd.own.mk> 13 1.1 dsl 14 1.5 uwe STRIPFLAG= # override 15 1.5 uwe 16 1.1 dsl SRCS?= mbr.S 17 1.1 dsl 18 1.1 dsl BINDIR= /usr/mdec 19 1.1 dsl BINMODE=444 20 1.1 dsl 21 1.1 dsl .PATH: ${.CURDIR}/.. 22 1.1 dsl 23 1.8 lukem LDFLAGS+= -nostdlib -Wl,-e,start 24 1.4 simonb CPPFLAGS+= -I. -I${.CURDIR}/../../lib -I${S} 25 1.1 dsl 26 1.1 dsl .if ${MACHINE} == "amd64" 27 1.8 lukem LDFLAGS+= -Wl,-m,elf_i386 28 1.1 dsl AFLAGS+= -m32 29 1.1 dsl .endif 30 1.4 simonb 31 1.10 lukem BUILDSYMLINKS+= $S/arch/i386/include machine \ 32 1.10 lukem $S/arch/x86/include x86 33 1.4 simonb 34 1.10 lukem DPSRCS+= machine x86 35 1.1 dsl 36 1.1 dsl CLEANFILES+= ${PROG}.tmp 37 1.1 dsl 38 1.1 dsl ${PROG}: ${OBJS} 39 1.9 lukem ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,0x600 ${OBJS} 40 1.3 hubertf @ set -- $$( ${NM} -t d ${PROG}.tmp | grep '\<mbr_space\>' | sed 's/^0*//' ); \ 41 1.3 hubertf echo "#### There are $$1 free bytes in ${PROG}" 42 1.1 dsl ${OBJCOPY} -O binary ${PROG}.tmp ${PROG} 43 1.1 dsl rm -f ${PROG}.tmp 44 1.1 dsl 45 1.1 dsl .include <bsd.prog.mk> 46