freebsd-dev/stand/powerpc/ofw/Makefile
Mitchell Horne 8859960436 loader: always install help files
Address two issues with current help file logic:

The existing condition prevents the common help file from being
installed when there are no additional help files defined. This results
in no loader.help on EFI platforms, for example.

Second, due to the fact that we build and install multiple loader types,
each successive install will clobber the previous loader.help. The
result is that we could lose type-specific commands, or possibly list
them in loaders that do not have such commands.

Instead, give each loader type a uniquely named help file. The EFI
loader will look for /boot/loader.help.efi, userboot will look for
/boot/loader.help.userboot, etc. The interpreter variant has no effect
on which help file is loaded.

This leaves the old /boot/loader.help unused.

Some credit for the final approach goes to Mathieu <sigsys@gmail.com>
for their version of the fix in https://reviews.freebsd.org/D22951.

PR:		267134
Reported by:	Daniel O'Connor <darius@dons.net.au>
Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D28591
2023-02-03 16:35:06 -04:00

69 lines
1.4 KiB
Makefile

# $FreeBSD$
LOADER_CD9660_SUPPORT?= yes
LOADER_EXT2FS_SUPPORT?= no
LOADER_MSDOS_SUPPORT?= no
LOADER_UFS_SUPPORT?= yes
LOADER_NET_SUPPORT?= yes
LOADER_NFS_SUPPORT?= yes
LOADER_TFTP_SUPPORT?= no
LOADER_GZIP_SUPPORT?= yes
LOADER_BZIP2_SUPPORT?= no
.include <bsd.init.mk>
PROG= loader
NEWVERSWHAT= "Open Firmware loader" ${MACHINE_ARCH}
INSTALLFLAGS= -b
# Architecture-specific loader code
SRCS= conf.c vers.c main.c elf_freebsd.c ppc64_elf_freebsd.c start.c
SRCS+= ucmpdi2.c gfx_fb_stub.c
CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken
.include "${BOOTSRC}/fdt.mk"
.if ${MK_FDT} == "yes"
SRCS+= ofwfdt.c
.endif
.if ${MACHINE_ARCH:Mpowerpc64*} != ""
SRCS+= cas.c
CFLAGS+= -DCAS
.endif
.if ${MACHINE_ARCH} == "powerpc64le"
SRCS+= trampolineLE.S
.endif
HELP_FILES= ${FDTSRC}/help.fdt
HELP_FILENAME= loader.help.ofw
# Always add MI sources
.include "${BOOTSRC}/loader.mk"
.PATH: ${SYSDIR}/libkern
# load address. set in linker script
RELOC?= 0x1C00000
CFLAGS+= -DRELOC=${RELOC} -g
LDFLAGS= -nostdlib -static
.if ${MACHINE_ARCH} == "powerpc64le"
LDFLAGS+= -T ${.CURDIR}/ldscript.powerpcle
.else
LDFLAGS+= -T ${.CURDIR}/ldscript.powerpc
.endif
# Open Firmware standalone support library
LIBOFW= ${BOOTOBJ}/libofw/libofw.a
CFLAGS+= -I${BOOTSRC}/libofw
DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA}
LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA}
MK_PIE= no
.include <bsd.prog.mk>