Makefile revision 126312
11844Swollman# $FreeBSD: head/sys/boot/i386/loader/Makefile 126312 2004-02-27 14:10:09Z ru $
250476Speter
323549SwoschPROG=		loader.sym
423549SwoschINTERNALPROG=
535784SwoschNEWVERSWHAT=	"bootstrap loader" i386
623549Swosch
723549Swosch# architecture-specific loader code
823549SwoschSRCS=		main.c conf.c vers.c
923549Swosch
1023549Swosch# Enable PXE TFTP or NFS support, not both.
1123549Swosch.if defined(LOADER_TFTP_SUPPORT)
1223549SwoschCFLAGS+=	-DLOADER_TFTP_SUPPORT
1323549Swosch.else
1423549SwoschCFLAGS+=	-DLOADER_NFS_SUPPORT
1595327Sobrien.endif
1623549Swosch
1723549Swosch# Enable PnP and ISA-PnP code.
1823549SwoschHAVE_PNP=	yes
1923549SwoschHAVE_ISABUS=	yes
2023549Swosch
2123549Swosch.if !defined(NOFORTH)
2223549Swosch# Enable BootForth
2323549SwoschBOOT_FORTH=	yes
2423549SwoschCFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386
2523549SwoschLIBFICL=	${.OBJDIR}/../../ficl/libficl.a
2623549Swosch.endif
2795509Sru
2896164Sru.if defined(LOADER_BZIP2_SUPPORT)
2944922SbdeCFLAGS+=	-DLOADER_BZIP2_SUPPORT
3023549Swosch.endif
311638Srgrimes.if !defined(LOADER_NO_GZIP_SUPPORT)
3294940SruCFLAGS+=	-DLOADER_GZIP_SUPPORT
3323549Swosch.endif
3495306Sru
3595306Sru# Always add MI sources 
3690311Sru.PATH:		${.CURDIR}/../../common
3795306Sru.include	"${.CURDIR}/../../common/Makefile.inc"
3890311SruCFLAGS+=	-I${.CURDIR}/../../common
3990311SruCFLAGS+=	-I.
4090311Sru
4190311SruCLEANFILES=	vers.c loader loader.bin loader.help
4290311Sru
4390311SruCFLAGS+=	-Wall
4490311SruLDFLAGS=	-static -Ttext 0x0
4590311Sru
4690311Sru# i386 standalone support library
4795306SruLIBI386=	${.OBJDIR}/../libi386/libi386.a
481638SrgrimesCFLAGS+=	-I${.CURDIR}/..
4995306Sru
501638Srgrimes# BTX components
511638SrgrimesCFLAGS+=	-I${.CURDIR}/../btx/lib
5253152Smarcel
5353152Smarcel# Debug me!
541638Srgrimes#CFLAGS+=	-g
551638Srgrimes#LDFLAGS+=	-g
561638Srgrimes
571638Srgrimes# Pick up ../Makefile.inc early.
581638Srgrimes.include <bsd.init.mk>
591638Srgrimes
6095509Sruvers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
6196668Sru	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
6295356Sru
6395306Sruloader: loader.bin ${BTXLDR} ${BTXKERN}
6415061Swosch	btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
651638Srgrimes		-b ${BTXKERN} loader.bin
6696668Sru
6796668Sruloader.bin: loader.sym
6896668Sru	cp ${.ALLSRC} ${.TARGET}
6996668Sru	strip -R .comment -R .note ${.TARGET}
7096668Sru
7196668Sruloader.help: help.common help.i386
7296668Sru	cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
7396668Sru
7496668Sru.PATH: ${.CURDIR}/../../forth 
7596668SruFILES=	loader loader.help loader.4th support.4th loader.conf
7696668SruFILES+= screen.4th frames.4th beastie.4th
771638Srgrimes# XXX INSTALLFLAGS_loader= -b
781638SrgrimesFILESMODE_loader= ${BINMODE} -b
791638SrgrimesFILESDIR_loader.conf=	/boot/defaults
801638Srgrimes
811638Srgrimes.if !exists(${DESTDIR}/boot/loader.rc)
821638SrgrimesFILES+=	${.CURDIR}/loader.rc
831638Srgrimes.endif
841638Srgrimes
851638Srgrimes# XXX crt0.o needs to be first for pxeboot(8) to work
8695306SruOBJS=	${BTXCRT} 
871638Srgrimes
88DPADD=	${LIBFICL} ${LIBI386} ${LIBSTAND}
89LDADD=	${LIBFICL} ${LIBI386} -lstand
90
91.include <bsd.prog.mk>
92
93.if ${MACHINE_ARCH} == "amd64"
94beforedepend ${OBJS}: machine
95CLEANFILES+=	machine
96machine:
97	ln -sf ${.CURDIR}/../../../i386/include machine
98.endif
99