1999-08-28 01:08:13 +00:00
|
|
|
# $FreeBSD$
|
1998-08-21 03:17:42 +00:00
|
|
|
|
2018-07-20 05:17:37 +00:00
|
|
|
HAVE_ZFS= ${MK_ZFS}
|
|
|
|
|
2017-11-08 14:44:45 +00:00
|
|
|
LOADER_NET_SUPPORT?= yes
|
|
|
|
LOADER_NFS_SUPPORT?= yes
|
|
|
|
LOADER_TFTP_SUPPORT?= yes
|
2018-02-21 15:58:00 +00:00
|
|
|
LOADER_CD9660_SUPPORT?= yes
|
|
|
|
LOADER_EXT2FS_SUPPORT?= yes
|
|
|
|
LOADER_MSDOS_SUPPORT?= yes
|
2017-11-08 14:44:45 +00:00
|
|
|
LOADER_UFS_SUPPORT?= yes
|
|
|
|
LOADER_GZIP_SUPPORT?= yes
|
|
|
|
LOADER_BZIP2_SUPPORT?= yes
|
|
|
|
|
2017-10-30 23:14:37 +00:00
|
|
|
.include <bsd.init.mk>
|
|
|
|
|
2009-11-23 16:00:16 +00:00
|
|
|
LOADER?= loader
|
|
|
|
PROG= ${LOADER}.sym
|
2004-02-09 14:11:58 +00:00
|
|
|
INTERNALPROG=
|
2010-08-31 19:01:12 +00:00
|
|
|
NEWVERSWHAT?= "bootstrap loader" x86
|
2016-12-19 14:40:59 +00:00
|
|
|
VERSION_FILE= ${.CURDIR}/../loader/version
|
2017-10-16 03:59:52 +00:00
|
|
|
|
2017-11-10 23:54:31 +00:00
|
|
|
.PATH: ${BOOTSRC}/i386/loader
|
|
|
|
|
1998-09-17 23:52:16 +00:00
|
|
|
# architecture-specific loader code
|
2017-06-16 20:08:44 +00:00
|
|
|
SRCS= main.c conf.c vers.c chain.c
|
1998-09-17 23:52:16 +00:00
|
|
|
|
2006-11-02 00:26:45 +00:00
|
|
|
# Include bcache code.
|
|
|
|
HAVE_BCACHE= yes
|
|
|
|
|
1998-09-14 18:27:06 +00:00
|
|
|
# Enable PnP and ISA-PnP code.
|
1998-10-21 20:10:33 +00:00
|
|
|
HAVE_PNP= yes
|
|
|
|
HAVE_ISABUS= yes
|
1998-09-14 18:27:06 +00:00
|
|
|
|
2017-11-10 23:54:41 +00:00
|
|
|
.if ${MK_LOADER_FIREWIRE} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_FIREWIRE_SUPPORT
|
|
|
|
LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a
|
|
|
|
.endif
|
|
|
|
|
2017-11-10 23:54:58 +00:00
|
|
|
.if exists(${.CURDIR}/help.i386)
|
2017-12-18 04:51:34 +00:00
|
|
|
HELP_FILES= ${.CURDIR}/help.i386
|
2017-11-10 23:54:58 +00:00
|
|
|
.endif
|
|
|
|
|
2011-11-19 14:42:06 +00:00
|
|
|
# Always add MI sources
|
2017-10-30 23:14:37 +00:00
|
|
|
.include "${BOOTSRC}/loader.mk"
|
1998-08-21 03:17:42 +00:00
|
|
|
|
2017-11-10 23:54:58 +00:00
|
|
|
CLEANFILES+= ${LOADER} ${LOADER}.bin
|
1998-08-21 03:17:42 +00:00
|
|
|
|
|
|
|
CFLAGS+= -Wall
|
2017-10-30 23:14:37 +00:00
|
|
|
LDFLAGS+= -static -Ttext 0x0
|
1998-08-21 03:17:42 +00:00
|
|
|
|
|
|
|
# i386 standalone support library
|
2017-10-30 23:14:37 +00:00
|
|
|
LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a
|
|
|
|
CFLAGS+= -I${BOOTSRC}/i386
|
1998-09-17 23:52:16 +00:00
|
|
|
|
1998-09-26 01:31:10 +00:00
|
|
|
# Debug me!
|
1998-11-04 03:42:36 +00:00
|
|
|
#CFLAGS+= -g
|
|
|
|
#LDFLAGS+= -g
|
1998-09-26 01:31:10 +00:00
|
|
|
|
2009-11-23 16:00:16 +00:00
|
|
|
${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN}
|
2002-08-30 14:59:47 +00:00
|
|
|
btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
|
2009-11-23 16:00:16 +00:00
|
|
|
-b ${BTXKERN} ${LOADER}.bin
|
1998-09-17 23:52:16 +00:00
|
|
|
|
2009-11-23 16:00:16 +00:00
|
|
|
${LOADER}.bin: ${LOADER}.sym
|
2016-12-28 04:55:43 +00:00
|
|
|
strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC}
|
1998-09-17 23:52:16 +00:00
|
|
|
|
2018-07-20 05:17:37 +00:00
|
|
|
.if ${MK_ZFS} == "yes"
|
2018-07-23 06:04:05 +00:00
|
|
|
LINKS= ${BINDIR}/${LOADER} ${BINDIR}/zfs${LOADER}
|
2018-07-20 05:17:37 +00:00
|
|
|
.endif
|
2017-11-10 23:54:58 +00:00
|
|
|
FILES+= ${LOADER}
|
2009-11-23 16:00:16 +00:00
|
|
|
# XXX INSTALLFLAGS_loader= -b
|
|
|
|
FILESMODE_${LOADER}= ${BINMODE} -b
|
|
|
|
|
2004-02-27 14:10:09 +00:00
|
|
|
# XXX crt0.o needs to be first for pxeboot(8) to work
|
2011-11-19 14:42:06 +00:00
|
|
|
OBJS= ${BTXCRT}
|
2004-02-27 14:10:09 +00:00
|
|
|
|
2018-07-08 07:42:49 +00:00
|
|
|
DPADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBI386} ${LIBSA32}
|
|
|
|
LDADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBI386} ${LIBSA32}
|
1998-09-17 23:52:16 +00:00
|
|
|
|
2010-08-23 01:42:09 +00:00
|
|
|
.if ${MACHINE_CPUARCH} == "amd64"
|
2012-09-30 12:24:15 +00:00
|
|
|
CFLAGS+= -DLOADER_PREFER_AMD64
|
1998-10-21 20:10:33 +00:00
|
|
|
.endif
|
2017-11-06 15:22:04 +00:00
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|