Makefile revision 125751
150477Speter# $FreeBSD: head/sys/boot/i386/loader/Makefile 125751 2004-02-12 21:43:50Z ru $
238465Smsmith
3125621SruPROG=		loader.sym
4125621SruINTERNALPROG=
548351SpeterNEWVERSWHAT=	"bootstrap loader" i386
638465Smsmith
739441Smsmith# architecture-specific loader code
8125537SruSRCS=		main.c conf.c vers.c
939441Smsmith
1059087Sps# Enable PXE TFTP or NFS support, not both.
1168310Sps.if defined(LOADER_TFTP_SUPPORT)
1268310SpsCFLAGS+=	-DLOADER_TFTP_SUPPORT
1368310Sps.else
1459087SpsCFLAGS+=	-DLOADER_NFS_SUPPORT
1568310Sps.endif
1659087Sps
1739178Smsmith# Enable PnP and ISA-PnP code.
1840555SmsmithHAVE_PNP=	yes
1940555SmsmithHAVE_ISABUS=	yes
2039178Smsmith
2156992Sluigi.if !defined(NOFORTH)
2240877Smsmith# Enable BootForth
2356903SjhbBOOT_FORTH=	yes
2456903SjhbCFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386
2541107SjkhLIBFICL=	${.OBJDIR}/../../ficl/libficl.a
2641107Sjkh.endif
2740877Smsmith
2883616Ssobomax.if defined(LOADER_BZIP2_SUPPORT)
2983616SsobomaxCFLAGS+=	-DLOADER_BZIP2_SUPPORT
3083616Ssobomax.endif
3183616Ssobomax.if !defined(LOADER_NO_GZIP_SUPPORT)
3283616SsobomaxCFLAGS+=	-DLOADER_GZIP_SUPPORT
3383616Ssobomax.endif
3483616Ssobomax
3538465Smsmith# Always add MI sources 
3638465Smsmith.PATH:		${.CURDIR}/../../common
37125516Sru.include	"${.CURDIR}/../../common/Makefile.inc"
3840338SpeterCFLAGS+=	-I${.CURDIR}/../../common
39125537SruCFLAGS+=	-I.
4038465Smsmith
41125751SruCLEANFILES=	vers.c loader loader.bin loader.help
4238465Smsmith
4338465SmsmithCFLAGS+=	-Wall
44125621SruLDFLAGS=	-static -Ttext 0x0
4538465Smsmith
4638465Smsmith# i386 standalone support library
4738465SmsmithLIBI386=	${.OBJDIR}/../libi386/libi386.a
4838465SmsmithCFLAGS+=	-I${.CURDIR}/..
4938465Smsmith
5039441Smsmith# BTX components
5139646SpeterCFLAGS+=	-I${.CURDIR}/../btx/lib
5239441Smsmith
5339664Smsmith# Debug me!
5440884Smsmith#CFLAGS+=	-g
5540884Smsmith#LDFLAGS+=	-g
5639664Smsmith
57125537Sru# Pick up ../Makefile.inc early.
58125537Sru.include <bsd.init.mk>
59125537Sru
60125537Sruvers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
6148351Speter	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
6238465Smsmith
63125621Sruloader: loader.bin ${BTXLDR} ${BTXKERN}
64102623Sjhb	btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
65125537Sru		-b ${BTXKERN} loader.bin
6638465Smsmith
67125537Sruloader.bin: loader.sym
6840555Smsmith	cp ${.ALLSRC} ${.TARGET}
6969985Srnordier	strip -R .comment -R .note ${.TARGET}
7040555Smsmith
71125537Sruloader.help: help.common help.i386
7242807Smsmith	cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
7341821Smsmith
7494956Sru.PATH: ${.CURDIR}/../../forth 
75125537SruFILES=	loader loader.help loader.4th support.4th loader.conf
76115410SscottlFILES+= screen.4th frames.4th beastie.4th
77125537Sru# XXX INSTALLFLAGS_loader= -b
78125537SruFILESMODE_loader= ${BINMODE} -b
7994956SruFILESDIR_loader.conf=	/boot/defaults
8094956Sru
8145759Sdcs.if !exists(${DESTDIR}/boot/loader.rc)
82115423SscottlFILES+=	${.CURDIR}/loader.rc
8345759Sdcs.endif
8441821Smsmith
85125621SruDPADD=	${BTXCRT} ${LIBFICL} ${LIBI386} ${LIBSTAND}
86125621SruLDADD=	${BTXCRT} ${LIBFICL} ${LIBI386} -lstand
8740555Smsmith
88125621Sru.include <bsd.prog.mk>
8939441Smsmith
90125556Sru.if ${MACHINE_ARCH} == "amd64"
91125581Srubeforedepend ${OBJS}: machine
92125537SruCLEANFILES+=	machine
9340338Spetermachine:
9440338Speter	ln -sf ${.CURDIR}/../../../i386/include machine
9540555Smsmith.endif
96