Index: head/sys/boot/mips/beri/boot2/Makefile =================================================================== --- head/sys/boot/mips/beri/boot2/Makefile (revision 325113) +++ head/sys/boot/mips/beri/boot2/Makefile (revision 325114) @@ -1,84 +1,87 @@ #- # Copyright (c) 2013-2014 Robert N. M. Watson # All rights reserved. # # This software was developed by SRI International and the University of # Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) # ("CTSRD"), as part of the DARPA CRASH research programme. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ +.include + INSTALLFLAGS= -b LOADERS= flashboot jtagboot FILES= ${LOADERS} ${LOADERS:S/$/.md5/} SRCS= relocate.S \ start.S \ boot2.c \ altera_jtag_uart.c \ cfi.c \ sdcard.c MAN= AFLAGS= -G0 CFLAGS= -ffreestanding \ -I${.CURDIR} \ - -I${.CURDIR}/../../../common \ - -I${.CURDIR}/../../../.. \ + -I${SASRC} \ + -I${LDRSRC} \ + -I${SYSDIR} \ -D_KERNEL \ -Wall \ -G0 \ -fno-pic -mno-abicalls \ -msoft-float \ -g LDFLAGS= -nostdlib \ -static \ -Wl,-N \ -G0 \ -L${.CURDIR} -.PATH: ${.CURDIR}/../common -CFLAGS+= -I${.CURDIR}/../common +.PATH: ${BOOTSRC}/mips/beri/common +CFLAGS+= -I${BOOTSRC}/mips/beri/common flashboot.elf: relocate.o start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o ${CC} ${LDFLAGS} -T ${.CURDIR}/flashboot.ldscript -o ${.TARGET} \ ${.ALLSRC} ${LIBSA} flashboot: flashboot.elf ${OBJCOPY} -S -O binary ${.TARGET}.elf ${.TARGET} flashboot.md5: flashboot md5 flashboot > flashboot.md5 jtagboot: start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o ${CC} ${LDFLAGS} -T ${.CURDIR}/jtagboot.ldscript -o ${.TARGET} \ ${.ALLSRC} ${LIBSA} jtagboot.md5: jtagboot md5 jtagboot > jtagboot.md5 CLEANFILES+= flashboot.elf .include Index: head/sys/boot/mips/beri/loader/Makefile =================================================================== --- head/sys/boot/mips/beri/loader/Makefile (revision 325113) +++ head/sys/boot/mips/beri/loader/Makefile (revision 325114) @@ -1,119 +1,120 @@ #- # Copyright (c) 2013-2014 Robert N. M. Watson # All rights reserved. # # This software was developed by SRI International and the University of # Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) # ("CTSRD"), as part of the DARPA CRASH research programme. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ -.include +.include + MK_SSP= no MAN= PROG?= loader NEWVERSWHAT= "BERI loader" ${MACHINE_CPUARCH} INSTALLFLAGS= -b # Architecture-specific loader code SRCS= start.S \ main.c \ devicename.c \ exec.c \ metadata.c \ vers.c \ arch.c # libstand front-ends for shared driver code SRCS+= beri_console.c \ beri_disk_cfi.c \ beri_disk_sdcard.c # Common code with boot2 SRCS+= altera_jtag_uart.c \ cfi.c \ sdcard.c # Since we don't have a backward compatibility issue, default to this on BERI. CFLAGS+= -DBOOT_PROMPT_123 LOADER_MSDOS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= yes # Always add MI sources -.include "../../../loader.mk" +.include "${BOOTSRC}/loader.mk" # BERI files common to boot2 and loader -.PATH: ${.CURDIR}/../common -CFLAGS+= -I${.CURDIR}/../common +.PATH: ${BOOTSRC}/mips/beri/common +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 \ -mno-abicalls \ -msoft-float \ -g LDFLAGS= -nostdlib \ -static \ -T ${.CURDIR}/loader.ldscript \ -L${.CURDIR} \ -e __start DPADD= ${LIBFICL} ${LIBSA} LDADD= ${LIBFICL} ${LIBSA} loader.help: help.common help.mips cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} -.PATH: ${.CURDIR}/../../../forth -.include "${.CURDIR}/../../../forth/Makefile.inc" +.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 CFLAGS+= -Wl,--gc-sections # Link USB BOOT library -LDADD+= ${.OBJDIR}/../../../usb/libusbboot.a -CFLAGS+= -I${.CURDIR}/../../../usb +LDADD+= ${BOOTOBJ}/usb/libusbboot.a +CFLAGS+= -I${BOOTSRC}/usb # Define USB SUPPORT CFLAGS+= -DLOADER_USB_SUPPORT .endif all: loader .include Index: head/sys/boot/mips/uboot/Makefile =================================================================== --- head/sys/boot/mips/uboot/Makefile (revision 325113) +++ head/sys/boot/mips/uboot/Makefile (revision 325114) @@ -1,74 +1,74 @@ # $FreeBSD$ -.include +.include FILES= ubldr NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b WARNS?= 1 # Address at which ubldr will be loaded. # This varies for different boards and SOCs. UBLDR_LOADADDR?= 0xffffffff80800000 # Architecture-specific loader code SRCS= start.S conf.c vers.c LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no LOADER_MSDOS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no LOADER_FDT_SUPPORT= ${MK_FDT} # Always add MI sources -.include "../../loader.mk" +.include "${BOOTSRC}/loader.mk" CFLAGS+= -I. CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float -g LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} -.include "../../uboot.mk" +.include "${BOOTSRC}/uboot.mk" DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} -loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt +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} ldscript.pie: echo "UBLDR_LOADADDR = 0;" >${.TARGET} ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} ${CC} ${CFLAGS} -T ldscript.abs ${LDFLAGS} \ -o ${.TARGET} ${OBJS} ${LDADD} ${OBJCOPY} -S -O binary ubldr ubldr.bin CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin .if !defined(LOADER_ONLY) -.PATH: ${.CURDIR}/../../forth -.include "${.CURDIR}/../../forth/Makefile.inc" +.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 Index: head/sys/boot/ofw/libofw/Makefile =================================================================== --- head/sys/boot/ofw/libofw/Makefile (revision 325113) +++ head/sys/boot/ofw/libofw/Makefile (revision 325114) @@ -1,33 +1,35 @@ # $FreeBSD$ +.include + LIB= ofw INTERNALLIB= SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_copy.c ofw_disk.c \ ofw_memory.c ofw_module.c ofw_net.c ofw_reboot.c \ ofw_time.c openfirm.c .PATH: ${BOOTSRC}/zfs SRCS+= devicename_stubs.c # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "powerpc" CFLAGS+= -msoft-float SRCS+= ppc64_elf_freebsd.c .endif .ifdef(BOOT_DISK_DEBUG) # Make the disk code more talkative CFLAGS+= -DDISK_DEBUG .endif machine: .NOMETA ln -sf ${SYSDIR}/${MACHINE_CPUARCH}/include machine CLEANFILES+= machine .include beforedepend ${OBJS}: machine Index: head/sys/boot/powerpc/boot1.chrp/Makefile =================================================================== --- head/sys/boot/powerpc/boot1.chrp/Makefile (revision 325113) +++ head/sys/boot/powerpc/boot1.chrp/Makefile (revision 325114) @@ -1,42 +1,42 @@ # $FreeBSD$ +.include + SSP_CFLAGS= PROG= boot1.elf NEWVERSWHAT= "Open Firmware boot block" ${MACHINE_ARCH} INSTALLFLAGS= -b FILES= boot1.hfs SRCS= boot1.c ashldi3.c syncicache.c MAN= CFLAGS= -ffreestanding -msoft-float \ - -I${.CURDIR}/../../common -I${.CURDIR}/../../../ \ + -I${LDRSRC} -I${SYSDIR} -I${SASRC} \ -D_STANDALONE LDFLAGS=-nostdlib -static -Wl,-N -.include "../Makefile.inc" - -.PATH: ${.CURDIR}/../../../libkern ${SRCTOP}/lib/libc/powerpc/gen ${.CURDIR} +.PATH: ${SYSDIR}/libkern ${SRCTOP}/lib/libc/powerpc/gen ${.CURDIR} # The following inserts out objects into a template HFS # created by generate-hfs.sh .include "${.CURDIR}/Makefile.hfs" boot1.hfs: boot1.elf bootinfo.txt echo ${.OBJDIR} uudecode ${.CURDIR}/hfs.tmpl.bz2.uu mv hfs.tmpl.bz2 ${.TARGET}.bz2 bzip2 -f -d ${.TARGET}.bz2 ${DD} if=boot1.elf of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc ${DD} if=${.CURDIR}/bootinfo.txt of=${.TARGET} seek=${BOOTINFO_OFFSET} \ conv=notrunc CLEANFILES= boot1.hfs boot1.o: ${SASRC}/ufsread.c .include Index: head/sys/boot/powerpc/kboot/Makefile =================================================================== --- head/sys/boot/powerpc/kboot/Makefile (revision 325113) +++ head/sys/boot/powerpc/kboot/Makefile (revision 325114) @@ -1,71 +1,66 @@ # $FreeBSD$ -.include +.include MK_SSP= no MAN= PROG= loader.kboot NEWVERSWHAT= "kboot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code SRCS= conf.c metadata.c vers.c main.c ppc64_elf_freebsd.c SRCS+= host_syscall.S hostcons.c hostdisk.c kerneltramp.S kbootfdt.c SRCS+= ucmpdi2.c LOADER_CD9660_SUPPORT?= yes LOADER_MSDOS_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= yes LOADER_FDT_SUPPORT= yes LOADER_BZIP2_SUPPORT?= no .if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -I${.CURDIR}/../../fdt -CFLAGS+= -I${.OBJDIR}/../../fdt -CFLAGS+= -I${.CURDIR}/../../../contrib/libfdt +CFLAGS+= -I${FDTSRC} +CFLAGS+= -I${SYSDIR}/contrib/libfdt CFLAGS+= -DLOADER_FDT_SUPPORT -LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a +LIBFDT= ${BOOTOBJ}/fdt/libfdt.a .endif CFLAGS+= -mcpu=powerpc64 # Always add MI sources -.include "../../loader.mk" -.PATH: ${.CURDIR}/../../../libkern -CFLAGS+= -I${.CURDIR}/../../.. +.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 RELOC?= 0x0 CFLAGS+= -DRELOC=${RELOC} LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc # 64-bit bridge extensions CFLAGS+= -Wa,-mppc64bridge -# Pull in common loader code -#.PATH: ${.CURDIR}/../../ofw/common -#.include "${.CURDIR}/../../ofw/common/Makefile.inc" - DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} -loader.help: help.common help.kboot ${.CURDIR}/../../fdt/help.fdt +loader.help: help.common help.kboot ${FDTSRC}/help.fdt cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} -.PATH: ${.CURDIR}/../../forth -.include "${.CURDIR}/../../forth/Makefile.inc" +.PATH: ${BOOTSRC}/forth +.include "${BOOTSRC}/forth/Makefile.inc" FILES+= loader.rc menu.rc .include Index: head/sys/boot/powerpc/ofw/Makefile =================================================================== --- head/sys/boot/powerpc/ofw/Makefile (revision 325113) +++ head/sys/boot/powerpc/ofw/Makefile (revision 325114) @@ -1,71 +1,70 @@ # $FreeBSD$ -.include +.include MK_SSP= no MAN= PROG= loader NEWVERSWHAT= "Open Firmware loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code SRCS= conf.c metadata.c vers.c start.c SRCS+= ucmpdi2.c 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 LOADER_FDT_SUPPORT?= yes .if ${LOADER_FDT_SUPPORT} == "yes" SRCS+= ofwfdt.c -CFLAGS+= -I${.CURDIR}/../../fdt -CFLAGS+= -I${.OBJDIR}/../../fdt -CFLAGS+= -I${.CURDIR}/../../../contrib/libfdt +CFLAGS+= -I${FDTSRC} +CFLAGS+= -I${SYSDIR}/contrib/libfdt CFLAGS+= -DLOADER_FDT_SUPPORT -LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a +LIBFDT= ${BOOTOBJ}/fdt/libfdt.a .endif # Always add MI sources -.include "../../loader.mk" +.include "${BOOTSRC}/loader.mk" -.PATH: ${.CURDIR}/../../../libkern -CFLAGS+= -I${.CURDIR}/../../.. +.PATH: ${SYSDIR}/libkern +CFLAGS+= -I${SYSDIR} CFLAGS+= -I. CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float # load address. set in linker script RELOC?= 0x1C00000 CFLAGS+= -DRELOC=${RELOC} LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc # Pull in common loader code -.PATH: ${.CURDIR}/../../ofw/common -.include "${.CURDIR}/../../ofw/common/Makefile.inc" +.PATH: ${BOOTSRC}/ofw/common +.include "${BOOTSRC}/ofw/common/Makefile.inc" # Open Firmware standalone support library -LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a -CFLAGS+= -I${.CURDIR}/../../ofw/libofw +LIBOFW= ${BOOTOBJ}/ofw/libofw/libofw.a +CFLAGS+= -I${BOOTSRC}/ofw/libofw DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} -loader.help: help.common help.ofw ${.CURDIR}/../../fdt/help.fdt +loader.help: help.common help.ofw ${FDTSRC}/help.fdt cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} -.PATH: ${.CURDIR}/../../forth -.include "${.CURDIR}/../../forth/Makefile.inc" +.PATH: ${BOOTSRC}/forth +.include "${BOOTSRC}/forth/Makefile.inc" FILES+= loader.rc menu.rc .include Index: head/sys/boot/powerpc/ps3/Makefile =================================================================== --- head/sys/boot/powerpc/ps3/Makefile (revision 325113) +++ head/sys/boot/powerpc/ps3/Makefile (revision 325114) @@ -1,72 +1,67 @@ # $FreeBSD$ -.include +.include MK_SSP= no MAN= PROG= loader.ps3 NEWVERSWHAT= "Playstation 3 loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code SRCS= start.S conf.c metadata.c vers.c main.c devicename.c ppc64_elf_freebsd.c SRCS+= lv1call.S ps3cons.c font.h ps3mmu.c ps3net.c ps3repo.c \ ps3stor.c ps3disk.c ps3cdrom.c SRCS+= ucmpdi2.c LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes LOADER_EXT2FS_SUPPORT?= yes LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= yes LOADER_FDT_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no .if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -I${.CURDIR}/../../fdt -CFLAGS+= -I${.OBJDIR}/../../fdt +CFLAGS+= -I${FDTSRC} CFLAGS+= -DLOADER_FDT_SUPPORT -LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a +LIBFDT= ${BOOTOBJ}/fdt/libfdt.a .endif CFLAGS+= -mcpu=powerpc64 # Always add MI sources -.include "../../loader.mk" -.PATH: ${.CURDIR}/../../../libkern -CFLAGS+= -I${.CURDIR}/../../.. +.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 RELOC?= 0x0 CFLAGS+= -DRELOC=${RELOC} LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc -# Pull in common loader code -#.PATH: ${.CURDIR}/../../ofw/common -#.include "${.CURDIR}/../../ofw/common/Makefile.inc" - DPADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} LDADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} 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 help.ps3 ${.CURDIR}/../../fdt/help.fdt +loader.help: help.common help.ps3 ${FDTSRC}/help.fdt cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} -.PATH: ${.CURDIR}/../../forth -.include "${.CURDIR}/../../forth/Makefile.inc" +.PATH: ${BOOTSRC}/forth +.include "${BOOTSRC}/forth/Makefile.inc" FILES+= loader.rc menu.rc .include Index: head/sys/boot/powerpc/uboot/Makefile =================================================================== --- head/sys/boot/powerpc/uboot/Makefile (revision 325113) +++ head/sys/boot/powerpc/uboot/Makefile (revision 325114) @@ -1,48 +1,48 @@ # $FreeBSD$ -.include +.include PROG= ubldr NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b MAN= # Architecture-specific loader code SRCS= start.S conf.c vers.c SRCS+= ucmpdi2.c LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no LOADER_FDT_SUPPORT= ${MK_FDT} # Always add MI sources -.include "../../loader.mk" -.PATH: ${.CURDIR}/../../../libkern -CFLAGS+= -I${.CURDIR}/../../.. +.include "${BOOTSRC}/loader.mk" +.PATH: ${SYSDIR}/libkern +CFLAGS+= -I${SYSDIR} CFLAGS+= -I. CLEANFILES+= ${PROG}.help CFLAGS+= -ffreestanding LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc -.include "../../uboot.mk" +.include "${BOOTSRC}/uboot.mk" DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} -loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt +loader.help: help.common help.uboot ${BOOTSRC}/fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} -.PATH: ${.CURDIR}/../../forth +.PATH: ${BOOTSRC}/forth FILES= loader.help .include Index: head/sys/boot/sparc64/boot1/Makefile =================================================================== --- head/sys/boot/sparc64/boot1/Makefile (revision 325113) +++ head/sys/boot/sparc64/boot1/Makefile (revision 325114) @@ -1,32 +1,32 @@ # $FreeBSD$ -.include "../Makefile.inc" +.include PROG= boot1.elf INTERNALPROG= MAN= FILES?= boot1 SRCS= _start.s boot1.c CLEANFILES=${FILES} boot1.aout BOOTBLOCKBASE= 0x4000 CFLAGS.clang+=-mcmodel=small CFLAGS.gcc+=-mcmodel=medlow -CFLAGS+=-Os -I${.CURDIR}/../../common +CFLAGS+=-Os -I${LDRSRC} -nostdlib LDFLAGS=-Ttext ${BOOTBLOCKBASE} -Wl,-N # Construct boot1. sunlabel expects it to contain zeroed-out space for the # label, and to be of the correct size. ${FILES}: boot1.aout @set -- `ls -l ${.ALLSRC}`; x=$$((7680-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 ${DD} if=/dev/zero of=${.TARGET} bs=512 count=16 ${DD} if=${.ALLSRC} of=${.TARGET} bs=512 oseek=1 conv=notrunc boot1.aout: boot1.elf elf2aout -o ${.TARGET} ${.ALLSRC} boot1.o: ${SASRC}/ufsread.c .include Index: head/sys/boot/sparc64/loader/Makefile =================================================================== --- head/sys/boot/sparc64/loader/Makefile (revision 325113) +++ head/sys/boot/sparc64/loader/Makefile (revision 325114) @@ -1,65 +1,67 @@ # $FreeBSD$ -.include +.include MK_SSP= no MAN= PROG?= loader NEWVERSWHAT?= "bootstrap loader" sparc64 VERSION_FILE= ${.CURDIR}/../loader/version INSTALLFLAGS= -b # Architecture-specific loader code SRCS= locore.S main.c metadata.c vers.c LOADER_DISK_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes LOADER_EXT2FS_SUPPORT?= no LOADER_MSDOS_SUPPORT?= no LOADER_ZFS_SUPPORT?= no LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= no LOADER_DEBUG?= no +CFLAGS+=-nostdlib + .if ${LOADER_DEBUG} == "yes" CFLAGS+= -DLOADER_DEBUG .endif .if ${LOADER_ZFS_SUPPORT} == "yes" CFLAGS+= -DLOADER_ZFS_SUPPORT -CFLAGS+= -I${.CURDIR}/../../zfs -CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs -LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a +CFLAGS+= -I${BOOTSRC}/zfs +CFLAGS+= -I${SYSDIR}/cddl/boot/zfs +LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a .endif # Always add MI sources -.include "../../loader.mk" +.include "${BOOTSRC}/loader.mk" CFLAGS+= -I. CLEANFILES+= loader.help LDFLAGS= -static # Open Firmware standalone support library -LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a -CFLAGS+= -I${.CURDIR}/../../ofw/libofw/ +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: ${.CURDIR}/../../forth -.include "${.CURDIR}/../../forth/Makefile.inc" +.PATH: ${BOOTSRC}/forth +.include "${BOOTSRC}/forth/Makefile.inc" FILES+= loader.rc menu.rc .include