bsdinstall avoid subdir depending on parent

When not doing tree walks, it is bad for sub-dirs to depend on
parents.  Move the generation of opt_osname.h to distextract
and have others that need that depend on it.

In usr.sbin/bsdinstall use SUBDIR_DEPEND_ so tree walking still works.

Reviewed by:	obrien
Differential Revision:	https://reviews.freebsd.org/D39742
This commit is contained in:
Simon J. Gerraty 2023-04-20 22:00:40 -07:00
parent 552815b2da
commit 0c3627f44d
4 changed files with 14 additions and 10 deletions

View File

@ -3,19 +3,14 @@
OSNAME?= FreeBSD
SUBDIR= distextract distfetch partedit runconsoles scripts
SUBDIR_PARALLEL=
SUBDIR_DEPEND_distfetch = distextract
SUBDIR_DEPEND_partedit = distextract
SCRIPTS= bsdinstall
MAN= bsdinstall.8
PACKAGE= bsdinstall
GENHDRS= opt_osname.h
SRCS+= ${GENHDRS}
CLEANFILES+= ${GENHDRS}
SCRIPTS+= startbsdinstall
SCRIPTSDIR_startbsdinstall= ${LIBEXECDIR}/bsdinstall
opt_osname.h: .PHONY
if ! grep -q "^#define OSNAME \"${OSNAME}\"$"" ${.TARGET}; then \
echo "#define OSNAME \"${OSNAME}\"" > ${.TARGET}; \
fi
.include <bsd.prog.mk>

View File

@ -2,9 +2,18 @@
BINDIR= ${LIBEXECDIR}/bsdinstall
PROG= distextract
CFLAGS+= -I${SRCTOP}/contrib/bsddialog/lib -I${.OBJDIR}/..
CFLAGS+= -I${SRCTOP}/contrib/bsddialog/lib -I.
LIBADD= archive bsddialog m
SRCS= distextract.c
MAN=
GENHDRS= opt_osname.h
SRCS+= ${GENHDRS}
CLEANFILES+= ${GENHDRS}
opt_osname.h: .PHONY
if ! grep -q "^#define OSNAME \"${OSNAME}\"$"" ${.TARGET}; then \
echo "#define OSNAME \"${OSNAME}\"" > ${.TARGET}; \
fi
.include <bsd.prog.mk>

View File

@ -2,7 +2,7 @@
BINDIR= ${LIBEXECDIR}/bsdinstall
PROG= distfetch
CFLAGS+= -I${SRCTOP}/contrib/bsddialog/lib -I${.OBJDIR}/..
CFLAGS+= -I${SRCTOP}/contrib/bsddialog/lib -I${.OBJDIR}/../distextract
LIBADD= fetch bsddialog
MAN=

View File

@ -5,7 +5,7 @@ PROG= partedit
LINKS= ${BINDIR}/partedit ${BINDIR}/autopart \
${BINDIR}/partedit ${BINDIR}/scriptedpart
SYMLINKS= ../libexec/bsdinstall/partedit /usr/sbin/sade
CFLAGS+= -I${SRCTOP}/contrib/bsddialog/lib -I${.OBJDIR}/..
CFLAGS+= -I${SRCTOP}/contrib/bsddialog/lib -I${.OBJDIR}/../distextract
LIBADD+= geom util bsddialog
PARTEDIT_ARCH= ${MACHINE}