Home | History | Annotate | Line # | Download | only in mbr
Makefile.mbr revision 1.18.18.1
      1  1.18.18.1     rmind #	$NetBSD: Makefile.mbr,v 1.18.18.1 2014/05/18 17:45:13 rmind Exp $
      2        1.1       dsl 
      3       1.16   tsutsui S=		${.CURDIR}/../../../../..
      4        1.1       dsl 
      5        1.4    simonb NOMAN=		# defined
      6        1.4    simonb 
      7        1.4    simonb LIBCRT0=	# nothing
      8  1.18.18.1     rmind LIBCRTI=	# nothing
      9        1.4    simonb LIBCRTBEGIN=	# nothing
     10        1.4    simonb LIBCRTEND=	# nothing
     11        1.4    simonb LIBC=		# nothing
     12        1.1       dsl 
     13       1.13  christos PIE_CFLAGS=
     14       1.13  christos PIE_LDFLAGS=
     15       1.13  christos PIE_AFLAGS=
     16       1.13  christos 
     17        1.1       dsl .include <bsd.own.mk>
     18        1.1       dsl 
     19        1.5       uwe STRIPFLAG=	# override
     20        1.5       uwe 
     21       1.11     lukem SRCS?=		mbr.S
     22        1.1       dsl 
     23       1.11     lukem BINDIR=		/usr/mdec
     24       1.11     lukem BINMODE=	444
     25        1.1       dsl 
     26       1.11     lukem .PATH:		${.CURDIR}/..
     27        1.1       dsl 
     28       1.11     lukem LDFLAGS+=	-nostdlib -Wl,-e,start
     29       1.11     lukem CPPFLAGS+=	-I. -I${.CURDIR}/../../lib -I${S}
     30        1.1       dsl 
     31       1.15       abs .if ${MACHINE_ARCH} == "x86_64"
     32       1.11     lukem LDFLAGS+=	-Wl,-m,elf_i386
     33       1.11     lukem AFLAGS+=	-m32
     34        1.1       dsl .endif
     35        1.4    simonb 
     36       1.11     lukem BUILDSYMLINKS+=	$S/arch/i386/include	machine \
     37       1.11     lukem 		$S/arch/x86/include	x86
     38        1.4    simonb 
     39       1.10     lukem DPSRCS+=	machine x86
     40        1.1       dsl 
     41       1.11     lukem CLEANFILES+=	${PROG}.tmp
     42        1.1       dsl 
     43       1.17       dsl LOADADDR=	0x8800
     44       1.17       dsl 
     45       1.18     joerg AFLAGS.mbr.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
     46       1.18     joerg AFLAGS.gpt.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
     47       1.18     joerg 
     48        1.1       dsl ${PROG}: ${OBJS}
     49       1.12     lukem 	${_MKTARGET_LINK}
     50       1.17       dsl 	${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${LOADADDR} ${OBJS}
     51       1.11     lukem 	@ set -- $$( ${NM} -t d ${PROG}.tmp | grep '\<mbr_space\>' \
     52       1.14       apb 		    | ${TOOL_SED} 's/^0*//'  ); \
     53        1.3   hubertf 		echo "#### There are $$1 free bytes in ${PROG}"
     54        1.1       dsl 	${OBJCOPY} -O binary ${PROG}.tmp ${PROG}
     55        1.1       dsl 	rm -f ${PROG}.tmp
     56        1.1       dsl 
     57        1.1       dsl .include <bsd.prog.mk>
     58