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