Home | History | Annotate | Line # | Download | only in mbr
Makefile.mbr revision 1.4
      1  1.4   simonb #	$NetBSD: Makefile.mbr,v 1.4 2003/07/01 13:36:59 simonb 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 STRIPFLAG=	# nothing
      7  1.4   simonb 
      8  1.4   simonb LIBCRT0=	# 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.1      dsl .include <bsd.own.mk>
     14  1.1      dsl 
     15  1.1      dsl SRCS?= mbr.S
     16  1.1      dsl 
     17  1.1      dsl BINDIR=	/usr/mdec
     18  1.1      dsl BINMODE=444
     19  1.1      dsl 
     20  1.1      dsl .PATH:	${.CURDIR}/..
     21  1.1      dsl 
     22  1.1      dsl LDFLAGS+= -e start
     23  1.4   simonb CPPFLAGS+= -I. -I${.CURDIR}/../../lib -I${S}
     24  1.1      dsl 
     25  1.1      dsl .if ${MACHINE} == "amd64"
     26  1.1      dsl LDFLAGS+=  -m elf_i386
     27  1.1      dsl AFLAGS+=   -m32
     28  1.1      dsl .endif
     29  1.4   simonb 
     30  1.4   simonb .if !make(obj) && !make(clean) && !make(cleandir)
     31  1.4   simonb .BEGIN: machine x86
     32  1.4   simonb .NOPATH: machine x86
     33  1.4   simonb .endif
     34  1.4   simonb 
     35  1.4   simonb realdepend realall: machine x86
     36  1.4   simonb CLEANFILES+= machine x86
     37  1.4   simonb 
     38  1.4   simonb machine::
     39  1.4   simonb 	-rm -f $@
     40  1.4   simonb 	ln -s $S/arch/i386/include $@
     41  1.4   simonb 
     42  1.4   simonb x86::
     43  1.4   simonb 	-rm -f $@
     44  1.4   simonb 	ln -s $S/arch/x86/include $@
     45  1.4   simonb 
     46  1.4   simonb ${OBJS}: machine x86
     47  1.1      dsl 
     48  1.1      dsl CLEANFILES+= ${PROG}.tmp
     49  1.1      dsl 
     50  1.1      dsl ${PROG}: ${OBJS}
     51  1.1      dsl 	${LD} -o ${PROG}.tmp ${LDFLAGS} -Ttext 0x600 ${OBJS}
     52  1.3  hubertf 	@ set -- $$( ${NM} -t d ${PROG}.tmp | grep '\<mbr_space\>' | 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