From owner-svn-src-head@freebsd.org Mon Oct 30 23:14:40 2017 Return-Path: Delivered-To: svn-src-head@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 59E94E26277; Mon, 30 Oct 2017 23:14:40 +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 233CF75F8C; Mon, 30 Oct 2017 23:14:40 +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 v9UNEdeU025821; Mon, 30 Oct 2017 23:14:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9UNEbJd025802; Mon, 30 Oct 2017 23:14:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710302314.v9UNEbJd025802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 30 Oct 2017 23:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325171 - in head/sys/boot: i386 i386/boot0 i386/boot2 i386/btx/btx i386/btx/btxldr i386/btx/lib i386/cdboot i386/gptboot i386/gptzfsboot i386/kgzldr i386/libfirewire i386/libi386 i386/... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: i386 i386/boot0 i386/boot2 i386/btx/btx i386/btx/btxldr i386/btx/lib i386/cdboot i386/gptboot i386/gptzfsboot i386/kgzldr i386/libfirewire i386/libi386 i386/loader i386/mbr i386/pmbr... X-SVN-Commit-Revision: 325171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Oct 2017 23:14:40 -0000 Author: imp Date: Mon Oct 30 23:14:37 2017 New Revision: 325171 URL: https://svnweb.freebsd.org/changeset/base/325171 Log: Use defs.mk name and prefer bsd.init.mk Also need to make some small tweaks to the Makefiles to use += rather than = due to small shift in include file order. Sponsored by: Netflix Modified: head/sys/boot/i386/Makefile.inc head/sys/boot/i386/boot0/Makefile head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/btx/btx/Makefile head/sys/boot/i386/btx/btxldr/Makefile head/sys/boot/i386/btx/lib/Makefile head/sys/boot/i386/cdboot/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/kgzldr/Makefile head/sys/boot/i386/libfirewire/Makefile head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/i386/mbr/Makefile head/sys/boot/i386/pmbr/Makefile head/sys/boot/i386/pxeldr/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/i386/zfsloader/Makefile head/sys/boot/libsa32/Makefile Modified: head/sys/boot/i386/Makefile.inc ============================================================================== --- head/sys/boot/i386/Makefile.inc Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/Makefile.inc Mon Oct 30 23:14:37 2017 (r325171) @@ -8,29 +8,28 @@ CFLAGS.gcc+= -mpreferred-stack-boundary=2 CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float LDFLAGS+= -nostdlib -.if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -ACFLAGS+= -m32 -# LD_FLAGS is passed directly to ${LD}, not via ${CC}: -LD_FLAGS+= -m elf_i386_fbsd -AFLAGS+= --32 -.endif - # BTX components -.if exists(${.OBJDIR}/../btx) -BTXDIR= ${.OBJDIR}/../btx -.else -BTXDIR= ${.CURDIR}/../btx -.endif +BTXDIR= ${BOOTOBJ}/i386/btx BTXLDR= ${BTXDIR}/btxldr/btxldr BTXKERN= ${BTXDIR}/btx/btx BTXCRT= ${BTXDIR}/lib/crt0.o +BTXSRC= ${BOOTSRC}/i386/btx +BTXLIB= ${BTXSRC}/lib + # compact binary with no padding between text, data, bss LDSCRIPT= ${BOOTSRC}/i386/boot.ldscript # LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary # LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary LD_FLAGS_BIN=-static -N --gc-sections + +.if ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -m32 +ACFLAGS+= -m32 +# LD_FLAGS is passed directly to ${LD}, not via ${CC}: +LD_FLAGS+= -m elf_i386_fbsd +AFLAGS+= --32 +.endif .include "../Makefile.inc" Modified: head/sys/boot/i386/boot0/Makefile ============================================================================== --- head/sys/boot/i386/boot0/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/boot0/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -75,6 +75,6 @@ CFLAGS+=-DFLAGS=${BOOT_BOOT0_FLAGS} \ -DTICKS=${BOOT_BOOT0_TICKS} \ -DCOMSPEED=${BOOT_BOOT0_COMCONSOLE_SPEED} -LDFLAGS=${LDFLAGS_BIN} +LDFLAGS+=${LDFLAGS_BIN} .include Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/boot2/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include FILES= boot boot1 boot2 @@ -22,7 +22,7 @@ BOOT2_UFS?= UFS1_AND_UFS2 #BOOT2_UFS?= UFS2_ONLY #BOOT2_UFS?= UFS1_ONLY -CFLAGS= -fomit-frame-pointer \ +CFLAGS+=-fomit-frame-pointer \ -mrtd \ -mregparm=3 \ -D${BOOT2_UFS} \ @@ -30,8 +30,8 @@ CFLAGS= -fomit-frame-pointer \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ - -I${.CURDIR}/../../common \ - -I${.CURDIR}/../btx/lib -I. \ + -I${LDRSRC} \ + -I${BTXLIB} -I. \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ @@ -46,11 +46,8 @@ CFLAGS.gcc+= -mno-align-long-strings CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} -LD_FLAGS=${LD_FLAGS_BIN} +LD_FLAGS+=${LD_FLAGS_BIN} -# Pick up ../Makefile.inc early. -.include - CLEANFILES= boot boot: boot1 boot2 @@ -99,7 +96,7 @@ boot2.h: boot1.out .if ${MACHINE_CPUARCH} == "amd64" beforedepend boot2.s: machine CLEANFILES+= machine -machine: ${.CURDIR}/../../../i386/include .NOMETA +machine: ${SYSDIR}/i386/include .NOMETA ln -sf ${.ALLSRC} ${.TARGET} .endif Modified: head/sys/boot/i386/btx/btx/Makefile ============================================================================== --- head/sys/boot/i386/btx/btx/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/btx/btx/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= btx INTERNALPROG= MAN= @@ -12,7 +14,7 @@ BOOT_BTX_FLAGS=0x0 .endif CFLAGS+=-DBTX_FLAGS=${BOOT_BTX_FLAGS} -CFLAGS+=-I${.CURDIR}/../../common +CFLAGS+=-I${BOOTSRC}/i386/common .if defined(BTX_SERIAL) BOOT_COMCONSOLE_PORT?= 0x3f8 @@ -25,7 +27,7 @@ CFLAGS+=-DBTX_SERIAL -DSIOPRT=${BOOT_COMCONSOLE_PORT} ORG= 0x9000 -LDFLAGS=${LDFLAGS_BIN} +LDFLAGS+=${LDFLAGS_BIN} .include Modified: head/sys/boot/i386/btx/btxldr/Makefile ============================================================================== --- head/sys/boot/i386/btx/btxldr/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/btx/btxldr/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -1,19 +1,21 @@ # $FreeBSD$ +.include + PROG= btxldr INTERNALPROG= MAN= SRCS= btxldr.S CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRESS} -CFLAGS+=-I${.CURDIR}/../../common +CFLAGS+=-I${BOOTSRC}/i386/common .if defined(BTXLDR_VERBOSE) CFLAGS+=-DBTXLDR_VERBOSE .endif ORG=${LOADER_ADDRESS} -LDFLAGS=${LDFLAGS_BIN} +LDFLAGS+=${LDFLAGS_BIN} .include Modified: head/sys/boot/i386/btx/lib/Makefile ============================================================================== --- head/sys/boot/i386/btx/lib/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/btx/lib/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -1,10 +1,12 @@ # $FreeBSD$ +.include + PROG= crt0.o INTERNALPROG= MAN= SRCS= btxcsu.S btxsys.s btxv86.s -CFLAGS+=-I${.CURDIR}/../../common -LDFLAGS=-Wl,-r +CFLAGS+=-I${BOOTSRC}/i386/common +LDFLAGS+=-Wl,-r .include Modified: head/sys/boot/i386/cdboot/Makefile ============================================================================== --- head/sys/boot/i386/cdboot/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/cdboot/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -1,16 +1,18 @@ # $FreeBSD$ +.include + PROG= cdboot STRIP= BINMODE=${NOBINMODE} MAN= SRCS= ${PROG}.S -CFLAGS+=-I${.CURDIR}/../common +CFLAGS+=-I${BOOTSRC}/i386/common ORG= 0x7c00 -LDFLAGS=${LDFLAGS_BIN} +LDFLAGS+=${LDFLAGS_BIN} .include Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/gptboot/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -1,8 +1,8 @@ # $FreeBSD$ -.include "../Makefile.inc" +.include -.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${SASRC} +.PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${SASRC} FILES= gptboot MAN= gptboot.8 @@ -29,11 +29,11 @@ CFLAGS+=-DBOOTPROG=\"gptboot\" \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ - -I${.CURDIR}/../../common \ - -I${.CURDIR}/../common \ - -I${.CURDIR}/../btx/lib -I. \ - -I${.CURDIR}/../boot2 \ - -I${.CURDIR}/../../.. \ + -I${LDRSRC} \ + -I${BOOTSRC}/i386/common \ + -I${BTXLIB} -I. \ + -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 \ @@ -44,17 +44,13 @@ CFLAGS.gcc+= --param max-inline-insns-single=100 .if ${LOADER_GELI_SUPPORT:Uyes} == "yes" CFLAGS+= -DLOADER_GELI_SUPPORT CFLAGS+= -I${BOOTSRC}/geli -CFLAGS+= -I${.CURDIR}/../../.. LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a -.PATH: ${.CURDIR}/../../../opencrypto +.PATH: ${SYSDIR}/opencrypto OPENCRYPTO_XTS= xform_aes_xts.o .endif -LD_FLAGS=${LD_FLAGS_BIN} +LD_FLAGS+=${LD_FLAGS_BIN} -# Pick up ../Makefile.inc early. -.include - CLEANFILES= gptboot gptboot: gptldr.bin gptboot.bin ${BTXKERN} @@ -84,7 +80,7 @@ gptboot.o: ${SASRC}/ufsread.c beforedepend gptboot.o: machine CLEANFILES+= machine machine: .NOMETA - ln -sf ${.CURDIR}/../../../i386/include machine + ln -sf ${SYSDIR}/i386/include machine .endif .include Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/gptzfsboot/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -1,10 +1,10 @@ # $FreeBSD$ -.include "../Makefile.inc" +.include -.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../gptboot \ - ${.CURDIR}/../zfsboot ${.CURDIR}/../common \ - ${.CURDIR}/../../../crypto/skein ${SASRC} +.PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \ + ${BOOTSRC}/i386/zfsboot ${BOOTSRC}/i386/common \ + ${SYSDIR}/crypto/skein ${SASRC} FILES= gptzfsboot MAN= gptzfsboot.8 @@ -25,14 +25,14 @@ CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ - -I${.CURDIR}/../../common \ - -I${.CURDIR}/../common \ - -I${.CURDIR}/../../zfs \ - -I${.CURDIR}/../../../cddl/boot/zfs \ - -I${.CURDIR}/../../../crypto/skein \ - -I${.CURDIR}/../btx/lib -I. \ - -I${.CURDIR}/../boot2 \ - -I${.CURDIR}/../../.. \ + -I${LDRSRC} \ + -I${BOOTSRC}/i386/common \ + -I${BOOTSRC}/zfs \ + -I${SYSDIR}/cddl/boot/zfs \ + -I${SYSDIR}/crypto/skein \ + -I${BOOTSRC}/i386/btx/lib -I. \ + -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 \ @@ -52,17 +52,14 @@ CFLAGS+= -DSKEIN_LOOP=111 CFLAGS+= -DLOADER_GELI_SUPPORT CFLAGS+= -I${BOOTSRC}/geli LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a -.PATH: ${.CURDIR}/../../../opencrypto +.PATH: ${SYSDIR}/opencrypto OPENCRYPTO_XTS= xform_aes_xts.o .endif CFLAGS.gcc+= --param max-inline-insns-single=100 -LD_FLAGS=${LD_FLAGS_BIN} +LD_FLAGS+=${LD_FLAGS_BIN} -# Pick up ../Makefile.inc early. -.include - CLEANFILES= gptzfsboot gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN} @@ -87,13 +84,13 @@ gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o skein.o skein_block.o ${OPENCRYPTO_XTS} ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} -zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c +zfsboot.o: ${BOOTSRC}/zfs/zfsimpl.c .if ${MACHINE_CPUARCH} == "amd64" beforedepend zfsboot.o: machine CLEANFILES+= machine machine: .NOMETA - ln -sf ${.CURDIR}/../../../i386/include machine + ln -sf ${SYSDIR}/i386/include machine .endif .include Modified: head/sys/boot/i386/kgzldr/Makefile ============================================================================== --- head/sys/boot/i386/kgzldr/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/kgzldr/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= kgzldr.o STRIP= BINMODE=${LIBMODE} @@ -10,8 +12,8 @@ SRCS= start.s boot.c inflate.c lib.c crt.s sio.s CFLAGS= -Os CFLAGS+=-DKZIP NO_SHARED= -LDFLAGS=-Wl,-r -.PATH: ${.CURDIR}/../../../kern +LDFLAGS+=-Wl,-r +.PATH: ${SYSDIR}/kern BOOT_COMCONSOLE_PORT?= 0x3f8 AFLAGS+=--defsym SIO_PRT=${BOOT_COMCONSOLE_PORT} Modified: head/sys/boot/i386/libfirewire/Makefile ============================================================================== --- head/sys/boot/i386/libfirewire/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/libfirewire/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -1,24 +1,26 @@ # $FreeBSD$ +.include + LIB= firewire INTERNALLIB= -.PATH: ${.CURDIR}/../../../dev/dcons ${.CURDIR}/../../../dev/firewire +.PATH: ${SYSDIR}/dev/dcons ${SYSDIR}/dev/firewire SRCS+= firewire.c fwohci.c dconsole.c SRCS+= dcons.c fwcrom.c CFLAGS+= -D_BOOT -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. -CFLAGS+= -I${.CURDIR}/../btx/lib -CFLAGS+= -I${.CURDIR}/../libi386 +CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${BTXLIB} +CFLAGS+= -I${BOOTSRC}/i386/libi386 CFLAGS+= -Wformat -Wall .if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine machine: .NOMETA - ln -sf ${.CURDIR}/../../../i386/include machine + ln -sf ${SYSDIR}/i386/include machine .endif .include Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/libi386/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -1,7 +1,7 @@ # $FreeBSD$ -# -.include "../../defs.mk" +.include + LIB= i386 INTERNALLIB= @@ -11,7 +11,7 @@ SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp elf64_freebsd.c multiboot.c multiboot_tramp.S relocater_tramp.S \ i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c -.PATH: ${.CURDIR}/../../zfs +.PATH: ${BOOTSRC}/zfs SRCS+= devicename_stubs.c BOOT_COMCONSOLE_PORT?= 0x3f8 @@ -49,11 +49,11 @@ CFLAGS+= -DTERM_EMU # XXX: make alloca() useable CFLAGS+= -Dalloca=__builtin_alloca -CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 \ - -I${.CURDIR}/../../common -I${.CURDIR}/../common \ - -I${.CURDIR}/../btx/lib \ - -I${.CURDIR}/../../../contrib/dev/acpica/include \ - -I${.CURDIR}/../../.. -I. +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. # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} @@ -61,7 +61,7 @@ CFLAGS+= ${FORMAT_EXTENSIONS} .if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine machine: .NOMETA - ln -sf ${.CURDIR}/../../../i386/include machine + ln -sf ${SYSDIR}/i386/include machine .endif .include Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/loader/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -1,6 +1,7 @@ # $FreeBSD$ -.include +.include + MK_SSP= no LOADER?= loader @@ -24,13 +25,13 @@ SRCS= main.c conf.c vers.c chain.c # Put LOADER_FIREWIRE_SUPPORT=yes in /etc/make.conf for FireWire/dcons support .if defined(LOADER_FIREWIRE_SUPPORT) CFLAGS+= -DLOADER_FIREWIRE_SUPPORT -LIBFIREWIRE= ${.OBJDIR}/../libfirewire/libfirewire.a +LIBFIREWIRE= ${BOOTSRC}/i386/libfirewire/libfirewire.a .endif # Set by zfsloader Makefile .if defined(LOADER_ZFS_SUPPORT) CFLAGS+= -DLOADER_ZFS_SUPPORT -LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a +LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a .endif # Include bcache code. @@ -44,34 +45,31 @@ HAVE_ISABUS= yes CFLAGS+= -DLOADER_GELI_SUPPORT CFLAGS+= -I${BOOTSRC}/geli LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a -.PATH: ${.CURDIR}/../../../opencrypto +.PATH: ${SYSDIR}/opencrypto SRCS+= xform_aes_xts.c -CFLAGS+= -I${.CURDIR}/../../.. -D_STAND +CFLAGS+= -I${SYSDIR} -D_STAND .endif # Always add MI sources -.include "../../loader.mk" +.include "${BOOTSRC}/loader.mk" CFLAGS+= -I. CLEANFILES= ${LOADER} ${LOADER}.bin loader.help CFLAGS+= -Wall -LDFLAGS= -static -Ttext 0x0 +LDFLAGS+= -static -Ttext 0x0 # i386 standalone support library -LIBI386= ${.OBJDIR}/../libi386/libi386.a -CFLAGS+= -I${.CURDIR}/.. +LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a +CFLAGS+= -I${BOOTSRC}/i386 # BTX components -CFLAGS+= -I${.CURDIR}/../btx/lib +CFLAGS+= -I${BTXLIB} # Debug me! #CFLAGS+= -g #LDFLAGS+= -g -# Pick up ../Makefile.inc early. -.include - ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ -b ${BTXKERN} ${LOADER}.bin @@ -87,8 +85,8 @@ FILES= ${LOADER} FILESMODE_${LOADER}= ${BINMODE} -b .if !defined(LOADER_ONLY) -.PATH: ${.CURDIR}/../../forth -.include "${.CURDIR}/../../forth/Makefile.inc" +.PATH: ${BOOTSRC}/forth +.include "${BOOTSRC}/forth/Makefile.inc" FILES+= pcibios.4th FILES+= loader.rc menu.rc @@ -114,5 +112,5 @@ beforedepend ${OBJS}: machine CLEANFILES+= machine CFLAGS+= -DLOADER_PREFER_AMD64 machine: .NOMETA - ln -sf ${.CURDIR}/../../../i386/include machine + ln -sf ${SYSDIR}/i386/include machine .endif Modified: head/sys/boot/i386/mbr/Makefile ============================================================================== --- head/sys/boot/i386/mbr/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/mbr/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -12,6 +12,6 @@ BOOT_MBR_FLAGS?= 0x80 ORG= 0x600 AFLAGS+=--defsym FLAGS=${BOOT_MBR_FLAGS} -LDFLAGS=${LDFLAGS_BIN} +LDFLAGS+=${LDFLAGS_BIN} .include Modified: head/sys/boot/i386/pmbr/Makefile ============================================================================== --- head/sys/boot/i386/pmbr/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/pmbr/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -9,6 +9,6 @@ SRCS= ${PROG}.s ORG= 0x600 AFLAGS+=--defsym FLAGS=${BOOT_MBR_FLAGS} -LDFLAGS=${LDFLAGS_BIN} +LDFLAGS+=${LDFLAGS_BIN} .include Modified: head/sys/boot/i386/pxeldr/Makefile ============================================================================== --- head/sys/boot/i386/pxeldr/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/pxeldr/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -1,6 +1,5 @@ # $FreeBSD$ -# Pick up ../Makefile.inc early. .include PROG= ${LDR} @@ -23,9 +22,9 @@ CFLAGS+=-DPROBE_KEYBOARD CFLAGS+=-DALWAYS_SERIAL .endif -CFLAGS+=-I${.CURDIR}/../common +CFLAGS+=-I${BOOTSRC}/i386/common -LOADERBIN= ${.OBJDIR}/../loader/loader.bin +LOADERBIN= ${BOOTOBJ}/i386/loader/loader.bin CLEANFILES+= ${BOOT}.tmp Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/zfsboot/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -2,10 +2,10 @@ LOADER_GELI_SUPPORT=no -.include "../Makefile.inc" +.include -.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common \ - ${.CURDIR}/../../../crypto/skein ${SASRC} +.PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common \ + ${SYSDIR}/crypto/skein ${SASRC} FILES= zfsboot MAN= zfsboot.8 @@ -26,13 +26,14 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ - -I${.CURDIR}/../../common \ - -I${.CURDIR}/../common \ - -I${.CURDIR}/../../zfs \ - -I${.CURDIR}/../../../cddl/boot/zfs \ - -I${.CURDIR}/../../../crypto/skein \ - -I${.CURDIR}/../btx/lib -I. \ - -I${.CURDIR}/../boot2 \ + -I${LDRSRC} \ + -I${BOOTSRC}/i386/common \ + -I${BOOTSRC}/i386 \ + -I${BOOTSRC}/zfs \ + -I${SYSDIR}/cddl/boot/zfs \ + -I${SYSDIR}/crypto/skein \ + -I${BTXLIB} -I. \ + -I${BOOTSRC}/i386/boot2 \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ @@ -42,11 +43,8 @@ CFLAGS.gcc+= --param max-inline-insns-single=100 # Do not unroll skein loops, reduce code size CFLAGS+= -DSKEIN_LOOP=111 -LD_FLAGS=${LD_FLAGS_BIN} +LD_FLAGS+=${LD_FLAGS_BIN} -# Pick up ../Makefile.inc early. -.include - CLEANFILES= zfsboot zfsboot: zfsboot1 zfsboot2 @@ -93,7 +91,7 @@ SRCS= zfsboot.c beforedepend zfsboot.o: machine CLEANFILES+= machine machine: .NOMETA - ln -sf ${.CURDIR}/../../../i386/include machine + ln -sf ${SYSDIR}/i386/include machine .endif .include Modified: head/sys/boot/i386/zfsloader/Makefile ============================================================================== --- head/sys/boot/i386/zfsloader/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/i386/zfsloader/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -1,12 +1,14 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../loader +.include +.PATH: ${BOOTSRC}/i386/loader + LOADER= zfsloader NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 LOADER_ZFS_SUPPORT=yes LOADER_ONLY= yes MAN= -.include "${.CURDIR}/../loader/Makefile" +.include "${BOOTSRC}/i386/loader/Makefile" Modified: head/sys/boot/libsa32/Makefile ============================================================================== --- head/sys/boot/libsa32/Makefile Mon Oct 30 23:14:22 2017 (r325170) +++ head/sys/boot/libsa32/Makefile Mon Oct 30 23:14:37 2017 (r325171) @@ -1,9 +1,7 @@ # $FreeBSD$ -.include +.include -.include "../Makefile.inc" - LIB=sa32 .if ${MACHINE_CPUARCH} == "amd64" LIBSTAND_CPUARCH=i386 @@ -22,5 +20,5 @@ CFLAGS+= -m32 -I. CLEANFILES+= machine beforedepend ${OBJS}: machine machine: .NOMETA - ln -fs ${.CURDIR}/../../i386/include machine + ln -fs ${SYSDIR}/i386/include machine .endif