diff --git a/Makefile b/Makefile index f9f0f939ad5f..671bda5c311f 100644 --- a/Makefile +++ b/Makefile @@ -113,7 +113,8 @@ TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ _build-tools _cross-tools _includes _libraries _depend \ build32 builddtb distribute32 install32 xdev xdev-build xdev-install \ - xdev-links native-xtools kernel-pkgs stageworld create-world-packages + xdev-links native-xtools kernel-pkgs stageworld create-world-packages \ + packages TGTS+= ${SUBDIR_TARGETS} diff --git a/Makefile.inc1 b/Makefile.inc1 index 31cb5a41be60..39fc56804602 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1209,10 +1209,6 @@ packagekernel: .endif create-world-packages: -.if !defined(NO_ROOT) - @echo "ERROR: create-world-package can only be done with -DNO_ROOT"; \ - false -.endif @cd ${DESTDIR} ; \ awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ ${DESTDIR}/METALOG @@ -1239,6 +1235,15 @@ create-world-packages: -r ${DESTDIR} -o ${DESTDIR} ; \ done +STAGEDIR= ${MAKEOBJDIRPREFIX}${.CURDIR}/stage + +packages: + @mkdir -p ${MAKEOBJDIRPREFIX}${.CURDIR}/stage + ${_+_}@cd ${.CURDIR}; \ + ${MAKE} buildworld >/dev/null ; \ + ${MAKE} DESTDIR=${DESTDIR:U${STAGEDIR}} -DNO_ROOT stageworld >/dev/null ; \ + ${MAKE} DESTDIR=${DESTDIR:U${STAGEDIR}} create-world-packages + kernel-pkgs: .if !defined(NO_ROOT) @echo "ERROR: kernel-pkgs can only be done with -DNO_ROOT"; \