diff --git a/stand/Makefile b/stand/Makefile index 8fd981cd21f1..1597f6832c07 100644 --- a/stand/Makefile +++ b/stand/Makefile @@ -1,94 +1,96 @@ # $FreeBSD$ .include # For amd64 we have to build 32 and 64 bit versions of things. For # others we don't. LIB32LIST is a list of libraries, which if # included, need to be built 32-bit as well. .if ${MACHINE_ARCH} == "amd64" LIB32LIST=libsa .if ${MK_FORTH} != "no" LIB32LIST+= ficl .endif .if ${MK_LOADER_LUA} != "no" LIB32LIST+= liblua .endif .endif S.yes+= libsa S.${MK_LOADER_OFW}+= libofw S.${MK_FDT}+= fdt S.${MK_FORTH}+= ficl S.${MK_FORTH}+= forth S.${MK_LOADER_LUA}+= liblua S.${MK_LOADER_LUA}+= lua S.yes+= defaults S.yes+= fonts S.yes+= images S.yes+= man .if ${MK_FORTH} != "no" INTERP_DEPENDS+= forth .endif .if ${MK_LOADER_LUA} != "no" INTERP_DEPENDS+= lua .endif .include S.${MK_EFI}+= efi .if ${MK_FDT} != "no" S.${MK_LOADER_KBOOT}+= kboot .endif S.${MK_LOADER_UBOOT}+= uboot .if defined(LIB32LIST) LIB32DEPENDS= ${LIB32LIST:S/$/32/} .endif .if exists(${.CURDIR}/${MACHINE}/.) S.yes+= ${MACHINE} SUBDIR_DEPEND_${MACHINE}+= ${INTERP_DEPENDS} .if ${MK_FDT} != "no" SUBDIR_DEPEND_${MACHINE}+= fdt .endif .if ${MK_LOADER_UBOOT} != "no" SUBDIR_DEPEND_${MACHINE}+= uboot .endif .if ${MK_LOADER_OFW} != "no" SUBDIR_DEPEND_${MACHINE}+= libofw .endif .endif # Build the actual subdir list from S.yes, adding in the 32-bit # variant if necessary. .for _x in ${S.yes} SUBDIR+=${_x} .if defined(LIB32LIST) && ${LIB32LIST:M${_x}} SUBDIR+=${_x}32 .endif .if ${_x} != "libsa" SUBDIR_DEPEND_${_x}+= libsa SUBDIR_DEPEND_${_x}32+= libsa32 .endif .endfor # Remaining dependencies SUBDIR_DEPEND_forth+= ficl SUBDIR_DEPEND_lua+= liblua SUBDIR_DEPEND_efi+= ${INTERP_DEPENDS} +SUBDIR_DEPEND_kboot+= ${INTERP_DEPENDS} .if ${MK_FDT} != "no" SUBDIR_DEPEND_efi+= fdt +SUBDIR_DEPEND_kboot+= fdt .endif SUBDIR_DEPEND_uboot+= ${INTERP_DEPENDS} .if ${MK_FDT} != "no" SUBDIR_DEPEND_uboot+= fdt .endif SUBDIR_PARALLEL= yes .include diff --git a/stand/kboot/Makefile b/stand/kboot/Makefile index 46bcc3d0e63a..aa5511d915a9 100644 --- a/stand/kboot/Makefile +++ b/stand/kboot/Makefile @@ -1,46 +1,39 @@ # $FreeBSD$ 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_BZIP2_SUPPORT?= no .include PROG= loader.kboot NEWVERSWHAT= "kboot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b # Architecture-specific loader code -SRCS= conf.c vers.c main.c ppc64_elf_freebsd.c -SRCS+= host_syscall.S hostcons.c hostdisk.c kerneltramp.S kbootfdt.c -SRCS+= ucmpdi2.c gfx_fb_stub.c +SRCS= vers.c main.c hostcons.c hostdisk.c kbootfdt.c gfx_fb_stub.c CFLAGS.gfx_fb_stub.c += -I${SRCTOP}/contrib/pnglite -I${SRCTOP}/sys/teken .include "${BOOTSRC}/fdt.mk" -CFLAGS+= -mcpu=powerpc64 +.PATH: ${.CURDIR}/arch/${MACHINE_ARCH} +.include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc" # Always add MI sources .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern +CFLAGS+= -I${.CURDIR} -I${.CURDIR}/arch/${MACHINE_ARCH} -CFLAGS+= -Wall -DAIM -# load address. set in linker script -RELOC?= 0x0 -CFLAGS+= -DRELOC=${RELOC} - -LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc +CFLAGS+= -Wall DPADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LDR_INTERP} ${LIBOFW} ${LIBFDT} ${LIBSA} -MK_PIE= no - .include diff --git a/stand/kboot/arch/powerpc64/Makefile.inc b/stand/kboot/arch/powerpc64/Makefile.inc new file mode 100644 index 000000000000..3c2fb6e18a16 --- /dev/null +++ b/stand/kboot/arch/powerpc64/Makefile.inc @@ -0,0 +1,14 @@ +CFLAGS+= -mcpu=powerpc64 + +SRCS+= conf.c ppc64_elf_freebsd.c host_syscall.S kerneltramp.S +SRCS+= ucmpdi2.c + +# load address. set in linker script +RELOC?= 0x0 +CFLAGS+= -DRELOC=${RELOC} + +LDFLAGS= -nostdlib -static -T ${.CURDIR}/arch/${MACHINE_ARCH}/ldscript.powerpc + +MK_PIE= no +# Maybe bogus? +CFLAGS+= -DAIM diff --git a/stand/kboot/conf.c b/stand/kboot/arch/powerpc64/conf.c similarity index 100% rename from stand/kboot/conf.c rename to stand/kboot/arch/powerpc64/conf.c diff --git a/stand/kboot/host_syscall.S b/stand/kboot/arch/powerpc64/host_syscall.S similarity index 100% rename from stand/kboot/host_syscall.S rename to stand/kboot/arch/powerpc64/host_syscall.S diff --git a/stand/kboot/kerneltramp.S b/stand/kboot/arch/powerpc64/kerneltramp.S similarity index 100% rename from stand/kboot/kerneltramp.S rename to stand/kboot/arch/powerpc64/kerneltramp.S diff --git a/stand/kboot/ldscript.powerpc b/stand/kboot/arch/powerpc64/ldscript.powerpc similarity index 100% rename from stand/kboot/ldscript.powerpc rename to stand/kboot/arch/powerpc64/ldscript.powerpc diff --git a/stand/kboot/ppc64_elf_freebsd.c b/stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c similarity index 100% rename from stand/kboot/ppc64_elf_freebsd.c rename to stand/kboot/arch/powerpc64/ppc64_elf_freebsd.c