# $NetBSD: Makefile,v 1.17 2005/12/11 12:16:20 christos Exp $

PROG=	boot.bin
STRIPFLAG=  # defined
NOMAN=  # defined

SRCS=	start.S boot.c ramdisk.c bootinfo.c

CLEANFILES+=	boot.map ${PROG}.sym

LOAD_ADDRESS=	0xbfc00000
DATA_ADDRESS=	0x00001000

${PROG}: ${PROG}.sym
#	${STRIP} -s ${PROG}.sym -o ${.TARGET}
	cp ${PROG}.sym ${.TARGET}
	@${SIZE} ${.TARGET}

.include <bsd.own.mk>

release: check_RELEASEDIR
	${HOST_INSTALL_FILE} -m ${BINMODE} ${PROG} \
	    ${RELEASEDIR}/${MACHINE}/installation/soclib/

### find out what to use for libsa
SA_AS=          library
SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
# for now:
SAMISCMAKEFLAGS+=SA_INCLUDE_NET=no

.include "../Makefile.booters"

### find out what to use for libz
Z_AS=           library
.include "${S}/lib/libz/Makefile.inc"
LIBZ=           ${ZLIB}

${PROG}.sym: ${OBJS} ${LIBS}
	${LD} -Map boot.map -N -x \
	    -Ttext ${LOAD_ADDRESS} -Tdata ${DATA_ADDRESS} \
	    ${LDBUG} -e start -o ${.TARGET} ${OBJS} ${LIBS}
