Skip to content

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
laffer1 committed Nov 10, 2024
1 parent 11d3cfc commit ba774ff
Show file tree
Hide file tree
Showing 92 changed files with 4,322 additions and 2,962 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,12 @@ META_TGT_WHITELIST+= \
.ORDER: buildkernel reinstallkernel
.ORDER: buildkernel reinstallkernel.debug

# Only sanitize PATH on FreeBSD.
# PATH may include tools that are required to cross-build
# on non-FreeBSD systems.
.if ${.MAKE.OS} == "FreeBSD"
PATH= /sbin:/bin:/usr/sbin:/usr/bin
.endif
MAKEOBJDIRPREFIX?= /usr/obj
_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} MK_AUTO_OBJ=no \
${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \
Expand Down Expand Up @@ -277,6 +282,7 @@ MK_META_MODE= no
.endif # defined(MK_META_MODE) && ${MK_META_MODE} == yes

# Guess target architecture from target type, and vice versa, based on
# historic FreeBSD practice of tending to have TARGET == TARGET_ARCH
# expanding to TARGET == TARGET_CPUARCH in recent times, with known
# exceptions.
.if !defined(TARGET_ARCH) && defined(TARGET)
Expand Down
836 changes: 518 additions & 318 deletions Makefile.inc1

Large diffs are not rendered by default.

122 changes: 41 additions & 81 deletions etc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,8 @@ UPDATE_DEPENDFILE= no
SUBDIR+=sendmail
.endif

BIN1= \
dhcp6c.conf \
doas.conf \
group \
login.access \
rc.bsdextended \
rc.firewall \
termcap.small

# NB: keep these sorted by MK_* knobs


ETCMAIL=aliases
.if ${MK_SENDMAIL} != "no"
ETCMAIL+=Makefile README access.sample virtusertable.sample \
Expand Down Expand Up @@ -60,23 +50,6 @@ distribution:
.if !defined(DESTDIR)
@echo "set DESTDIR before running \"make ${.TARGET}\""
@false
.endif
cd ${.CURDIR}; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
${BIN1} ${DESTDIR}/etc; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
master.passwd ${DESTDIR}/etc;

.if ${MK_TCSH} == "no"
sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
.endif
pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
.if defined(NO_ROOT)
( \
echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
) | ${METALOG.add}
.endif
${_+_}cd ${.CURDIR}/gss; ${MAKE} install
${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
Expand All @@ -86,7 +59,8 @@ distribution:
${DESTDIR}/etc/os-release
.if ${MK_UNBOUND} != "no"
if [ ! -e ${DESTDIR}/etc/unbound ]; then \
${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
${INSTALL_SYMLINK} -T "package=unbound" \
../var/unbound ${DESTDIR}/etc/unbound; \
fi
.endif
.if ${MK_SENDMAIL} != "no"
Expand All @@ -95,32 +69,30 @@ distribution:
.if ${MK_KERBEROS} != "no"
cd ${.CURDIR}/root; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
-T "package=runtime" \
dot.k5login ${DESTDIR}/root/.k5login;
.endif

.if ${MK_MAIL} != "no"
cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
${ETCMAIL} ${DESTDIR}/etc/mail
-T "package=sendmail" ${ETCMAIL} ${DESTDIR}/etc/mail
if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
! -f ${DESTDIR}/etc/aliases ]; then \
${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \
${INSTALL_SYMLINK} -T "package=sendmail" \
mail/aliases ${DESTDIR}/etc/aliases; \
fi
.endif
.if ${MK_LOCATE} != "no"
${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
${DESTDIR}/var/db/locate.database
.endif
cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
${MIDNIGHTBSD} ${DESTDIR}/
-T "package=runtime" ${FREEBSD} ${DESTDIR}/
.if ${MK_BOOT} != "no"
.if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
-T "package=bootloader,config" \
${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
${DESTDIR}/boot/device.hints
.endif
.endif

MTREE_CMD?= mtree

MTREES= mtree/BSD.root.dist / \
mtree/BSD.var.dist /var \
mtree/BSD.usr.dist /usr \
Expand All @@ -145,62 +117,50 @@ MTREES+= mtree/BSD.sendmail.dist /
MTREES+= ../${mtree} /
.endfor

# Clean up some directories that where mistakenly created as files that
# should not have been as part of the nvi update in r281994.
# This should be removed after 11.0-RELEASE.
DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
# Clean up files that have changed into directories, as mtree cannot handle this
# scenario.
DISTRIB_CLEANUP_FILES+= ${INCLUDEDIR}/c++/v1/__string
DISTRIB_CLEANUP_FILES+= ${INCLUDEDIR}/c++/v1/__tuple
DISTRIB_CLEANUP_FILES+= ${LIBEXECDIR}/kgdb
distrib-cleanup: .PHONY
for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
for file in ${DISTRIB_CLEANUP_FILES}; do \
if [ -f ${DESTDIR}/$${file} ]; then \
rm -f ${DESTDIR}/$${file}; \
fi; \
done

distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
@set ${MTREES}; \
while test $$# -ge 2; do \
m=${.CURDIR}/$$1; \
shift; \
d=${DESTDIR}$$1; \
shift; \
test -d $$d || mkdir -p $$d; \
${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
${MTREE_FILTER} $$m | \
${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
-p $$d; \
done; true
.for _m _d in ${MTREES}
@m=${.CURDIR}/${_m}; \
d=${DESTDIR}${_d}; \
test -d $$d || mkdir -p $$d; \
${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
${MTREE_FILTER} $$m | \
${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
-p $$d
.endfor
.if defined(NO_ROOT)
@set ${MTREES}; \
while test $$# -ge 2; do \
m=${.CURDIR}/$$1; \
shift; \
d=$$1; \
test "$$d" == "/" && d=""; \
d=${DISTBASE}$$d; \
shift; \
test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
"sed s#^\.#.$$d# | ${METALOG.add}" ; \
${MTREE_FILTER} $$m | \
${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
${METALOG.add} ; \
done; true
.for _m _d in ${MTREES}
@m=${.CURDIR}/${_m}; \
d=${_d}; \
test "$$d" == "/" && d=""; \
d=${DISTBASE}$$d; \
test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
"sed s#^\.#.$$d# | ${METALOG.add}" ; \
${MTREE_FILTER} $$m | \
${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
${METALOG.add}
.endfor
.endif
.if ${MK_NLS} != "no"
set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
while [ $$# -gt 0 ] ; do \
${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
shift; shift; \
done
.for alias nls in ${NLS_ALIASES}
${INSTALL_SYMLINK} -T "package=utilities" \
"${nls}" "${DESTDIR}${SHAREDIR}/nls/${alias}"
.endfor
.endif

etc-examples: ${META_DEPS}
cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
${BIN1} ${BIN2} \
${DESTDIR}${SHAREDIR}/examples/etc

.include <bsd.prog.mk>

.if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
Expand Down
2 changes: 1 addition & 1 deletion etc/mtree/BSD.debug.dist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
..
lib
clang
13.0.0
18
lib
freebsd
..
Expand Down
Loading

0 comments on commit ba774ff

Please sign in to comment.