aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2017-10-30 23:14:37 +0000
committerWarner Losh <imp@FreeBSD.org>2017-10-30 23:14:37 +0000
commit9d9576461bcd2a2c975c3fefeda1865f5faeb408 (patch)
treede258e93718129b49f5231cf0f13c3313f7c0a09
parentc1d8f9bb547346740f2ecdf8211f7b137af19e15 (diff)
downloadsrc-9d9576461bcd2a2c975c3fefeda1865f5faeb408.tar.gz
src-9d9576461bcd2a2c975c3fefeda1865f5faeb408.zip
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
Notes
Notes: svn path=/head/; revision=325171
-rw-r--r--sys/boot/i386/Makefile.inc25
-rw-r--r--sys/boot/i386/boot0/Makefile2
-rw-r--r--sys/boot/i386/boot2/Makefile15
-rw-r--r--sys/boot/i386/btx/btx/Makefile6
-rw-r--r--sys/boot/i386/btx/btxldr/Makefile6
-rw-r--r--sys/boot/i386/btx/lib/Makefile6
-rw-r--r--sys/boot/i386/cdboot/Makefile6
-rw-r--r--sys/boot/i386/gptboot/Makefile24
-rw-r--r--sys/boot/i386/gptzfsboot/Makefile35
-rw-r--r--sys/boot/i386/kgzldr/Makefile6
-rw-r--r--sys/boot/i386/libfirewire/Makefile12
-rw-r--r--sys/boot/i386/libi386/Makefile18
-rw-r--r--sys/boot/i386/loader/Makefile30
-rw-r--r--sys/boot/i386/mbr/Makefile2
-rw-r--r--sys/boot/i386/pmbr/Makefile2
-rw-r--r--sys/boot/i386/pxeldr/Makefile5
-rw-r--r--sys/boot/i386/zfsboot/Makefile28
-rw-r--r--sys/boot/i386/zfsloader/Makefile6
-rw-r--r--sys/boot/libsa32/Makefile6
19 files changed, 118 insertions, 122 deletions
diff --git a/sys/boot/i386/Makefile.inc b/sys/boot/i386/Makefile.inc
index 770a8eda5cf7..da9489ac9707 100644
--- a/sys/boot/i386/Makefile.inc
+++ b/sys/boot/i386/Makefile.inc
@@ -8,24 +8,15 @@ 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
@@ -33,4 +24,12 @@ LDSCRIPT= ${BOOTSRC}/i386/boot.ldscript
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"
diff --git a/sys/boot/i386/boot0/Makefile b/sys/boot/i386/boot0/Makefile
index d0ce8e598c60..39c0072e6638 100644
--- a/sys/boot/i386/boot0/Makefile
+++ b/sys/boot/i386/boot0/Makefile
@@ -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 <bsd.prog.mk>
diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile
index 96946454fbfa..506ea37664e4 100644
--- a/sys/boot/i386/boot2/Makefile
+++ b/sys/boot/i386/boot2/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <bsd.init.mk>
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,10 +46,7 @@ CFLAGS.gcc+= -mno-align-long-strings
CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL}
-LD_FLAGS=${LD_FLAGS_BIN}
-
-# Pick up ../Makefile.inc early.
-.include <bsd.init.mk>
+LD_FLAGS+=${LD_FLAGS_BIN}
CLEANFILES= boot
@@ -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
diff --git a/sys/boot/i386/btx/btx/Makefile b/sys/boot/i386/btx/btx/Makefile
index 11fd9c7d96a6..f42e20d83b33 100644
--- a/sys/boot/i386/btx/btx/Makefile
+++ b/sys/boot/i386/btx/btx/Makefile
@@ -1,5 +1,7 @@
# $FreeBSD$
+.include <bsd.init.mk>
+
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 <bsd.prog.mk>
diff --git a/sys/boot/i386/btx/btxldr/Makefile b/sys/boot/i386/btx/btxldr/Makefile
index c785b60ffeb1..32795975b7ad 100644
--- a/sys/boot/i386/btx/btxldr/Makefile
+++ b/sys/boot/i386/btx/btxldr/Makefile
@@ -1,19 +1,21 @@
# $FreeBSD$
+.include <bsd.init.mk>
+
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 <bsd.prog.mk>
diff --git a/sys/boot/i386/btx/lib/Makefile b/sys/boot/i386/btx/lib/Makefile
index c66f0fcc5169..8de62555c9dc 100644
--- a/sys/boot/i386/btx/lib/Makefile
+++ b/sys/boot/i386/btx/lib/Makefile
@@ -1,10 +1,12 @@
# $FreeBSD$
+.include <bsd.init.mk>
+
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 <bsd.prog.mk>
diff --git a/sys/boot/i386/cdboot/Makefile b/sys/boot/i386/cdboot/Makefile
index e2fec39d0e1f..7acd4046d816 100644
--- a/sys/boot/i386/cdboot/Makefile
+++ b/sys/boot/i386/cdboot/Makefile
@@ -1,16 +1,18 @@
# $FreeBSD$
+.include <bsd.init.mk>
+
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 <bsd.prog.mk>
diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile
index 6795c7cc8d3b..2b2d2650d43b 100644
--- a/sys/boot/i386/gptboot/Makefile
+++ b/sys/boot/i386/gptboot/Makefile
@@ -1,8 +1,8 @@
# $FreeBSD$
-.include "../Makefile.inc"
+.include <bsd.init.mk>
-.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,16 +44,12 @@ 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}
-
-# Pick up ../Makefile.inc early.
-.include <bsd.init.mk>
+LD_FLAGS+=${LD_FLAGS_BIN}
CLEANFILES= gptboot
@@ -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 <bsd.prog.mk>
diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot/Makefile
index 08017b2e24c6..c2bd133211b2 100644
--- a/sys/boot/i386/gptzfsboot/Makefile
+++ b/sys/boot/i386/gptzfsboot/Makefile
@@ -1,10 +1,10 @@
# $FreeBSD$
-.include "../Makefile.inc"
+.include <bsd.init.mk>
-.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,16 +52,13 @@ 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}
-
-# Pick up ../Makefile.inc early.
-.include <bsd.init.mk>
+LD_FLAGS+=${LD_FLAGS_BIN}
CLEANFILES= gptzfsboot
@@ -87,13 +84,13 @@ gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.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 <bsd.prog.mk>
diff --git a/sys/boot/i386/kgzldr/Makefile b/sys/boot/i386/kgzldr/Makefile
index f396ae90a0f4..5a03b83e5e49 100644
--- a/sys/boot/i386/kgzldr/Makefile
+++ b/sys/boot/i386/kgzldr/Makefile
@@ -1,5 +1,7 @@
# $FreeBSD$
+.include <bsd.init.mk>
+
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}
diff --git a/sys/boot/i386/libfirewire/Makefile b/sys/boot/i386/libfirewire/Makefile
index 5b905715c66e..758b850a146b 100644
--- a/sys/boot/i386/libfirewire/Makefile
+++ b/sys/boot/i386/libfirewire/Makefile
@@ -1,24 +1,26 @@
# $FreeBSD$
+.include <bsd.init.mk>
+
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 <bsd.lib.mk>
diff --git a/sys/boot/i386/libi386/Makefile b/sys/boot/i386/libi386/Makefile
index b29808f37c35..8c89afd7a1e4 100644
--- a/sys/boot/i386/libi386/Makefile
+++ b/sys/boot/i386/libi386/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-#
-.include "../../defs.mk"
+
+.include <bsd.init.mk>
LIB= i386
INTERNALLIB=
@@ -11,7 +11,7 @@ SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp.c \
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 <bsd.lib.mk>
diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile
index a602648dc648..65e772148372 100644
--- a/sys/boot/i386/loader/Makefile
+++ b/sys/boot/i386/loader/Makefile
@@ -1,6 +1,7 @@
# $FreeBSD$
-.include <src.opts.mk>
+.include <bsd.init.mk>
+
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 <bsd.init.mk>
-
${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
diff --git a/sys/boot/i386/mbr/Makefile b/sys/boot/i386/mbr/Makefile
index ac10723059f6..9bfa0bd38fa0 100644
--- a/sys/boot/i386/mbr/Makefile
+++ b/sys/boot/i386/mbr/Makefile
@@ -12,6 +12,6 @@ BOOT_MBR_FLAGS?= 0x80
ORG= 0x600
AFLAGS+=--defsym FLAGS=${BOOT_MBR_FLAGS}
-LDFLAGS=${LDFLAGS_BIN}
+LDFLAGS+=${LDFLAGS_BIN}
.include <bsd.prog.mk>
diff --git a/sys/boot/i386/pmbr/Makefile b/sys/boot/i386/pmbr/Makefile
index 243167a2177f..1bfe0ee11ab2 100644
--- a/sys/boot/i386/pmbr/Makefile
+++ b/sys/boot/i386/pmbr/Makefile
@@ -9,6 +9,6 @@ SRCS= ${PROG}.s
ORG= 0x600
AFLAGS+=--defsym FLAGS=${BOOT_MBR_FLAGS}
-LDFLAGS=${LDFLAGS_BIN}
+LDFLAGS+=${LDFLAGS_BIN}
.include <bsd.prog.mk>
diff --git a/sys/boot/i386/pxeldr/Makefile b/sys/boot/i386/pxeldr/Makefile
index fea62a5aaa4e..57931a5206cd 100644
--- a/sys/boot/i386/pxeldr/Makefile
+++ b/sys/boot/i386/pxeldr/Makefile
@@ -1,6 +1,5 @@
# $FreeBSD$
-# Pick up ../Makefile.inc early.
.include <bsd.init.mk>
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
diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makefile
index 6fd2fe433f01..0d424d5514c8 100644
--- a/sys/boot/i386/zfsboot/Makefile
+++ b/sys/boot/i386/zfsboot/Makefile
@@ -2,10 +2,10 @@
LOADER_GELI_SUPPORT=no
-.include "../Makefile.inc"
+.include <bsd.init.mk>
-.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,10 +43,7 @@ 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}
-
-# Pick up ../Makefile.inc early.
-.include <bsd.init.mk>
+LD_FLAGS+=${LD_FLAGS_BIN}
CLEANFILES= zfsboot
@@ -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 <bsd.prog.mk>
diff --git a/sys/boot/i386/zfsloader/Makefile b/sys/boot/i386/zfsloader/Makefile
index 1825367363d6..33f1d4a0257e 100644
--- a/sys/boot/i386/zfsloader/Makefile
+++ b/sys/boot/i386/zfsloader/Makefile
@@ -1,6 +1,8 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../loader
+.include <bsd.init.mk>
+
+.PATH: ${BOOTSRC}/i386/loader
LOADER= zfsloader
NEWVERSWHAT= "ZFS enabled bootstrap loader" x86
@@ -8,5 +10,5 @@ LOADER_ZFS_SUPPORT=yes
LOADER_ONLY= yes
MAN=
-.include "${.CURDIR}/../loader/Makefile"
+.include "${BOOTSRC}/i386/loader/Makefile"
diff --git a/sys/boot/libsa32/Makefile b/sys/boot/libsa32/Makefile
index 69c0374fdb37..f62b6d1d86ea 100644
--- a/sys/boot/libsa32/Makefile
+++ b/sys/boot/libsa32/Makefile
@@ -1,8 +1,6 @@
# $FreeBSD$
-.include <src.opts.mk>
-
-.include "../Makefile.inc"
+.include <bsd.init.mk>
LIB=sa32
.if ${MACHINE_CPUARCH} == "amd64"
@@ -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