Make it work for both elf and a.out

This commit is contained in:
christos 1999-03-24 16:02:41 +00:00
parent 511a8fd293
commit 22f9ed8d9b

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 1999/02/13 02:54:33 lukem Exp $ # $NetBSD: Makefile,v 1.3 1999/03/24 16:02:41 christos Exp $
BINDIR= /usr/mdec BINDIR= /usr/mdec
BINMODE=444 BINMODE=444
@ -9,10 +9,18 @@ PROG= mbr
SRCS= mbr.S SRCS= mbr.S
MKMAN= no MKMAN= no
.include <bsd.own.mk>
.if ${OBJECT_FMT} == "ELF"
LDFLAGS+= -e start
.else
LDFLAGS+= -e _start -N
.endif
${PROG}: ${OBJS} ${PROG}: ${OBJS}
${LD} -o ${PROG}.tmp -e _start -N -Ttext 0x600 ${OBJS} ${LD} -o ${PROG}.tmp ${LDFLAGS} -Ttext 0x600 ${OBJS}
${STRIPPROG} ${PROG}.tmp ${STRIPPROG} ${PROG}.tmp
dd if=${PROG}.tmp of=${PROG} bs=32 skip=1 objcopy -O binary ${PROG}.tmp ${PROG}
rm -f ${PROG}.tmp rm -f ${PROG}.tmp
.include <bsd.prog.mk> .include <bsd.prog.mk>