Allow building makefs(8) from another Makefile (such as one in

a seperate directory hierarchy used to build tools). This boils
down to replacing the use of ${.CURDIR} with either ${SRCDIR}
or ${SRCTOP}. SRCDIR is defined as the directory in which the
Makefile lives that bmake(1) is currently reading. Use SRCTOP
when reaching outside of makefs's directory.
This commit is contained in:
Marcel Moolenaar 2016-10-25 16:21:38 +00:00
parent 6a9f23793d
commit 46783b12e3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=307923
3 changed files with 15 additions and 13 deletions

View File

@ -1,10 +1,12 @@
# $FreeBSD$
SRCDIR:=${.PARSEDIR:tA}
.include <src.opts.mk>
PROG= makefs
CFLAGS+=-I${.CURDIR}
CFLAGS+=-I${SRCDIR}
SRCS= cd9660.c ffs.c \
makefs.c \
@ -14,24 +16,24 @@ MAN= makefs.8
WARNS?= 2
.include "${.CURDIR}/cd9660/Makefile.inc"
.include "${.CURDIR}/ffs/Makefile.inc"
.include "${SRCDIR}/cd9660/Makefile.inc"
.include "${SRCDIR}/ffs/Makefile.inc"
CFLAGS+=-DHAVE_STRUCT_STAT_ST_FLAGS=1
CFLAGS+=-DHAVE_STRUCT_STAT_ST_GEN=1
.PATH: ${.CURDIR}/../../contrib/mtree
CFLAGS+=-I${.CURDIR}/../../contrib/mtree
.PATH: ${SRCTOP}/contrib/mtree
CFLAGS+=-I${SRCTOP}/contrib/mtree
SRCS+= getid.c misc.c spec.c
.PATH: ${.CURDIR}/../../contrib/mknod
CFLAGS+=-I${.CURDIR}/../../contrib/mknod
.PATH: ${SRCTOP}/contrib/mknod
CFLAGS+=-I${SRCTOP}/contrib/mknod
SRCS+= pack_dev.c
.PATH: ${.CURDIR}/../../sys/ufs/ffs
.PATH: ${SRCTOP}/sys/ufs/ffs
SRCS+= ffs_tables.c
CFLAGS+= -I${.CURDIR}/../../lib/libnetbsd
CFLAGS+= -I${SRCTOP}/lib/libnetbsd
LIBADD= netbsd util sbuf
.if ${MK_TESTS} != "no"

View File

@ -1,9 +1,9 @@
# $FreeBSD$
#
.PATH: ${.CURDIR}/cd9660 ${.CURDIR}/../../sys/fs/cd9660/
.PATH: ${SRCDIR}/cd9660 ${SRCTOP}/sys/fs/cd9660/
CFLAGS+=-I${.CURDIR}/../../sys/fs/cd9660/
CFLAGS+=-I${SRCTOP}/sys/fs/cd9660/
SRCS+= cd9660_strings.c cd9660_debug.c cd9660_eltorito.c \
cd9660_write.c cd9660_conversion.c iso9660_rrip.c cd9660_archimedes.c

View File

@ -1,9 +1,9 @@
# $FreeBSD$
#
.PATH: ${.CURDIR}/ffs ${.CURDIR}/../../sys/ufs/ffs
.PATH: ${SRCDIR}/ffs ${SRCTOP}/sys/ufs/ffs
CFLAGS+= -I${.CURDIR}/../../sys/ufs/ffs
CFLAGS+= -I${SRCTOP}/sys/ufs/ffs
SRCS+= ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c ufs_bmap.c
SRCS+= buf.c mkfs.c