ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/src/trunk/Makefile.inc1
(Generate patch)

Comparing trunk/Makefile.inc1 (file contents):
Revision 9189 by laffer1, Mon Oct 17 13:04:37 2016 UTC vs.
Revision 9379 by laffer1, Sat Mar 4 20:33:14 2017 UTC

# Line 4 | Line 4
4   # Make command line options:
5   #       -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
6   #       -DNO_CLEAN do not clean at all
7 + #       -DDB_FROM_SRC use the user/group databases in src/etc instead of
8 + #           the system database when installing.
9   #       -DNO_SHARE do not go into share subdir
10   #       -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ}
11   #       -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
# Line 11 | Line 13
13   #       -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
14   #       -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel
15   #       -DNO_PORTSUPDATE do not update ports in ${MAKE} update
16 + #       -DNO_ROOT install without using root privilege
17   #       -DNO_DOCUPDATE do not update doc in ${MAKE} update
15 #       -DDB_FROM_SRC use the user/group databases in src/etc instead of
16 #           the system database when installing.
18   #       -DNO_CTF do not run the DTrace CTF conversion tools on built objects
19   #       LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
20   #       LOCAL_MTREE="list of mtree files" to process to allow local directories
21   #           to be created before files are installed
22 + #       METALOG="path to metadata log" to write permission and ownership
23 + #           when NO_ROOT is set.  (default: ${DESTDIR}/METALOG)
24   #       TARGET="machine" to crossbuild world for a different machine type
25   #       TARGET_ARCH= may be required when a TARGET supports multiple endians
26  
# Line 347 | Line 350 | IMAKE+=                __MAKE_SHELL=${INSTALLTMP}/sh
350   IMAKEENV+=      PATH=${TMPPATH}:${INSTALLTMP}
351   .endif
352   .if defined(DB_FROM_SRC)
353 < IMAKE_INSTALL=  INSTALL="install -N ${.CURDIR}/etc"
354 < IMAKE_MTREE=    MTREE_CMD="nmtree -N ${.CURDIR}/etc"
353 > INSTALLFLAGS+=  -N ${.CURDIR}/etc
354 > MTREEFLAGS+=    -N ${.CURDIR}/etc
355   .endif
356 + .if defined(NO_ROOT)
357 + METALOG?=       ${DESTDIR}/${DISTDIR}/METALOG
358 + IMAKE+=         -DNO_ROOT METALOG=${METALOG}
359 + INSTALL_DDIR=   ${DESTDIR}/${DISTDIR}
360 + INSTALLFLAGS+=  -U -M ${METALOG} -D ${INSTALL_DDIR:S://:/:g:C:/$::}
361 + MTREEFLAGS+=    -W
362 + .endif
363 + .if defined(DB_FROM_SRC) || defined(NO_ROOT)
364 + IMAKE_INSTALL=  INSTALL="install ${INSTALLFLAGS}"
365 + IMAKE_MTREE=    MTREE_CMD="nmtree ${MTREEFLAGS}"
366 + .endif
367  
368   # kernel stage
369   KMAKEENV=       ${WMAKEENV}
# Line 387 | Line 401 | _worldtmp:
401          rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
402   .endif
403   .for _dir in \
404 <    lib usr legacy/usr legacy/usr/bin legacy/usr/sbin
404 >    lib usr legacy/bin legacy/usr legacy/usr/bin legacy/usr/sbin
405          mkdir -p ${WORLDTMP}/${_dir}
406   .endfor
407          mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
# Line 591 | Line 605 | kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_librar
605   # Checks to be sure system is ready for installworld/installkernel.
606   #
607   installcheck:
608 + installcheck_UGID:
609  
610   #
611   # Require DESTDIR to be set if installing for a different architecture or
# Line 622 | Line 637 | CHECK_GIDS+=   smmsp
637   CHECK_UIDS+=    proxy
638   CHECK_GIDS+=    proxy authpf
639   .endif
625 installcheck: installcheck_UGID
640   installcheck_UGID:
641   .for uid in ${CHECK_UIDS}
642          @if ! `id -u ${uid} >/dev/null 2>&1`; then \
# Line 653 | Line 667 | _nmtree_itools=        nmtree
667   .endif
668  
669   ITOOLS= [ awk cap_mkdb cat chflags chmod chown \
670 <        date echo egrep find grep ${_install-info} \
670 >        date echo egrep find grep id install ${_install-info} \
671          ln lockf make mkdir mtree ${_nmtree_itools} mv pwd_mkdb \
672          rm sed sh sysctl test true uname wc ${_zoneinfo}
673  
# Line 676 | Line 690 | EXTRA_DISTRIBUTIONS+=  games
690   EXTRA_DISTRIBUTIONS+=   lib32
691   .endif
692  
693 < distributeworld installworld: installcheck
693 > MTREE_MAGIC?=   mtree 2.0
694 >
695 > distributeworld installworld: installcheck installcheck_UGID
696          mkdir -p ${INSTALLTMP}
697          progs=$$(for prog in ${ITOOLS}; do \
698                  if progpath=`which $$prog`; then \
# Line 698 | Line 714 | distributeworld installworld: installcheck
714              done); \
715          cp $$libs $$progs ${INSTALLTMP}
716          cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale
717 + .if defined(NO_ROOT)
718 +        echo "#${MTREE_MAGIC}" > ${METALOG}
719 + .endif
720   .if make(distributeworld)
721   .for dist in ${EXTRA_DISTRIBUTIONS}
722          -mkdir ${DESTDIR}/${DISTDIR}/${dist}
# Line 707 | Line 726 | distributeworld installworld: installcheck
726              -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
727          mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
728              -p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null
729 + .if defined(NO_ROOT)
730 +        ${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \
731 +            sed -e 's#^\./#./${dist}/#' >> ${METALOG}
732 +        ${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \
733 +            sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
734 +        ${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \
735 +            sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG}
736 + .endif
737   .endfor
738          -mkdir ${DESTDIR}/${DISTDIR}/base
739 <        ${_+_}cd ${.CURDIR}; ${IMAKE} distrib-dirs \
740 <            LOCAL_MTREE=${LOCAL_MTREE} DESTDIR=${DESTDIR}/${DISTDIR}/base
739 >        cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \
740 >            METALOG=${METALOG} ${IMAKE_INSTALL} ${IMAKE_MTREE} \
741 >            DISTBASE=/base DESTDIR=${DESTDIR}/${DISTDIR}/base \
742 >            LOCAL_MTREE=${LOCAL_MTREE} distrib-dirs
743   .endif
744          ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \
745              ${IMAKEENV} rm -rf ${INSTALLTMP}
# Line 718 | Line 747 | distributeworld installworld: installcheck
747   .for dist in ${EXTRA_DISTRIBUTIONS}
748          find ${DESTDIR}/${DISTDIR}/${dist} -empty -delete
749   .endfor
750 + .if defined(NO_ROOT)
751 + .for dist in base ${EXTRA_DISTRIBUTIONS}
752 +        @# For each file that exists in this dist, print the corresponding
753 +        @# line from the METALOG.  This relies on the fact that
754 +        @# a line containing only the filename will sort immediatly before
755 +        @# the relevant mtree line.
756 +        cd ${DESTDIR}/${DISTDIR}; \
757 +        find ./${dist} | sort -u ${METALOG} - | \
758 +        awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
759 +        ${DESTDIR}/${DISTDIR}/${dist}.meta
760 + .endfor
761   .endif
762 + .endif
763  
764   packageworld:
765   .for dist in base ${EXTRA_DISTRIBUTIONS}
766 + .if defined(NO_ROOT)
767          ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
768 +            tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \
769 +            @${DESTDIR}/${DISTDIR}/${dist}.meta
770 + .else
771 +        ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
772              tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz .
773 + .endif
774   .endfor
775  
776   #
# Line 760 | Line 807 | redistribute:
807  
808   distrib-dirs distribution:
809          cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \
810 <            ${IMAKE_INSTALL} ${IMAKE_MTREE} ${.TARGET}
810 >            ${IMAKE_INSTALL} ${IMAKE_MTREE} METALOG=${METALOG} ${.TARGET}
811  
812   #
813   # buildkernel and installkernel
# Line 1114 | Line 1161 | bootstrap-tools:
1161      ${_ar} \
1162      ${_dtc} \
1163      ${_awk} \
1164 +    ${_cat} \
1165      usr.bin/lorder \
1166      usr.bin/makewhatis \
1167      ${_mklocale} \
# Line 1249 | Line 1297 | cross-tools:
1297   # hierarchy - ensure that all the needed directories are present
1298   #
1299   hierarchy:
1300 + .if defined(NO_ROOT)
1301 +        cd ${.CURDIR}/etc; ${MAKE} LOCAL_MTREE=${LOCAL_MTREE} \
1302 +            -DNO_ROOT METALOG=${METALOG} distrib-dirs
1303 + .else
1304          cd ${.CURDIR}/etc; ${MAKE} LOCAL_MTREE=${LOCAL_MTREE} distrib-dirs
1305 + .endif
1306  
1307   #
1308   # libraries - build all libraries, and install them under ${DESTDIR}.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines