xref: /freebsd/stand/i386/loader/Makefile (revision 1de7b4b805ddbf2429da511c053686ac4591ed89)
1# $FreeBSD$
2
3HAVE_GELI=		yes
4
5LOADER_NET_SUPPORT?=	yes
6LOADER_NFS_SUPPORT?=	yes
7LOADER_TFTP_SUPPORT?=	yes
8LOADER_CD9660_SUPPORT?=	no
9LOADER_EXT2FS_SUPPORT?=	no
10LOADER_MSDOS_SUPPORT?=	no
11LOADER_UFS_SUPPORT?=	yes
12LOADER_GZIP_SUPPORT?=	yes
13LOADER_BZIP2_SUPPORT?=	yes
14
15.include <bsd.init.mk>
16
17MK_SSP=		no
18
19LOADER?=	loader
20PROG=		${LOADER}.sym
21MAN=
22INTERNALPROG=
23NEWVERSWHAT?=	"bootstrap loader" x86
24VERSION_FILE=	${.CURDIR}/../loader/version
25
26.PATH:		${BOOTSRC}/i386/loader
27
28# architecture-specific loader code
29SRCS=		main.c conf.c vers.c chain.c
30
31# Include bcache code.
32HAVE_BCACHE=	yes
33
34# Enable PnP and ISA-PnP code.
35HAVE_PNP=	yes
36HAVE_ISABUS=	yes
37
38.if ${MK_LOADER_FIREWIRE} == "yes"
39CFLAGS+=	-DLOADER_FIREWIRE_SUPPORT
40LIBFIREWIRE=	${BOOTOBJ}/i386/libfirewire/libfirewire.a
41.endif
42
43.if exists(${.CURDIR}/help.i386)
44HELP_FILES+=	help.i386
45.else
46HELP_FILES=
47.endif
48
49# Always add MI sources
50.include	"${BOOTSRC}/loader.mk"
51
52CLEANFILES+=	${LOADER} ${LOADER}.bin
53
54CFLAGS+=	-Wall
55LDFLAGS+=	-static -Ttext 0x0
56
57# i386 standalone support library
58LIBI386=	${BOOTOBJ}/i386/libi386/libi386.a
59CFLAGS+=	-I${BOOTSRC}/i386
60
61# BTX components
62CFLAGS+=	-I${BTXLIB}
63
64# Debug me!
65#CFLAGS+=	-g
66#LDFLAGS+=	-g
67
68${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN}
69	btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
70		-b ${BTXKERN} ${LOADER}.bin
71
72${LOADER}.bin: ${LOADER}.sym
73	strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC}
74
75FILES+=	${LOADER}
76# XXX INSTALLFLAGS_loader= -b
77FILESMODE_${LOADER}= ${BINMODE} -b
78
79# XXX crt0.o needs to be first for pxeboot(8) to work
80OBJS=	${BTXCRT}
81
82DPADD=	${LIBFICL32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32}
83LDADD=	${LIBFICL32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32}
84
85.if ${MACHINE_CPUARCH} == "amd64"
86CFLAGS+=	-DLOADER_PREFER_AMD64
87.endif
88
89.include <bsd.prog.mk>
90