From e32fecd0c2c3ee37c47ee100f169e7eb0282a873 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Fri, 5 May 2023 13:43:33 -0400 Subject: [PATCH] loader: install help files only once Every file should be installed exactly once by `make installworld`. This is especially important for pkgbase. Loader help files were being installed by each loader variant (e.g., the simp, lua, and 4th EFI loaders). Add a (slightly hacky) mechanism to skip installing help files for all but one variant. PR: 271178 Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40021 --- stand/efi/loader_4th/Makefile | 1 + stand/efi/loader_lua/Makefile | 1 + stand/i386/loader_4th/Makefile | 1 + stand/i386/loader_lua/Makefile | 1 + stand/loader.mk | 2 ++ stand/userboot/userboot_4th/Makefile | 1 + stand/userboot/userboot_lua/Makefile | 1 + 7 files changed, 8 insertions(+) diff --git a/stand/efi/loader_4th/Makefile b/stand/efi/loader_4th/Makefile index 3659f7efe67..a85fcdbb70b 100644 --- a/stand/efi/loader_4th/Makefile +++ b/stand/efi/loader_4th/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ LOADER_INTERP=4th +INSTALL_LOADER_HELP_FILE=no .include "../loader/Makefile" diff --git a/stand/efi/loader_lua/Makefile b/stand/efi/loader_lua/Makefile index 3a4268440cf..3766588015a 100644 --- a/stand/efi/loader_lua/Makefile +++ b/stand/efi/loader_lua/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ LOADER_INTERP=lua +INSTALL_LOADER_HELP_FILE=no .include "../loader/Makefile" diff --git a/stand/i386/loader_4th/Makefile b/stand/i386/loader_4th/Makefile index 3659f7efe67..a85fcdbb70b 100644 --- a/stand/i386/loader_4th/Makefile +++ b/stand/i386/loader_4th/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ LOADER_INTERP=4th +INSTALL_LOADER_HELP_FILE=no .include "../loader/Makefile" diff --git a/stand/i386/loader_lua/Makefile b/stand/i386/loader_lua/Makefile index 3a4268440cf..3766588015a 100644 --- a/stand/i386/loader_lua/Makefile +++ b/stand/i386/loader_lua/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ LOADER_INTERP=lua +INSTALL_LOADER_HELP_FILE=no .include "../loader/Makefile" diff --git a/stand/loader.mk b/stand/loader.mk index b30e9f4e66b..2048fec750e 100644 --- a/stand/loader.mk +++ b/stand/loader.mk @@ -171,8 +171,10 @@ CFLAGS+= -DELF_VERBOSE HELP_FILES+= ${LDRSRC}/help.common CFLAGS+= -DHELP_FILENAME=\"${HELP_FILENAME}\" +.if ${INSTALL_LOADER_HELP_FILE:Uyes} == "yes" CLEANFILES+= ${HELP_FILENAME} FILES+= ${HELP_FILENAME} +.endif ${HELP_FILENAME}: ${HELP_FILES} cat ${HELP_FILES} | awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} diff --git a/stand/userboot/userboot_4th/Makefile b/stand/userboot/userboot_4th/Makefile index a96efa8a52b..b4b4b895e29 100644 --- a/stand/userboot/userboot_4th/Makefile +++ b/stand/userboot/userboot_4th/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ LOADER_INTERP=4th +INSTALL_LOADER_HELP_FILE=no .include "../userboot/Makefile" diff --git a/stand/userboot/userboot_lua/Makefile b/stand/userboot/userboot_lua/Makefile index d5b95c53641..bba0f4a3fd7 100644 --- a/stand/userboot/userboot_lua/Makefile +++ b/stand/userboot/userboot_lua/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ LOADER_INTERP=lua +INSTALL_LOADER_HELP_FILE=no .include "../userboot/Makefile"