From owner-svn-src-all@freebsd.org Mon Oct 16 03:59:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65F50E2CEB7; Mon, 16 Oct 2017 03:59:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C1076ADC3; Mon, 16 Oct 2017 03:59:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9G3xk6R087934; Mon, 16 Oct 2017 03:59:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9G3xiD1087916; Mon, 16 Oct 2017 03:59:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710160359.v9G3xiD1087916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Oct 2017 03:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324652 - in head/sys/boot: . arm/uboot efi/boot1 efi/libefi efi/loader i386/loader mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc64/loader userbo... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . arm/uboot efi/boot1 efi/libefi efi/loader i386/loader mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc64/loader userboot/userboot X-SVN-Commit-Revision: 324652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 03:59:47 -0000 Author: imp Date: Mon Oct 16 03:59:44 2017 New Revision: 324652 URL: https://svnweb.freebsd.org/changeset/base/324652 Log: Move all the ficl common code into ficl.mk There's a number of copies of basically identical code to enable building forth in /boot/loader. Move it all into ficl.mk. Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/defs.mk head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/ficl.mk head/sys/boot/i386/loader/Makefile head/sys/boot/loader.mk head/sys/boot/mips/beri/loader/Makefile head/sys/boot/mips/uboot/Makefile head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/sparc64/loader/Makefile head/sys/boot/userboot/userboot/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/arm/uboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -81,14 +81,6 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt. LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/arm -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - # Always add MI sources .include "../../loader.mk" CFLAGS+= -I. Modified: head/sys/boot/defs.mk ============================================================================== --- head/sys/boot/defs.mk Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/defs.mk Mon Oct 16 03:59:44 2017 (r324652) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .if !defined(__BOOT_DEFS_MK__) __BOOT_DEFS_MK__=${MFILE} @@ -9,9 +11,12 @@ LDR_MI= ${BOOTDIR}/common SASRC= ${SRCTOP}/sys/boot/libsa SYSDIR= ${SRCTOP}/sys -# Normal Standalone library +# NB: The makefiles depend on these being empty when we don't build forth. +.if ${MK_FORTH} != "no" +LIBFICL= ${OBJTOP}/sys/boot/ficl/libficl.a +LIBFICL32= ${OBJTOP}/sys/boot/ficl32/libficl.a +.endif LIBSA= ${OBJTOP}/sys/boot/libsa/libsa.a -# Standalone library compiled for 32-bit version of the processor LIBSA32= ${OBJTOP}/sys/boot/libsa32/libsa32.a .endif # __BOOT_DEFS_MK__ Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/efi/boot1/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -5,6 +5,7 @@ MAN= .include "../Makefile.inc" MK_SSP= no +MK_FORTH= no PROG= boot1.sym INTERNALPROG= Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/efi/libefi/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -3,7 +3,6 @@ .include .if ${MK_FORTH} != "no" -CFLAGS+= -DBOOT_FORTH .include "../../ficl.mk" .endif Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/efi/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -78,14 +78,6 @@ CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID .endif .endif -.if ${MK_FORTH} != "no" -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -CFLAGS+= -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_CPUARCH} -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - LOADER_FDT_SUPPORT?= no .if ${MK_FDT} != "no" && ${LOADER_FDT_SUPPORT} != "no" CFLAGS+= -I${.CURDIR}/../../fdt Modified: head/sys/boot/ficl.mk ============================================================================== --- head/sys/boot/ficl.mk Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/ficl.mk Mon Oct 16 03:59:44 2017 (r324652) @@ -27,6 +27,8 @@ CFLAGS+= -m32 -mcpu=powerpc -I. .endif CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} -I${LDR_MI} +CFLAGS+= -DBOOT_FORTH +CFLAGS+= -DBF_DICTSIZE=15000 .if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) .if !exists(machine) Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/i386/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -42,17 +42,6 @@ HAVE_BCACHE= yes HAVE_PNP= yes HAVE_ISABUS= yes -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 -.if ${MACHINE_CPUARCH} == "amd64" -LIBFICL= ${.OBJDIR}/../../ficl32/libficl.a -.else -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif -.endif - .if defined(LOADER_BZIP2_SUPPORT) CFLAGS+= -DLOADER_BZIP2_SUPPORT .endif @@ -119,8 +108,15 @@ FILES+= loader.rc menu.rc # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} -DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} -LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} +# XXX not happy with this construct, revisit +.if ${MACHINE_CPUARCH} == "amd64" +FICL= ${LIBFICL32} +.else +FICL= ${LIBFICL} +.endif + +DPADD= ${FICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} +LDADD= ${FICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} .include Modified: head/sys/boot/loader.mk ============================================================================== --- head/sys/boot/loader.mk Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/loader.mk Mon Oct 16 03:59:44 2017 (r324652) @@ -64,7 +64,7 @@ SRCS+= pnp.c .endif # Forth interpreter -.if defined(BOOT_FORTH) +.if ${MK_FORTH} != "no" SRCS+= interp_forth.c .include "${BOOTDIR}/ficl.mk" .endif Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/mips/beri/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -68,14 +68,6 @@ CFLAGS+= -DLOADER_BZIP2_SUPPORT #CFLAGS+= -DLOADER_NFS_SUPPORT #CFLAGS+= -DLOADER_TFTP_SUPPORT -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../../ficl -CFLAGS+= -I${.CURDIR}/../../../ficl/mips64 -LIBFICL= ${.OBJDIR}/../../../ficl/libficl.a -.endif - # Always add MI sources .include "../../../loader.mk" Modified: head/sys/boot/mips/uboot/Makefile ============================================================================== --- head/sys/boot/mips/uboot/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/mips/uboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -81,18 +81,6 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt. LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -.if ${MACHINE_ARCH:Mmips64*} != "" -CFLAGS+= -I${.CURDIR}/../../ficl/mips64 -.else -CFLAGS+= -I${.CURDIR}/../../ficl/mips -.endif -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - # Always add MI sources .include "../../loader.mk" CFLAGS+= -I. Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/powerpc/kboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -60,15 +60,6 @@ CFLAGS+= -DLOADER_FDT_SUPPORT LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif - -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/powerpc -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - CFLAGS+= -mcpu=powerpc64 # Always add MI sources Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/powerpc/ofw/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -60,16 +60,9 @@ CFLAGS+= -DLOADER_FDT_SUPPORT LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/powerpc -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - # Always add MI sources .include "../../loader.mk" + .PATH: ${.CURDIR}/../../../libkern CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I. Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/powerpc/ps3/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -61,14 +61,6 @@ LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/powerpc -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - CFLAGS+= -mcpu=powerpc64 # Always add MI sources Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/powerpc/uboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -66,14 +66,6 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt. LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/powerpc -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - # Always add MI sources .include "../../loader.mk" .PATH: ${.CURDIR}/../../../libkern Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -57,14 +57,6 @@ CFLAGS+= -DLOADER_NFS_SUPPORT CFLAGS+= -DLOADER_TFTP_SUPPORT .endif -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/sparc64 -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - # Always add MI sources .include "../../loader.mk" CFLAGS+= -I. Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/userboot/userboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -39,14 +39,6 @@ LDFLAGS+= -nostdlib -Wl,-Bsymbolic NEWVERSWHAT= "User boot" ${MACHINE_CPUARCH} -.if ${MK_FORTH} != "no" -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/i386 -CFLAGS+= -DBF_DICTSIZE=15000 -LIBFICL= ${.OBJDIR}/../ficl/libficl.a -.endif - .if ${MK_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a