Cleanup non-arch Makefiles

Use SYSDIR, BOOTSRC, LDRSRC and FDTSRC in preference to relative
paths. Also, use bsd.init.mk where needed.

Sponsored by: Netflix
This commit is contained in:
Warner Losh 2017-10-29 05:27:22 +00:00
parent f08693930b
commit 05c2ec42c6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=325094
8 changed files with 26 additions and 23 deletions

View File

@ -14,7 +14,7 @@ SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c \
# Loader's fdt commands extension sources.
SRCS+= fdt_loader_cmd.c fdt_overlay.c
CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${BOOTSRC}/common/
CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC}
CFLAGS+= -ffreestanding

View File

@ -38,7 +38,7 @@ beforedepend ${OBJS}: machine
.endif
machine: .NOMETA
ln -sf ${.CURDIR}/../../i386/include machine
ln -sf ${SYSDIR}/i386/include machine
CLEANFILES+= machine
.endif

View File

@ -1,7 +1,8 @@
# $FreeBSD$
#
.include "../ficl.mk"
.include <bsd.init.mk>
.include "${BOOTSRC}/ficl.mk"
BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \
prefix.c search.c stack.c tools.c vm.c words.c

View File

@ -40,7 +40,7 @@ SRCS+= md5c.c
# AES implementation from sys/crypto
.PATH: ${SYSDIR}/crypto/rijndael
CFLAGS+= -I${SYSDIR}
CFLAGS+= -I${.CURDIR}/../common/
CFLAGS+= -I${LDRSRC}
# Remove asserts
CFLAGS+= -DNDEBUG
SRCS+= rijndael-alg-fst.c rijndael-api-fst.c rijndael-api.c

View File

@ -6,11 +6,11 @@ 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: ${.CURDIR}/../../zfs
.PATH: ${BOOTSRC}/zfs
SRCS+= devicename_stubs.c
# Pick up the bootstrap header for some interface items
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I.
CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I.
CFLAGS+= -ffreestanding
.if ${MACHINE_CPUARCH} == "powerpc"
@ -24,7 +24,7 @@ CFLAGS+= -DDISK_DEBUG
.endif
machine: .NOMETA
ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine
ln -sf ${SYSDIR}/${MACHINE_CPUARCH}/include machine
CLEANFILES+= machine

View File

@ -1,8 +1,8 @@
# $FreeBSD$
.include <src.opts.mk>
.include <bsd.init.mk>
.PATH: ${.CURDIR}/../../common
.PATH: ${LDRSRC}
LIB= uboot_fdt
INTERNALLIB=
@ -13,16 +13,16 @@ SRCS= uboot_fdt.c
CFLAGS+= -ffreestanding -msoft-float
# U-Boot library headers
CFLAGS+= -I${.CURDIR}/../lib
CFLAGS+= -I${UBOOTSRC}/lib
# libfdt headers
CFLAGS+= -I${.CURDIR}/../../fdt
CFLAGS+= -I${FDTSRC}
# Pick up the bootstrap header for some interface items
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I.
CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I.
machine: .NOMETA
ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine
ln -sf ${SYSDIR}/${MACHINE_CPUARCH}/include machine
CLEANFILES+= machine

View File

@ -1,8 +1,8 @@
# $FreeBSD$
.include <src.opts.mk>
.include <bsd.init.mk>
.PATH: ${.CURDIR}/../../common
.PATH: ${LDRSRC}
LIB= uboot
INTERNALLIB=
@ -24,14 +24,14 @@ LOADER_FDT_SUPPORT= no
.endif
.if ${LOADER_FDT_SUPPORT} == "yes"
CFLAGS+= -DLOADER_FDT_SUPPORT -I${.CURDIR}/../../fdt
CFLAGS+= -DLOADER_FDT_SUPPORT -I${FDTSRC}
.endif
# Pick up FDT includes
CFLAGS+= -I${SYSDIR}/contrib/libfdt/
# Pick up the bootstrap header for some interface items
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I.
CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I.
.ifdef(BOOT_DISK_DEBUG)
# Make the disk code more talkative
@ -39,7 +39,7 @@ CFLAGS+= -DDISK_DEBUG
.endif
machine: .NOMETA
ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine
ln -sf ${SYSDIR}/${MACHINE_CPUARCH}/include machine
CLEANFILES+= machine

View File

@ -1,5 +1,7 @@
# $FreeBSD$
.include <bsd.init.mk>
LIB= zfsboot
INTERNALLIB=
@ -8,12 +10,12 @@ SRCS+= zfs.c
SRCS+= skein.c skein_block.c
# Do not unroll skein loops, reduce code size
CFLAGS+= -DSKEIN_LOOP=111
.PATH: ${.CURDIR}/../../crypto/skein
.PATH: ${SYSDIR}/crypto/skein
CFLAGS+= -DBOOTPROG=\"zfsloader\"
CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../.. -I.
CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs
CFLAGS+= -I${.CURDIR}/../../crypto/skein
CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I.
CFLAGS+= -I${SYSDIR}/cddl/boot/zfs
CFLAGS+= -I${SYSDIR}/crypto/skein
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -march=i386
@ -27,7 +29,7 @@ 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.stand.mk>