Home | History | Annotate | Line # | Download | only in mbr
Makefile.mbr revision 1.8
      1  1.8     lukem #	$NetBSD: Makefile.mbr,v 1.8 2006/05/12 04:28:18 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.4    simonb .if !make(obj) && !make(clean) && !make(cleandir)
     32  1.4    simonb .NOPATH: machine x86
     33  1.4    simonb .endif
     34  1.4    simonb 
     35  1.6  christos depend 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.8     lukem 	${CC} -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