diff --git a/sys/boot/arm/uboot/Makefile b/sys/boot/arm/uboot/Makefile index 9f44e0f46d4e..5bf7d533b942 100644 --- a/sys/boot/arm/uboot/Makefile +++ b/sys/boot/arm/uboot/Makefile @@ -12,7 +12,7 @@ LOADER_BZIP2_SUPPORT?= no .include -FILES= ubldr ubldr.bin +FILES+= ubldr ubldr.bin NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b @@ -28,11 +28,10 @@ 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 + # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -I. - -CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float @@ -49,10 +48,6 @@ LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} -loader.help: help.common help.uboot ${BOOTSRC}/fdt/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - ldscript.abs: echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} @@ -72,15 +67,4 @@ ubldr.bin: ubldr.pie CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin -.if !defined(LOADER_ONLY) -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -# Install loader.rc. -FILES+= loader.rc -# Put sample menu.rc on disk but don't enable it by default. -FILES+= menu.rc -FILESNAME_menu.rc= menu.rc.sample -.endif - .include diff --git a/sys/boot/defs.mk b/sys/boot/defs.mk index b08ffa7c9b20..2753e21bdb21 100644 --- a/sys/boot/defs.mk +++ b/sys/boot/defs.mk @@ -122,6 +122,9 @@ LD_FLAGS+= -m elf_i386_fbsd AFLAGS+= --32 .endif +# Make sure we use the machine link we're about to create +CFLAGS+=-I. + _ILINKS=machine .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" _ILINKS+=${MACHINE_CPUARCH} @@ -161,4 +164,8 @@ ${_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/sys/boot/efi/boot1/Makefile b/sys/boot/efi/boot1/Makefile index 8f5aed50dce4..f2e69460593d 100644 --- a/sys/boot/efi/boot1/Makefile +++ b/sys/boot/efi/boot1/Makefile @@ -41,11 +41,9 @@ LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif -CFLAGS+= -I. CFLAGS+= -I${EFIINC} CFLAGS+= -I${EFIINCMD} CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include -CFLAGS+= -I${SYSDIR} CFLAGS+= -DEFI_UFS_BOOT .ifdef(EFI_DEBUG) CFLAGS+= -DEFI_DEBUG @@ -126,6 +124,6 @@ boot1.efifat: boot1.efi xz -d -c ${.CURDIR}/fat-${MACHINE}.tmpl.xz > ${.TARGET} ${DD} if=${.ALLSRC} of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc -CLEANFILES= boot1.efi boot1.efifat +CLEANFILES+= boot1.efi boot1.efifat .include diff --git a/sys/boot/efi/fdt/Makefile b/sys/boot/efi/fdt/Makefile index 01dbeed05eaf..7308ce94e45e 100644 --- a/sys/boot/efi/fdt/Makefile +++ b/sys/boot/efi/fdt/Makefile @@ -25,6 +25,6 @@ CFLAGS+= -I${EFISRC}/include/${MACHINE} CFLAGS+= -I${FDTSRC} # Pick up the bootstrap header for some interface items -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} .include diff --git a/sys/boot/efi/libefi/Makefile b/sys/boot/efi/libefi/Makefile index 99fe2bde2f98..e0ffd7b80f62 100644 --- a/sys/boot/efi/libefi/Makefile +++ b/sys/boot/efi/libefi/Makefile @@ -34,7 +34,6 @@ CFLAGS+= -mgeneral-regs-only .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -fPIC -mno-red-zone .endif -CFLAGS+= -I${SYSDIR} CFLAGS+= -I${EFIINC} CFLAGS+= -I${EFIINCMD} .if ${MK_ZFS} != "no" diff --git a/sys/boot/efi/loader/Makefile b/sys/boot/efi/loader/Makefile index 3561d6e46a37..a3a23c87dfe7 100644 --- a/sys/boot/efi/loader/Makefile +++ b/sys/boot/efi/loader/Makefile @@ -55,7 +55,6 @@ CFLAGS+= -I${.CURDIR}/arch/${MACHINE} CFLAGS+= -I${EFISRC}/include CFLAGS+= -I${EFISRC}/include/${MACHINE} CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include -CFLAGS+= -I${SYSDIR} CFLAGS+= -I${BOOTSRC}/i386/libi386 CFLAGS+= -DNO_PCI -DEFI @@ -84,6 +83,7 @@ CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE} .endif # Always add MI sources +HELP_FILES= .include "${BOOTSRC}/loader.mk" FILES+= loader.efi diff --git a/sys/boot/efi/loader/arch/arm64/Makefile.inc b/sys/boot/efi/loader/arch/arm64/Makefile.inc index b62ce41c0e27..a71bcc2e1a1f 100644 --- a/sys/boot/efi/loader/arch/arm64/Makefile.inc +++ b/sys/boot/efi/loader/arch/arm64/Makefile.inc @@ -10,16 +10,3 @@ CFLAGS+=-I${BOOTSRC}/arm64/libarm64 SRCS+= cache.c CFLAGS+= -mgeneral-regs-only - -CLEANFILES+= loader.help - -loader.help: help.common - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.if !defined(LOADER_ONLY) -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc -.endif diff --git a/sys/boot/ficl/Makefile b/sys/boot/ficl/Makefile index 6a92e6bf77c5..9a13614a7fea 100644 --- a/sys/boot/ficl/Makefile +++ b/sys/boot/ficl/Makefile @@ -8,7 +8,7 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \ prefix.c search.c stack.c tools.c vm.c words.c SRCS= ${BASE_SRCS} sysdep.c softcore.c -CLEANFILES= softcore.c testmain testmain.o +CLEANFILES+= softcore.c testmain testmain.o .include .ifmake testmain diff --git a/sys/boot/forth/Makefile b/sys/boot/forth/Makefile index 1f42003f9dcb..a0a55864fa5b 100644 --- a/sys/boot/forth/Makefile +++ b/sys/boot/forth/Makefile @@ -11,4 +11,33 @@ MAN+= beastie.4th.8 \ menusets.4th.8 \ version.4th.8 +FILES+= beastie.4th +FILES+= brand.4th +FILES+= brand-fbsd.4th +FILES+= check-password.4th +FILES+= color.4th +FILES+= delay.4th +FILES+= efi.4th +FILES+= frames.4th +FILES+= loader.4th +FILES+= loader.conf +FILES+= logo-beastie.4th +FILES+= logo-beastiebw.4th +FILES+= logo-fbsdbw.4th +FILES+= logo-orb.4th +FILES+= logo-orbbw.4th +FILES+= menu.4th +FILES+= menu-commands.4th +FILES+= menusets.4th +FILES+= pcibios.4th +FILES+= screen.4th +FILES+= shortcuts.4th +FILES+= support.4th +FILES+= version.4th +FILESDIR_loader.conf= /boot/defaults + +# Everybody has these, but you can override +.PATH: ${BOOTSRC}/${MACHINE:C/amd64/i386/}/common ${BOOTSRC}/forth +FILES+= loader.rc menu.rc + .include diff --git a/sys/boot/forth/Makefile.inc b/sys/boot/forth/Makefile.inc deleted file mode 100644 index d31ff3f26291..000000000000 --- a/sys/boot/forth/Makefile.inc +++ /dev/null @@ -1,26 +0,0 @@ -# $FreeBSD$ - -FILES+= beastie.4th -FILES+= brand.4th -FILES+= brand-fbsd.4th -FILES+= check-password.4th -FILES+= color.4th -FILES+= delay.4th -FILES+= efi.4th -FILES+= frames.4th -FILES+= loader.4th -FILES+= loader.conf -FILES+= loader.help -FILES+= logo-beastie.4th -FILES+= logo-beastiebw.4th -FILES+= logo-fbsdbw.4th -FILES+= logo-orb.4th -FILES+= logo-orbbw.4th -FILES+= menu.4th -FILES+= menu-commands.4th -FILES+= menusets.4th -FILES+= screen.4th -FILES+= shortcuts.4th -FILES+= support.4th -FILES+= version.4th -FILESDIR_loader.conf= /boot/defaults diff --git a/sys/boot/geli/Makefile b/sys/boot/geli/Makefile index 89d6a9f956e8..c7904311c08d 100644 --- a/sys/boot/geli/Makefile +++ b/sys/boot/geli/Makefile @@ -38,7 +38,6 @@ SRCS+= md5c.c # AES implementation from sys/crypto .PATH: ${SYSDIR}/crypto/rijndael -CFLAGS+= -I${SYSDIR} CFLAGS+= -I${LDRSRC} # Remove asserts CFLAGS+= -DNDEBUG diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile index 9f9e5191e133..c3146b3e9063 100644 --- a/sys/boot/i386/boot2/Makefile +++ b/sys/boot/i386/boot2/Makefile @@ -31,7 +31,7 @@ CFLAGS+=-fomit-frame-pointer \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${LDRSRC} \ - -I${BTXLIB} -I. \ + -I${BTXLIB} \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ @@ -48,7 +48,7 @@ CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} LD_FLAGS+=${LD_FLAGS_BIN} -CLEANFILES= boot +CLEANFILES+= boot boot: boot1 boot2 cat boot1 boot2 > boot diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile index efe45cb6dbdc..9e62007c55ae 100644 --- a/sys/boot/i386/gptboot/Makefile +++ b/sys/boot/i386/gptboot/Makefile @@ -33,9 +33,8 @@ CFLAGS+=-DBOOTPROG=\"gptboot\" \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${LDRSRC} \ -I${BOOTSRC}/i386/common \ - -I${BTXLIB} -I. \ + -I${BTXLIB} \ -I${BOOTSRC}/i386/boot2 \ - -I${SYSDIR} \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ @@ -45,7 +44,7 @@ CFLAGS.gcc+= --param max-inline-insns-single=100 LD_FLAGS+=${LD_FLAGS_BIN} -CLEANFILES= gptboot +CLEANFILES+= gptboot gptboot: gptldr.bin gptboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \ diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot/Makefile index d2751c217e7c..97f195445151 100644 --- a/sys/boot/i386/gptzfsboot/Makefile +++ b/sys/boot/i386/gptzfsboot/Makefile @@ -31,9 +31,8 @@ CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \ -I${BOOTSRC}/i386/common \ -I${ZFSSRC} \ -I${SYSDIR}/cddl/boot/zfs \ - -I${BOOTSRC}/i386/btx/lib -I. \ + -I${BOOTSRC}/i386/btx/lib \ -I${BOOTSRC}/i386/boot2 \ - -I${SYSDIR} \ -Wall -Waggregate-return -Wbad-function-cast \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ @@ -56,7 +55,7 @@ CFLAGS.gcc+= --param max-inline-insns-single=100 LD_FLAGS+=${LD_FLAGS_BIN} -CLEANFILES= gptzfsboot +CLEANFILES+= gptzfsboot gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \ diff --git a/sys/boot/i386/libfirewire/Makefile b/sys/boot/i386/libfirewire/Makefile index be906ff94636..d3f88c448b6f 100644 --- a/sys/boot/i386/libfirewire/Makefile +++ b/sys/boot/i386/libfirewire/Makefile @@ -11,7 +11,7 @@ SRCS+= dcons.c fwcrom.c CFLAGS+= -D_BOOT -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} CFLAGS+= -I${BTXLIB} CFLAGS+= -I${BOOTSRC}/i386/libi386 diff --git a/sys/boot/i386/libi386/Makefile b/sys/boot/i386/libi386/Makefile index 43d191dec195..8d65513436c3 100644 --- a/sys/boot/i386/libi386/Makefile +++ b/sys/boot/i386/libi386/Makefile @@ -49,8 +49,7 @@ CFLAGS+= -Dalloca=__builtin_alloca CFLAGS+= -I${BOOTSRC}/ficl -I${BOOTSRC}/ficl/i386 \ -I${LDRSRC} -I${BOOTSRC}/i386/common \ -I${BTXLIB} \ - -I${SYSDIR}/contrib/dev/acpica/include \ - -I${SYSDIR} -I. + -I${SYSDIR}/contrib/dev/acpica/include # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile index a79b4fbdbcc2..40ac46ce0cf7 100644 --- a/sys/boot/i386/loader/Makefile +++ b/sys/boot/i386/loader/Makefile @@ -40,11 +40,16 @@ CFLAGS+= -DLOADER_FIREWIRE_SUPPORT LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a .endif +.if exists(${.CURDIR}/help.i386) +HELP_FILES+= help.i386 +.else +HELP_FILES= +.endif + # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -I. -CLEANFILES= ${LOADER} ${LOADER}.bin loader.help +CLEANFILES+= ${LOADER} ${LOADER}.bin CFLAGS+= -Wall LDFLAGS+= -static -Ttext 0x0 @@ -67,21 +72,10 @@ ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} ${LOADER}.bin: ${LOADER}.sym strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC} -loader.help: help.common help.i386 - cat ${.ALLSRC} | awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -FILES= ${LOADER} +FILES+= ${LOADER} # XXX INSTALLFLAGS_loader= -b FILESMODE_${LOADER}= ${BINMODE} -b -.if !defined(LOADER_ONLY) -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" -FILES+= pcibios.4th - -FILES+= loader.rc menu.rc -.endif - # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} diff --git a/sys/boot/i386/pxeldr/Makefile b/sys/boot/i386/pxeldr/Makefile index 57931a5206cd..819283cf8a2a 100644 --- a/sys/boot/i386/pxeldr/Makefile +++ b/sys/boot/i386/pxeldr/Makefile @@ -7,7 +7,7 @@ INTERNALPROG= FILES= ${BOOT} MAN= ${BOOT}.8 SRCS= ${LDR}.S -CLEANFILES= ${BOOT} +CLEANFILES+= ${BOOT} BOOT= pxeboot LDR= pxeldr diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makefile index 81ab6f39a3d1..f0523dfa2612 100644 --- a/sys/boot/i386/zfsboot/Makefile +++ b/sys/boot/i386/zfsboot/Makefile @@ -30,7 +30,7 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -I${BOOTSRC}/i386 \ -I${ZFSSRC} \ -I${SYSDIR}/cddl/boot/zfs \ - -I${BTXLIB} -I. \ + -I${BTXLIB} \ -I${BOOTSRC}/i386/boot2 \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ @@ -46,7 +46,7 @@ LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a LD_FLAGS+=${LD_FLAGS_BIN} -CLEANFILES= zfsboot +CLEANFILES+= zfsboot zfsboot: zfsboot1 zfsboot2 cat zfsboot1 zfsboot2 > zfsboot diff --git a/sys/boot/i386/zfsloader/Makefile b/sys/boot/i386/zfsloader/Makefile index 6111e47f12fb..a9fa913e7e13 100644 --- a/sys/boot/i386/zfsloader/Makefile +++ b/sys/boot/i386/zfsloader/Makefile @@ -2,8 +2,6 @@ LOADER= zfsloader NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 -LOADER_ONLY= yes HAVE_ZFS= yes .include "${.CURDIR}/../loader/Makefile" - diff --git a/sys/boot/libsa/Makefile b/sys/boot/libsa/Makefile index 057eb7615beb..9aa228847c83 100644 --- a/sys/boot/libsa/Makefile +++ b/sys/boot/libsa/Makefile @@ -19,7 +19,7 @@ LIB?= sa NO_PIC= WARNS?= 0 -CFLAGS+= -I${SASRC} -I${SYSDIR} +CFLAGS+= -I${SASRC} # standalone components and stuff we have modified locally SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \ diff --git a/sys/boot/libsa32/Makefile b/sys/boot/libsa32/Makefile index f09811b62128..eba6c00bd891 100644 --- a/sys/boot/libsa32/Makefile +++ b/sys/boot/libsa32/Makefile @@ -7,7 +7,5 @@ DO32=1 LIB=sa32 LIBSA_CPUARCH=${MACHINE_CPUARCH:C/amd64/i386/} -CFLAGS+= -I. - .PATH: ${SASRC} .include "${SASRC}/Makefile" diff --git a/sys/boot/loader.mk b/sys/boot/loader.mk index 8b99153589d7..7236c8614e06 100644 --- a/sys/boot/loader.mk +++ b/sys/boot/loader.mk @@ -90,3 +90,11 @@ REPRO_FLAG= -r vers.c: ${LDRSRC}/newvers.sh ${VERSION_FILE} sh ${LDRSRC}/newvers.sh ${REPRO_FLAG} ${VERSION_FILE} \ ${NEWVERSWHAT} + +.if !empty(HELP_FILES) +CLEANFILES+= loader.help +FILES+= loader.help + +loader.help: ${HELP_FILES} + cat ${HELP_FILES} | awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} +.endif diff --git a/sys/boot/mips/beri/boot2/Makefile b/sys/boot/mips/beri/boot2/Makefile index 9a993e22cdac..d36934078e1a 100644 --- a/sys/boot/mips/beri/boot2/Makefile +++ b/sys/boot/mips/beri/boot2/Makefile @@ -51,7 +51,6 @@ CFLAGS= -ffreestanding \ -I${.CURDIR} \ -I${SASRC} \ -I${LDRSRC} \ - -I${SYSDIR} \ -D_KERNEL \ -Wall \ -G0 \ diff --git a/sys/boot/mips/beri/loader/Makefile b/sys/boot/mips/beri/loader/Makefile index 35a2ab33319c..763b3b34662e 100644 --- a/sys/boot/mips/beri/loader/Makefile +++ b/sys/boot/mips/beri/loader/Makefile @@ -67,6 +67,8 @@ 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+= help.mips + # Always add MI sources .include "${BOOTSRC}/loader.mk" @@ -77,8 +79,6 @@ CFLAGS+= -I${BOOTSRC}/mips/beri/common # Loader-specific MD headers CFLAGS+= -I${.CURDIR} -CLEANFILES+= loader.help - # Generate code appropriate for the loader environment CFLAGS+= -G0 \ -fno-pic \ @@ -95,15 +95,6 @@ LDFLAGS= -nostdlib \ DPADD= ${LIBFICL} ${LIBSA} LDADD= ${LIBFICL} ${LIBSA} -loader.help: help.common help.mips - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc menu.rc - .if defined(LOADER_USB_SUPPORT) # Do garbage collection CFLAGS+= -ffunction-sections -fdata-sections diff --git a/sys/boot/mips/uboot/Makefile b/sys/boot/mips/uboot/Makefile index a262b8756920..b941ba342431 100644 --- a/sys/boot/mips/uboot/Makefile +++ b/sys/boot/mips/uboot/Makefile @@ -12,7 +12,7 @@ LOADER_BZIP2_SUPPORT?= no .include -FILES= ubldr +FILES+= ubldr NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b @@ -24,11 +24,10 @@ UBLDR_LOADADDR?= 0xffffffff80800000 # Architecture-specific loader code SRCS= start.S conf.c vers.c +HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt + # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -I. - -CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float -g @@ -41,10 +40,6 @@ LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} -loader.help: help.common help.uboot ${BOOTSRC}/fdt/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - ldscript.abs: echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} @@ -58,16 +53,5 @@ ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin -.if !defined(LOADER_ONLY) -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -# Install loader.rc. -FILES+= loader.rc -# Put sample menu.rc on disk but don't enable it by default. -FILES+= menu.rc -FILESNAME_menu.rc= menu.rc.sample -.endif - .include .include diff --git a/sys/boot/ofw/libofw/Makefile b/sys/boot/ofw/libofw/Makefile index 836e2a821d1a..8e9ac804c5fa 100644 --- a/sys/boot/ofw/libofw/Makefile +++ b/sys/boot/ofw/libofw/Makefile @@ -12,7 +12,7 @@ SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_copy.c ofw_disk.c \ SRCS+= devicename_stubs.c # Pick up the bootstrap header for some interface items -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "powerpc" diff --git a/sys/boot/powerpc/boot1.chrp/Makefile b/sys/boot/powerpc/boot1.chrp/Makefile index 8439d140b68a..384d0abc2788 100644 --- a/sys/boot/powerpc/boot1.chrp/Makefile +++ b/sys/boot/powerpc/boot1.chrp/Makefile @@ -34,7 +34,7 @@ boot1.hfs: boot1.elf bootinfo.txt ${DD} if=${.CURDIR}/bootinfo.txt of=${.TARGET} seek=${BOOTINFO_OFFSET} \ conv=notrunc -CLEANFILES= boot1.hfs +CLEANFILES+= boot1.hfs boot1.o: ${SASRC}/ufsread.c diff --git a/sys/boot/powerpc/kboot/Makefile b/sys/boot/powerpc/kboot/Makefile index 2d45796f5063..bed586e6732a 100644 --- a/sys/boot/powerpc/kboot/Makefile +++ b/sys/boot/powerpc/kboot/Makefile @@ -28,12 +28,9 @@ SRCS+= ucmpdi2.c CFLAGS+= -mcpu=powerpc64 # Always add MI sources +HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -I${SYSDIR} -CFLAGS+= -I. - -CLEANFILES+= loader.help CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM # load address. set in linker script @@ -48,13 +45,6 @@ CFLAGS+= -Wa,-mppc64bridge DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} -loader.help: help.common ${FDTSRC}/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc menu.rc +HELP_FILES+= ${FDTSRC}/help.fdt .include diff --git a/sys/boot/powerpc/ofw/Makefile b/sys/boot/powerpc/ofw/Makefile index ae3dfbd54f2d..1853b2596fce 100644 --- a/sys/boot/powerpc/ofw/Makefile +++ b/sys/boot/powerpc/ofw/Makefile @@ -27,14 +27,12 @@ SRCS+= ucmpdi2.c SRCS+= ofwfdt.c .endif +HELP_FILES+= ${FDTSRC}/help.fdt + # Always add MI sources .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -I${SYSDIR} -CFLAGS+= -I. - -CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float # load address. set in linker script @@ -54,13 +52,4 @@ CFLAGS+= -I${BOOTSRC}/ofw/libofw DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} -loader.help: help.common ${FDTSRC}/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc menu.rc - .include diff --git a/sys/boot/powerpc/ps3/Makefile b/sys/boot/powerpc/ps3/Makefile index 793edbcd23c7..07ad135d9796 100644 --- a/sys/boot/powerpc/ps3/Makefile +++ b/sys/boot/powerpc/ps3/Makefile @@ -26,12 +26,9 @@ SRCS+= ucmpdi2.c CFLAGS+= -mcpu=powerpc64 # Always add MI sources +HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -I${SYSDIR} -CFLAGS+= -I. - -CLEANFILES+= loader.help CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM # load address. set in linker script @@ -48,13 +45,4 @@ SC_DFLT_FONT=cp437 font.h: uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h -loader.help: help.common - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc menu.rc - .include diff --git a/sys/boot/powerpc/uboot/Makefile b/sys/boot/powerpc/uboot/Makefile index 06130306d0df..d543aceeee4c 100644 --- a/sys/boot/powerpc/uboot/Makefile +++ b/sys/boot/powerpc/uboot/Makefile @@ -21,12 +21,9 @@ SRCS= start.S conf.c vers.c SRCS+= ucmpdi2.c # Always add MI sources +HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -I${SYSDIR} -CFLAGS+= -I. - -CLEANFILES+= ${PROG}.help CFLAGS+= -ffreestanding @@ -37,11 +34,4 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} -loader.help: help.common ${BOOTSRC}/fdt/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -FILES= loader.help - .include diff --git a/sys/boot/sparc64/boot1/Makefile b/sys/boot/sparc64/boot1/Makefile index 7d501a0f75ba..36e396896102 100644 --- a/sys/boot/sparc64/boot1/Makefile +++ b/sys/boot/sparc64/boot1/Makefile @@ -7,7 +7,7 @@ INTERNALPROG= MAN= FILES?= boot1 SRCS= _start.s boot1.c -CLEANFILES=${FILES} boot1.aout +CLEANFILES+=${FILES} boot1.aout BOOTBLOCKBASE= 0x4000 diff --git a/sys/boot/sparc64/loader/Makefile b/sys/boot/sparc64/loader/Makefile index f7fb0300d411..5388761cf525 100644 --- a/sys/boot/sparc64/loader/Makefile +++ b/sys/boot/sparc64/loader/Makefile @@ -29,11 +29,14 @@ SRCS= locore.S main.c metadata.c vers.c CFLAGS+= -DLOADER_DEBUG .endif +.if exists(${.CURDIR}/help.sparc64) +HELP_FILES+= help.sparc64 +.else +HELP_FILES= +.endif + # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -I. - -CLEANFILES+= loader.help LDFLAGS+= -static @@ -41,19 +44,7 @@ LDFLAGS+= -static LIBOFW= ${BOOTOBJ}/ofw/libofw/libofw.a CFLAGS+= -I${BOOTSRC}/ofw/libofw/ -# Need sys/ for crypto/intake.h -CFLAGS+= -I${SRCTOP}/sys - DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} -loader.help: help.common help.sparc64 - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc menu.rc - .include diff --git a/sys/boot/uboot/fdt/Makefile b/sys/boot/uboot/fdt/Makefile index 87bebca5c0d8..4bc38ec7c6f0 100644 --- a/sys/boot/uboot/fdt/Makefile +++ b/sys/boot/uboot/fdt/Makefile @@ -19,7 +19,7 @@ CFLAGS+= -I${UBOOTSRC}/lib CFLAGS+= -I${FDTSRC} # Pick up the bootstrap header for some interface items -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} .include .include diff --git a/sys/boot/uboot/lib/Makefile b/sys/boot/uboot/lib/Makefile index 6eebbaaa33e7..d12d48cafaa1 100644 --- a/sys/boot/uboot/lib/Makefile +++ b/sys/boot/uboot/lib/Makefile @@ -20,7 +20,7 @@ SRCS+= disk.c .include "${BOOTSRC}/fdt.mk" # Pick up the bootstrap header for some interface items -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} .ifdef(BOOT_DISK_DEBUG) # Make the disk code more talkative diff --git a/sys/boot/userboot/test/Makefile b/sys/boot/userboot/test/Makefile index cfca6971d12c..1bc66798aac8 100644 --- a/sys/boot/userboot/test/Makefile +++ b/sys/boot/userboot/test/Makefile @@ -10,6 +10,5 @@ PROG= test INTERNALPROG= CFLAGS+= -I${BOOTSRC}/userboot -CFLAGS+= -I${SYSDIR} .include diff --git a/sys/boot/userboot/userboot/Makefile b/sys/boot/userboot/userboot/Makefile index ae0c35db9453..cbada8227ba0 100644 --- a/sys/boot/userboot/userboot/Makefile +++ b/sys/boot/userboot/userboot/Makefile @@ -36,8 +36,7 @@ SRCS+= vers.c CFLAGS+= -Wall CFLAGS+= -I${BOOTSRC}/userboot -CFLAGS+= -I${SYSDIR} -CFLAGS+= -ffreestanding -I. +CFLAGS+= -ffreestanding CWARNFLAGS.main.c += -Wno-implicit-function-declaration @@ -51,6 +50,7 @@ LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a .endif # Always add MI sources +HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" CFLAGS+= -I. DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSA} diff --git a/sys/boot/zfs/Makefile b/sys/boot/zfs/Makefile index 7575aa9207eb..e86c84b02fc0 100644 --- a/sys/boot/zfs/Makefile +++ b/sys/boot/zfs/Makefile @@ -12,7 +12,7 @@ CFLAGS+= -DSKEIN_LOOP=111 .PATH: ${SYSDIR}/crypto/skein CFLAGS+= -DBOOTPROG=\"zfsloader\" -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} CFLAGS+= -I${SYSDIR}/cddl/boot/zfs CFLAGS+= -I${SYSDIR}/crypto/skein