From 25c2f4cb95686fa3dc2144872abe6df2a983c608 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 18 Dec 2017 04:51:34 +0000 Subject: [PATCH] Move loader help file definitions to being 100% inside of loader.mk. HELP_FILES is a loader only thing, so move it to loader.mk. Only generate the help file if HELP_FILES is defined. Adjust Makefiles to new convention. Fix a few cases where ${.CURDIR}/ was missing resulting in missing bits from the help files. Sponsored by: Netflix --- stand/arm/uboot/Makefile | 2 +- stand/defs.mk | 4 ---- stand/efi/loader/Makefile | 1 - stand/i386/loader/Makefile | 4 +--- stand/loader.mk | 2 ++ stand/mips/beri/loader/Makefile | 2 +- stand/mips/uboot/Makefile | 2 +- stand/powerpc/kboot/Makefile | 3 --- stand/powerpc/ofw/Makefile | 2 +- stand/powerpc/ps3/Makefile | 1 - stand/powerpc/uboot/Makefile | 1 - stand/sparc64/loader/Makefile | 4 +--- stand/userboot/userboot/Makefile | 1 - 13 files changed, 8 insertions(+), 21 deletions(-) diff --git a/stand/arm/uboot/Makefile b/stand/arm/uboot/Makefile index 2070d8a15ce1..8c4023a81a72 100644 --- a/stand/arm/uboot/Makefile +++ b/stand/arm/uboot/Makefile @@ -28,7 +28,7 @@ SRCS= start.S conf.c self_reloc.c vers.c CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif -HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt +HELP_FILES= ${.CURDIR}/help.uboot ${BOOTSRC}/fdt/help.fdt # Always add MI sources .include "${BOOTSRC}/loader.mk" diff --git a/stand/defs.mk b/stand/defs.mk index 9b79e668469d..7c93abc2f6b1 100644 --- a/stand/defs.mk +++ b/stand/defs.mk @@ -170,8 +170,4 @@ ${_ILINKS}: ${ECHO} ${.TARGET:T} "->" $$path ; \ ln -fhs $$path ${.TARGET:T} -# For loader implementations, we generate a loader.help file. This can be suppressed by -# setting HELP_FILES to nothing. -HELP_FILES= ${LDRSRC}/help.common - .endif # __BOOT_DEFS_MK__ diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile index a3a23c87dfe7..c960632febee 100644 --- a/stand/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -83,7 +83,6 @@ CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE} .endif # Always add MI sources -HELP_FILES= .include "${BOOTSRC}/loader.mk" FILES+= loader.efi diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile index 40ac46ce0cf7..7733c58684cb 100644 --- a/stand/i386/loader/Makefile +++ b/stand/i386/loader/Makefile @@ -41,9 +41,7 @@ LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a .endif .if exists(${.CURDIR}/help.i386) -HELP_FILES+= help.i386 -.else -HELP_FILES= +HELP_FILES= ${.CURDIR}/help.i386 .endif # Always add MI sources diff --git a/stand/loader.mk b/stand/loader.mk index db3b10d39c98..b573296cf8a7 100644 --- a/stand/loader.mk +++ b/stand/loader.mk @@ -139,6 +139,8 @@ vers.c: ${LDRSRC}/newvers.sh ${VERSION_FILE} ${NEWVERSWHAT} .if !empty(HELP_FILES) +HELP_FILES+= ${LDRSRC}/help.common + CLEANFILES+= loader.help FILES+= loader.help diff --git a/stand/mips/beri/loader/Makefile b/stand/mips/beri/loader/Makefile index cbd1ecd334e4..c791294b9746 100644 --- a/stand/mips/beri/loader/Makefile +++ b/stand/mips/beri/loader/Makefile @@ -67,7 +67,7 @@ SRCS+= altera_jtag_uart.c \ # Since we don't have a backward compatibility issue, default to this on BERI. CFLAGS+= -DBOOT_PROMPT_123 -HELP_FILES+= ${.CURDIR}/help.mips +HELP_FILES= ${.CURDIR}/help.mips # Always add MI sources .include "${BOOTSRC}/loader.mk" diff --git a/stand/mips/uboot/Makefile b/stand/mips/uboot/Makefile index c605af1310e4..4a7350ac5aca 100644 --- a/stand/mips/uboot/Makefile +++ b/stand/mips/uboot/Makefile @@ -24,7 +24,7 @@ UBLDR_LOADADDR?= 0xffffffff80800000 # Architecture-specific loader code SRCS= start.S conf.c vers.c -HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt +HELP_FILES= ${.CURDIR}/help.uboot ${BOOTSRC}/fdt/help.fdt # Always add MI sources .include "${BOOTSRC}/loader.mk" diff --git a/stand/powerpc/kboot/Makefile b/stand/powerpc/kboot/Makefile index b51a06831fcd..e91421dde1b5 100644 --- a/stand/powerpc/kboot/Makefile +++ b/stand/powerpc/kboot/Makefile @@ -28,7 +28,6 @@ SRCS+= ucmpdi2.c CFLAGS+= -mcpu=powerpc64 # Always add MI sources -HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern @@ -45,6 +44,4 @@ CFLAGS+= -Wa,-mppc64bridge DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} -HELP_FILES+= ${FDTSRC}/help.fdt - .include diff --git a/stand/powerpc/ofw/Makefile b/stand/powerpc/ofw/Makefile index b28665db622c..e24b7af30222 100644 --- a/stand/powerpc/ofw/Makefile +++ b/stand/powerpc/ofw/Makefile @@ -27,7 +27,7 @@ SRCS+= ucmpdi2.c SRCS+= ofwfdt.c .endif -HELP_FILES+= ${FDTSRC}/help.fdt +HELP_FILES= ${FDTSRC}/help.fdt # Always add MI sources .include "${BOOTSRC}/loader.mk" diff --git a/stand/powerpc/ps3/Makefile b/stand/powerpc/ps3/Makefile index fc6ec9cb8b4e..69b1597147da 100644 --- a/stand/powerpc/ps3/Makefile +++ b/stand/powerpc/ps3/Makefile @@ -26,7 +26,6 @@ SRCS+= ucmpdi2.c CFLAGS+= -mcpu=powerpc64 # Always add MI sources -HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern diff --git a/stand/powerpc/uboot/Makefile b/stand/powerpc/uboot/Makefile index 6622cf18a316..623c464784bc 100644 --- a/stand/powerpc/uboot/Makefile +++ b/stand/powerpc/uboot/Makefile @@ -21,7 +21,6 @@ SRCS= start.S conf.c vers.c SRCS+= ucmpdi2.c # Always add MI sources -HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern diff --git a/stand/sparc64/loader/Makefile b/stand/sparc64/loader/Makefile index 5388761cf525..5b7c09a0a7fa 100644 --- a/stand/sparc64/loader/Makefile +++ b/stand/sparc64/loader/Makefile @@ -30,9 +30,7 @@ CFLAGS+= -DLOADER_DEBUG .endif .if exists(${.CURDIR}/help.sparc64) -HELP_FILES+= help.sparc64 -.else -HELP_FILES= +HELP_FILES= ${.CURDIR}/help.sparc64 .endif # Always add MI sources diff --git a/stand/userboot/userboot/Makefile b/stand/userboot/userboot/Makefile index cf235a9408cf..5946257cf3f5 100644 --- a/stand/userboot/userboot/Makefile +++ b/stand/userboot/userboot/Makefile @@ -49,7 +49,6 @@ LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a .endif # Always add MI sources -HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" CFLAGS+= -I. DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSA}