xref: /freebsd/stand/kboot/kboot/Makefile (revision d2434697bc9cc2d36da0f356cc5942b33df87896)
1LOADER_DISK_SUPPORT?=	yes
2LOADER_CD9660_SUPPORT?=	yes
3LOADER_MSDOS_SUPPORT?=	no
4LOADER_EXT2FS_SUPPORT?=	yes
5LOADER_UFS_SUPPORT?=	yes
6LOADER_ZFS_SUPPORT?=	yes
7LOADER_NET_SUPPORT?=	no
8LOADER_NFS_SUPPORT?=	no
9LOADER_TFTP_SUPPORT?=	no
10LOADER_GZIP_SUPPORT?=	no
11LOADER_BZIP2_SUPPORT?=	no
12
13.include <bsd.init.mk>
14
15PROG=		loader.kboot
16NEWVERSWHAT=	"kboot loader" ${MACHINE_ARCH}
17INSTALLFLAGS=	-b
18
19# Architecture-specific loader code
20SRCS=	\
21		bootinfo.c \
22		conf.c \
23		hostcons.c \
24		hostdisk.c \
25		hostfs.c \
26		init.c \
27		main.c \
28		seg.c \
29		util.c \
30		vers.c
31
32.if ${MK_FDT} != "no"
33SRCS+=		kbootfdt.c
34.endif
35
36.if ${MK_LOADER_ZFS} != "no"
37CFLAGS+=	-I${ZFSSRC}
38CFLAGS+=        -I${SYSDIR}/contrib/openzfs/include
39CFLAGS+=        -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs
40HAVE_ZFS=yes
41.endif
42
43HELP_FILENAME=	loader.help.kboot
44
45.include	"${BOOTSRC}/fdt.mk"
46
47# We share bootinfo.c with efi
48.PATH:		${BOOTSRC}/efi/loader
49
50# Note: Since we're producing a userland binary, we key off of MACHINE_ARCH
51# instead of the more normal MACHINE since the changes between different flavors
52# of MACHINE_ARCH are large enough in Linux that it's easier that way.
53.PATH:	${.CURDIR}/arch/${MACHINE_ARCH}
54.include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc"
55
56# Bring in our ldscript
57LDFLAGS=	-nostdlib -static -T ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}.ldscript
58
59# Always add MI sources
60.include	"${BOOTSRC}/loader.mk"
61CFLAGS+=	-I${.CURDIR} -I${.CURDIR}/arch/${MACHINE_ARCH}
62
63CFLAGS+=	-Wall
64
65DPADD=		${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA} ${LIBKBOOT}
66LDADD=		${LDR_INTERP} ${LIBOFW} ${LIBSAFDT} ${LIBSA} ${LIBKBOOT}
67
68# Add our own lua bindings until they are universal
69.if ${LOADER_INTERP} == "lua"
70SRCS+=		\
71		lua_bindings.c
72CFLAGS.lua_bindings.c+=  -I${FLUALIB}/libhash
73.endif
74
75.include <bsd.prog.mk>
76