Makefile revision 39474
139474Smsmith# $Id: Makefile,v 1.4 1998/09/18 02:03:29 msmith Exp $
238465Smsmith
339441SmsmithBASE=		loader
439441SmsmithPROG=		${BASE}
538465SmsmithNOMAN=
638465SmsmithNEWVERSWHAT=	"bootstrap loader"
738465Smsmith
839441Smsmith# architecture-specific loader code
939441SmsmithSRCS=		main.c conf.c
1039441Smsmith
1139178Smsmith# Enable PnP and ISA-PnP code.
1239178Smsmith#HAVE_PNP=	yes
1339178Smsmith#HAVE_ISABUS=	yes
1439178Smsmith
1539441Smsmith# Verbose ls causes extra heap usage
1639441SmsmithCFLAGS+=	-DVERBOSE_LS
1738465Smsmith
1838465Smsmith# Always add MI sources 
1938465Smsmith.PATH:		${.CURDIR}/../../common
2038465Smsmith.include	<${.CURDIR}/../../common/Makefile.inc>
2138465SmsmithCFLAGS+=	-I${.CURDIR}/../../common
2238465Smsmith
2339441SmsmithCLEANFILES+=	vers.c vers.o ${BASE}.list setdef0.o setdef1.o setdefs.h \
2439441Smsmith		gensetdefs.o gensetdefs ${BASE}.bin
2538465Smsmith
2638465SmsmithCFLAGS+=	-Wall
2739441SmsmithLDFLAGS=	-nostdlib -static -Ttext 0x1000
2838465Smsmith
2938465Smsmith# i386 standalone support library
3038465SmsmithLIBI386=	${.OBJDIR}/../libi386/libi386.a
3138465SmsmithCFLAGS+=	-I${.CURDIR}/..
3238465Smsmith
3339474Smsmith# where to get libstand from
3439474SmsmithLIBSTAND=	-lstand
3539474Smsmith#LIBSTAND=	${.CURDIR}/../../../lib/libstand/libstand.a
3639474Smsmith
3739441Smsmith# BTX components
3839441SmsmithBTXDIR=		${.CURDIR}/../btx
3939441SmsmithBTXLDR=		${BTXDIR}/btxldr/btxldr
4039441SmsmithBTXKERN=	${BTXDIR}/btx/btx
4139441SmsmithBTXCRT=		${BTXDIR}/lib/crt0.o
4239441SmsmithCFLAGS+=	-I${BTXDIR}/lib
4339441Smsmith
4439441Smsmith# BTX is expecting ELF components
4539441SmsmithCFLAGS+=	-elf
4639441Smsmith
4738465Smsmithvers.o:
4838465Smsmith	sh ${.CURDIR}/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
4938465Smsmith	${CC} -c vers.c
5038465Smsmith
5139441Smsmith${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN}
5239450Smsmith	btxld -v -f aout -e 0x100000 -o ${.TARGET} -l ${BTXLDR} -b ${BTXKERN} \
5339450Smsmith		${BASE}.bin
5438465Smsmith
5539441Smsmith${BASE}.bin: ${OBJS} ${LIBI386} vers.o setdef0.o setdef1.o
5639474Smsmith	${LD} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} setdef0.o ${OBJS} vers.o setdef1.o \
5739474Smsmith		${LIBSTAND} ${LIBI386} ${LIBSTAND}
5839441Smsmith
5939441Smsmithsetdef0.o:	setdefs.h
6039441Smsmith
6139441Smsmithsetdef1.o:	setdefs.h
6239441Smsmith
6338465Smsmith.include <bsd.prog.mk>
6439441Smsmith
6539441Smsmith# Linker set gymnastics
6639441Smsmithsetdefs.h: gensetdefs ${OBJS}
6739441Smsmith	@echo Generating linker sets
6839441Smsmith	@./gensetdefs ${OBJS} >setdefs.h
6939441Smsmith
7039441Smsmithgensetdefs: gensetdefs.o
7139441Smsmith	${CC} -static gensetdefs.o -o $@
7239441Smsmith
7339441Smsmithgensetdefs.o: gensetdefs.c
7439441Smsmith	${CC} -c $<
7539441Smsmith
7639441Smsmith
77