7 NEWVERSWHAT= "Open Firmware loader" ${MACHINE_ARCH}
11 # Architecture-specific loader code
12 SRCS= conf.c metadata.c vers.c start.c
14 LOADER_DISK_SUPPORT?= yes
15 LOADER_UFS_SUPPORT?= yes
16 LOADER_CD9660_SUPPORT?= yes
17 LOADER_EXT2FS_SUPPORT?= no
18 LOADER_NET_SUPPORT?= yes
19 LOADER_NFS_SUPPORT?= yes
20 LOADER_TFTP_SUPPORT?= no
21 LOADER_GZIP_SUPPORT?= yes
22 LOADER_BZIP2_SUPPORT?= no
24 .if ${LOADER_DISK_SUPPORT} == "yes"
25 CFLAGS+= -DLOADER_DISK_SUPPORT
27 .if ${LOADER_UFS_SUPPORT} == "yes"
28 CFLAGS+= -DLOADER_UFS_SUPPORT
30 .if ${LOADER_CD9660_SUPPORT} == "yes"
31 CFLAGS+= -DLOADER_CD9660_SUPPORT
33 .if ${LOADER_EXT2FS_SUPPORT} == "yes"
34 CFLAGS+= -DLOADER_EXT2FS_SUPPORT
36 .if ${LOADER_GZIP_SUPPORT} == "yes"
37 CFLAGS+= -DLOADER_GZIP_SUPPORT
39 .if ${LOADER_BZIP2_SUPPORT} == "yes"
40 CFLAGS+= -DLOADER_BZIP2_SUPPORT
42 .if ${LOADER_NET_SUPPORT} == "yes"
43 CFLAGS+= -DLOADER_NET_SUPPORT
45 .if ${LOADER_NFS_SUPPORT} == "yes"
46 CFLAGS+= -DLOADER_NFS_SUPPORT
48 .if ${LOADER_TFTP_SUPPORT} == "yes"
49 CFLAGS+= -DLOADER_TFTP_SUPPORT
52 .if ${MK_FORTH} != "no"
55 CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc
56 LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
59 # Avoid the open-close-dance for every file access as some firmwares perform
60 # an auto-negotiation on every open of the network interface and thus causes
61 # netbooting to take horribly long.
62 CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE
64 # Always add MI sources
65 .PATH: ${.CURDIR}/../../common
66 .include "${.CURDIR}/../../common/Makefile.inc"
67 CFLAGS+= -I${.CURDIR}/../../common
70 CLEANFILES+= vers.c loader.help
72 CFLAGS+= -ffreestanding -msoft-float
73 # load address. set in linker script
75 CFLAGS+= -DRELOC=${RELOC}
77 LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc
79 # 64-bit bridge extensions
80 CFLAGS+= -Wa,-mppc64bridge
82 # Pull in common loader code
83 .PATH: ${.CURDIR}/../../ofw/common
84 .include "${.CURDIR}/../../ofw/common/Makefile.inc"
86 # Open Firmware standalone support library
87 LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a
88 CFLAGS+= -I${.CURDIR}/../../ofw/libofw
90 # where to get libstand from
91 CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
93 DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND}
94 LDADD= ${LIBFICL} ${LIBOFW} -lstand
96 vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
97 sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
99 loader.help: help.common help.ofw
101 awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
103 .PATH: ${.CURDIR}/../../forth
104 FILES= loader.help loader.4th support.4th loader.conf
105 FILESDIR_loader.conf= /boot/defaults
107 .if !exists(${DESTDIR}/boot/loader.rc)
111 .include <bsd.prog.mk>