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 687 by laffer1, Fri Jan 19 02:22:33 2007 UTC vs.
Revision 4657 by laffer1, Sun Feb 19 23:07:13 2012 UTC

# Line 1 | Line 1
1   #
2   # $FreeBSD: src/Makefile.inc1,v 1.499.2.7 2006/01/07 19:40:08 netchild Exp $
3 < # $MidnightBSD: src/Makefile.inc1,v 1.6 2006/12/27 04:04:06 laffer1 Exp $
3 > # $MidnightBSD: src/Makefile.inc1,v 1.37 2012/02/19 23:04:03 laffer1 Exp $
4   #
5   # Make command line options:
6 #       -DNO_DYNAMICROOT do not link /bin and /sbin dynamically
7 #       -DNO_KERBEROS Do not build Heimdal (Kerberos 5)
8 #       -DNO_RESCUE do not build rescue binaries
6   #       -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
7   #       -DNO_CLEAN do not clean at all
11 #       -DNO_CRYPT will prevent building of crypt versions
12 #       -DNO_MAN do not build the manual pages
13 #       -DNO_NLS do not build Native Language Support files
14 #       -DNO_PROFILE do not build profiled libraries
15 #       -DNO_GAMES do not go into games subdir
8   #       -DNO_SHARE do not go into share subdir
17 #       -DNO_INFO do not make or install info files
18 #       -DNO_LIBC_R do not build libc_r.
19 #       -DNO_FORTRAN do not build g77 and related libraries.
9   #       -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
10   #       -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
11   #       -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
12   #       -DNO_PORTSUPDATE do not update ports in ${MAKE} update
13   #       -DNO_DOCUPDATE do not update doc in ${MAKE} update
14   #       LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
15 < #       TARGET_ARCH="arch" to crossbuild world to a different arch
15 > #       LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools#           list
16 > #       TARGET="machine" to crossbuild world for a different machine type
17  
18   #
19   # The intended user-driven targets are:
20   # buildworld  - rebuild *everything*, including glue to help do upgrades
21   # installworld- install everything built by "buildworld"
22 + # doxygen     - build API documentation of the kernel
23   # update      - convenient way to update your source tree (eg: cvsup/cvs)
24   #
25   # Standard targets (not defined here) are documented in the makefiles in
26   # /usr/share/mk.  These include:
27   #               obj depend all install clean cleandepend cleanobj
28  
29 + # You are supposed to define both of these when calling Makefile.inc1
30 + # directly.  However, some old scripts don't.  Cope for the moment, but
31 + # issue a new warning for a transition period.
32 + .if defined(TARGET) && !defined(TARGET_ARCH)
33 + .warning "You must pass both TARGET and TARGET_ARCH to Makefile.inc1.  Setting TARGET_ARCH=${TARGET}."
34 + TARGET_ARCH=${TARGET}
35 + .endif
36 + .if !defined(TARGET) || !defined(TARGET_ARCH)
37 + .error "Both TARGET and TARGET_ARCH must be defined."
38 + .endif
39 +
40 + .include <bsd.own.mk>
41 +
42   # We must do share/info early so that installation of info `dir'
43   # entries works correctly.  Do it first since it is less likely to
44   # grow dependencies on include and lib than vice versa.
45   #
46 < # We must do lib and libexec before bin, because if installworld
46 > # We must do lib/ and libexec/ before bin/, because if installworld
47   # installs a new /bin/sh, the 'make' command will *immediately*
48   # use that new version.  And the new (dynamically-linked) /bin/sh
49   # will expect to find appropriate libraries in /lib and /libexec.
50   #
51 < # We must do etc last for install/distribute to work.
52 < #
53 < SUBDIR= share/info include lib libexec bin
54 < .if !defined(NO_GAMES)
51 > SUBDIR= share/info lib libexec
52 > SUBDIR+=bin
53 > .if ${MK_APACHE} != "no"
54 > SUBDIR+=apache
55 > .endif
56 > .if ${MK_GAMES} != "no"
57   SUBDIR+=games
58   .endif
59 < SUBDIR+=gnu
60 < .if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL)
59 > .if ${MK_CDDL} != "no"
60 > SUBDIR+=cddl
61 > .endif
62 > SUBDIR+=gnu include
63 > .if ${MK_KERBEROS} != "no"
64   SUBDIR+=kerberos5
65   .endif
66 < .if !defined(NO_RESCUE)
66 > .if ${MK_RESCUE} != "no"
67   SUBDIR+=rescue
68   .endif
69   SUBDIR+=sbin
70 < .if !defined(NO_CRYPT)
70 > .if ${MK_CRYPT} != "no"
71   SUBDIR+=secure
72   .endif
73   .if !defined(NO_SHARE)
74   SUBDIR+=share
75   .endif
76 < SUBDIR+=sys usr.bin usr.sbin etc
76 > SUBDIR+=sys usr.bin usr.sbin
77 > #
78 > # We must do etc/ last for install/distribute to work.
79 > #
80 > SUBDIR+=etc
81  
82   # These are last, since it is nice to at least get the base system
83   # rebuilt before you do them.
# Line 87 | Line 100 | CLEANDIR=      clean cleandepend
100   CLEANDIR=       cleandir
101   .endif
102  
103 + BUILDENV_SHELL?=/bin/sh
104 + LOCAL_TOOL_DIRS?=
105 +
106   CVS?=           cvs
107   CVSFLAGS?=      -r . -P -d -I!
108 < SUP?=           /usr/bin/csup
109 < SUPFLAGS?=      -g -L 2
108 > SUP?=           /usr/local/bin/cvsup
109 > SUPFLAGS?=      -g -L 2
110   .if defined(SUPHOST)
111   SUPFLAGS+=      -h ${SUPHOST}
112   .endif
# Line 98 | Line 114 | SUPFLAGS+=     -h ${SUPHOST}
114   MAKEOBJDIRPREFIX?=      /usr/obj
115   .if !defined(OSRELDATE)
116   .if exists(/usr/include/osreldate.h)
117 < OSRELDATE!=     awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
117 > OSRELDATE!=     awk '/^\#define[[:space:]]*__MidnightBSD_version/ { print $$3 }' \
118                  /usr/include/osreldate.h
119   .else
120   OSRELDATE=      0
121   .endif
122   .endif
123 < TARGET_ARCH?=   ${MACHINE_ARCH}
124 < .if ${TARGET_ARCH} == ${MACHINE_ARCH}
123 >
124 > # Guess machine architecture from machine type, and vice versa.
125 > .if !defined(TARGET_ARCH) && defined(TARGET)
126 > TARGET_ARCH=    ${TARGET}
127 > .elif !defined(TARGET) && defined(TARGET_ARCH) && \
128 >    ${TARGET_ARCH} != ${MACHINE_ARCH}
129 > TARGET=         ${TARGET_ARCH}
130 > .endif
131 > # Otherwise, default to current machine type and architecture.
132   TARGET?=        ${MACHINE}
133 + TARGET_ARCH?=   ${MACHINE_ARCH}
134 +
135 + KNOWN_ARCHES?=  amd64 i386 sparc64
136 + .if ${TARGET} == ${TARGET_ARCH}
137 + _t=             ${TARGET}
138 + .else
139 + _t=             ${TARGET_ARCH}/${TARGET}
140 + .endif
141 + .for _t in ${_t}
142 + .if empty(KNOWN_ARCHES:M${_t})
143 + .error Unknown target ${TARGET_ARCH}:${TARGET}.
144 + .endif
145 + .endfor
146 +
147 + .if ${TARGET} == ${MACHINE}
148   TARGET_CPUTYPE?=${CPUTYPE}
149   .else
112 TARGET?=        ${TARGET_ARCH}
150   TARGET_CPUTYPE?=
151   .endif
152 +
153   .if !empty(TARGET_CPUTYPE)
154   _TARGET_CPUTYPE=${TARGET_CPUTYPE}
155   .else
# Line 123 | Line 161 | _CPUTYPE!=     MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAK
161   .error CPUTYPE global should be set with ?=.
162   .endif
163   .if make(buildworld)
164 < BUILD_ARCH!=    sysctl -n hw.machine_arch
164 > BUILD_ARCH!=    uname -p
165   .if ${MACHINE_ARCH} != ${BUILD_ARCH}
166   .error To cross-build, set TARGET_ARCH.
167   .endif
168   .endif
169 < .if ${MACHINE} == ${TARGET} && !defined(CROSS_BUILD_TESTING)
169 > .if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING)
170   OBJTREE=        ${MAKEOBJDIRPREFIX}
171   .else
172 < OBJTREE=        ${MAKEOBJDIRPREFIX}/${TARGET}
172 > OBJTREE=        ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}
173   .endif
174   WORLDTMP=       ${OBJTREE}${.CURDIR}/tmp
175   # /usr/games added for fortune which depend on strfile
# Line 140 | Line 178 | XPATH=         ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WOR
178   STRICTTMPPATH=  ${BPATH}:${XPATH}
179   TMPPATH=        ${STRICTTMPPATH}:${PATH}
180  
181 + #
182 + # Avoid running mktemp(1) unless actually needed.
183 + # It may not be functional, e.g., due to new ABI
184 + # when in the middle of installing over this system.
185 + #
186 + .if make(distributeworld) || make(installworld)
187   INSTALLTMP!=    /usr/bin/mktemp -d -u -t install
188 + .endif
189  
190   #
191   # Building a world goes through the following stages
# Line 187 | Line 232 | BMAKE=         MAKEOBJDIRPREFIX=${WORLDTMP} \
232                  ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
233                  DESTDIR= \
234                  BOOTSTRAPPING=${OSRELDATE} \
235 <                -DNO_HTML -DNO_INFO -DNO_LINT -DNO_MAN -DNO_NLS -DNO_PIC \
236 <                -DNO_PROFILE -DNO_SHARED -DNO_CPU_CFLAGS -DNO_WARNS
235 >                -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
236 >                -DWITHOUT_NLS -DNO_PIC -DNO_PROFILE -DNO_SHARED \
237 >                -DNO_CPU_CFLAGS -DNO_WARNS
238  
239   # build-tools stage
240   TMAKE=          MAKEOBJDIRPREFIX=${OBJTREE} \
241                  ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
242 +                TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
243                  DESTDIR= \
244                  BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS
245  
246   # cross-tools stage
247 < XMAKE=          TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
247 > XMAKE=          TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
248 >                TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
249 >                -DWITHOUT_GDB
250  
251   # world stage
252   WMAKEENV=       ${CROSSENV} \
# Line 210 | Line 259 | WMAKE=         ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=$
259   # 32 bit world
260   LIB32TMP=       ${OBJTREE}${.CURDIR}/lib32
261  
262 < LIB32PREFLAGS=  -m32 -march=athlon-xp -msse2 -mfancy-math-387 -DCOMPAT_32BIT
263 < LIB32POSTFLAGS= -I${LIB32TMP}/usr/include \
262 > .if empty(TARGET_CPUTYPE)
263 > LIB32CPUTYPE=   k8
264 > .else
265 > LIB32CPUTYPE=   ${TARGET_CPUTYPE}
266 > .endif
267 > LIB32FLAGS=     -m32 -march=${LIB32CPUTYPE} -DCOMPAT_32BIT \
268 >                -iprefix ${LIB32TMP}/usr/ \
269                  -L${LIB32TMP}/usr/lib32 \
270                  -B${LIB32TMP}/usr/lib32
217 LIB32CC=        ${LIB32PREFLAGS} \
218                ${LIB32POSTFLAGS}
219 LIB32CXX=       ${LIB32PREFLAGS} -I${LIB32TMP}/usr/include/c++/3.4 \
220                ${LIB32POSTFLAGS}
221 LIB32OBJC=      ${LIB32PREFLAGS} -I${LIB32TMP}/usr/include/objc \
222                ${LIB32POSTFLAGS}
271  
272   # Yes, the flags are redundant.
273 < LIB32MAKEENV=   MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
273 > LIB32WMAKEENV=  MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
274                  _SHLIBDIRPREFIX=${LIB32TMP} \
275                  MACHINE=i386 \
276                  MACHINE_ARCH=i386 \
277                  INSTALL="sh ${.CURDIR}/tools/install.sh" \
278                  PATH=${TMPPATH} \
279 <                CC="${CC} ${LIB32CC}" \
280 <                CXX="${CXX} ${LIB32CXX}" \
281 <                OBJC="${OBJC} ${LIB32OBJC}" \
279 >                CC="${CC} ${LIB32FLAGS}" \
280 >                CXX="${CXX} ${LIB32FLAGS}" \
281 >                OBJC="${OBJC} ${LIB32FLAGS}" \
282                  LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \
283                  AS="${AS} --32" \
284                  LIBDIR=/usr/lib32 \
285                  SHLIBDIR=/usr/lib32
286  
287 < LIB32MAKE=      ${LIB32MAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \
288 <                -DNO_BIND -DNO_MAN -DNO_NLS -DNO_INFO -DNO_HTML
289 < LIB32IMAKE=     ${LIB32MAKE:NINSTALL=*} -DNO_INCS
287 > LIB32WMAKE=     ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \
288 >                -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_INFO \
289 >                -DWITHOUT_HTML -DNO_LINT -ECC -ECXX -EAS -ELD \
290 >                -DESTDIR=${LIB32TMP}
291 > LIB32IMAKE=     ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS
292   .endif
293  
294   # install stage
295 + IMAKEENV=       ${CROSSENV}
296 + IMAKE=          ${IMAKEENV} ${MAKE} -f Makefile.inc1
297   .if empty(.MAKEFLAGS:M-n)
298 < IMAKEENV=       ${CROSSENV} \
299 <                PATH=${STRICTTMPPATH}:${INSTALLTMP}
298 > IMAKEENV+=      PATH=${STRICTTMPPATH}:${INSTALLTMP} \
299 >                LD_LIBRARY_PATH=${INSTALLTMP} \
300 >                PATH_LOCALE=${INSTALLTMP}/locale
301 > IMAKE+=         __MAKE_SHELL=${INSTALLTMP}/sh
302   .else
303 < IMAKEENV=       ${CROSSENV} \
250 <                PATH=${TMPPATH}:${INSTALLTMP}
303 > IMAKEENV+=      PATH=${TMPPATH}:${INSTALLTMP}
304   .endif
252 IMAKE=          ${IMAKEENV} ${MAKE} -f Makefile.inc1
305  
306   # kernel stage
307   KMAKEENV=       ${WMAKEENV}
308 + KMAKE=          ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME}
309  
310   #
311   # buildworld
# Line 280 | Line 333 | _worldtmp:
333   .endif
334   .else
335          rm -rf ${WORLDTMP}/legacy/usr/include
336 <        # XXX - These two can depend on any header file.
336 > #       XXX - These two can depend on any header file.
337          rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
338 +        rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c
339          rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
340   .endif
341   .for _dir in \
342 <    usr/bin usr/games usr/include/c++/3.4 usr/include/sys usr/lib \
289 <    usr/libexec usr/sbin usr/share/dict \
290 <    usr/share/groff_font/devX100 \
291 <    usr/share/groff_font/devX100-12 \
292 <    usr/share/groff_font/devX75 \
293 <    usr/share/groff_font/devX75-12 \
294 <    usr/share/groff_font/devascii \
295 <    usr/share/groff_font/devcp1047 \
296 <    usr/share/groff_font/devdvi \
297 <    usr/share/groff_font/devhtml \
298 <    usr/share/groff_font/devkoi8-r \
299 <    usr/share/groff_font/devlatin1 \
300 <    usr/share/groff_font/devlbp \
301 <    usr/share/groff_font/devlj4 \
302 <    usr/share/groff_font/devps \
303 <    usr/share/groff_font/devutf8 \
304 <    usr/share/tmac/mdoc usr/share/tmac/mm
305 <        mkdir -p ${WORLDTMP}/legacy/${_dir}
306 < .endfor
307 < .for _dir in \
308 <    lib usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \
309 <    usr/libexec usr/sbin usr/share/misc \
310 <    usr/share/snmp/defs usr/share/snmp/mibs
342 >    lib usr legacy/usr
343          mkdir -p ${WORLDTMP}/${_dir}
344   .endfor
345 +        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
346 +            -p ${WORLDTMP}/legacy/usr >/dev/null
347 +        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
348 +            -p ${WORLDTMP}/usr >/dev/null
349          mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
350              -p ${WORLDTMP}/usr/include >/dev/null
351          ln -sf ${.CURDIR}/sys ${WORLDTMP}
352 < .if defined(WITH_BIND_LIBS) && !defined(NO_BIND)
352 > .if ${MK_BIND_LIBS} != "no"
353          mtree -deU -f ${.CURDIR}/etc/mtree/BIND.include.dist \
354              -p ${WORLDTMP}/usr/include >/dev/null
355   .endif
# Line 337 | Line 373 | _cleanobj:
373          @echo "--------------------------------------------------------------"
374          ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
375   .if ${TARGET_ARCH} == "amd64"
376 <        rm -rf ${OBJTREE}/lib32
376 >        ${_+_}cd ${.CURDIR}; ${LIB32WMAKE} -f Makefile.inc1 ${CLEANDIR:S/^/par-/}
377   .endif
378   .endif
379   _obj:
# Line 370 | Line 406 | _libraries:
406          @echo ">>> stage 4.2: building libraries"
407          @echo "--------------------------------------------------------------"
408          ${_+_}cd ${.CURDIR}; \
409 <            ${WMAKE} -DNO_FSCHG -DNO_HTML -DNO_INFO -DNO_LINT -DNO_MAN \
410 <            -DNO_NLS -DNO_PROFILE libraries
409 >            ${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
410 >            -DWITHOUT_MAN -DWITHOUT_NLS -DNO_PROFILE libraries
411   _depend:
412          @echo
413          @echo "--------------------------------------------------------------"
# Line 390 | Line 426 | build32:
426          @echo "--------------------------------------------------------------"
427          @echo ">>> stage 5.1: building 32 bit shim libraries"
428          @echo "--------------------------------------------------------------"
429 < .for _dir in \
430 <    lib lib32 usr/bin usr/include usr/lib32 usr/libdata/ldscripts \
431 <    usr/libexec usr/sbin usr/share/misc \
396 <    usr/share/snmp/defs usr/share/snmp/mibs
397 <        mkdir -p ${LIB32TMP}/${_dir}
398 < .endfor
429 >        mkdir -p ${LIB32TMP}/usr/include
430 >        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
431 >            -p ${LIB32TMP}/usr >/dev/null
432          mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
433              -p ${LIB32TMP}/usr/include >/dev/null
434          mkdir -p ${WORLDTMP}
435          ln -sf ${.CURDIR}/sys ${WORLDTMP}
436 < .if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL)
436 > .if ${MK_KERBEROS} != "no"
437   .for _t in obj depend all
438          cd ${.CURDIR}/kerberos5/tools; \
439              MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} DESTDIR= ${_t}
440   .endfor
441   .endif
442   .for _t in obj includes
443 <        cd ${.CURDIR}/include; \
444 <            ${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t}
445 <        cd ${.CURDIR}/lib; \
446 <            ${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t}
414 <        cd ${.CURDIR}/gnu/lib; \
415 <            ${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t}
416 < .if !defined(NO_CRYPT)
417 <        cd ${.CURDIR}/secure/lib; \
418 <            ${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t}
443 >        cd ${.CURDIR}/include; ${LIB32WMAKE} ${_t}
444 >        cd ${.CURDIR}/lib; ${LIB32WMAKE} ${_t}
445 > .if ${MK_APACHE} != "no"
446 >        cd ${.CURDIR}/apache/lib; ${LIB32WMAKE} ${_t}
447   .endif
448 < .if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL)
449 <        cd ${.CURDIR}/kerberos5/lib; \
422 <            ${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t}
448 > .if ${MK_CDDL} != "no"
449 >        cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} DIRPRFX=cddl/lib/ ${_t}
450   .endif
451 +        cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} DIRPRFX=gnu/lib/ ${_t}
452 + .if ${MK_CRYPT} != "no"
453 +        cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} DIRPRFX=secure/lib/ ${_t}
454 + .endif
455 + .if ${MK_KERBEROS} != "no"
456 +        cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} DIRPRFX=kerberos5/lib ${_t}
457 + .endif
458   .endfor
459 < .for _dir in usr.sbin/pcvt/keycap usr.bin/lex/lib
460 <        cd ${.CURDIR}/${_dir}; \
427 <            ${LIB32MAKE} DESTDIR=${LIB32TMP} obj
459 > .for _dir in usr.bin/lex/lib
460 >        cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} DIRPRFX=${_dir}/ obj
461   .endfor
462 < .for _dir in lib/libncurses lib/libmagic
462 > .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic
463          cd ${.CURDIR}/${_dir}; \
464 <            MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} DESTDIR= build-tools
464 >            MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \
465 >            DIRPRFX=${_dir}/ build-tools
466   .endfor
467          cd ${.CURDIR}; \
468 <            ${LIB32MAKE} -f Makefile.inc1 DESTDIR=${LIB32TMP} libraries
468 >            ${LIB32WMAKE} -f Makefile.inc1 libraries
469   .for _t in obj depend all
470 <        cd ${.CURDIR}/libexec/rtld-elf; \
471 <            PROG=ld-elf32.so.1 ${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t}
470 >        cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \
471 >            DIRPRFX=libexec/rtld-elf/ ${_t}
472 >        cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \
473 >            DIRPRFX=usr.bin/ldd ${_t}
474   .endfor
475  
476   distribute32 install32:
# Line 444 | Line 480 | distribute32 install32:
480          mkdir -p ${DESTDIR}/usr/lib32                   # XXX add to mtree
481   .endif
482          cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
483 + .if ${MK_CDDL} != "no"
484 +        cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
485 + .endif
486          cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
487 < .if !defined(NO_CRYPT)
487 > .if ${MK_CRYPT} != "no"
488          cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
489   .endif
490 <        cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//}
490 > .if ${MK_KERBEROS} != "no"
491 >        cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
492   .endif
493 +        cd ${.CURDIR}/libexec/rtld-elf; \
494 +            PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//}
495 +        cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//}
496 + .endif
497  
454
498   WMAKE_TGTS=
499   .if !defined(SUBDIR_OVERRIDE)
500   WMAKE_TGTS+=    _worldtmp _legacy _bootstrap-tools
# Line 461 | Line 504 | WMAKE_TGTS+=   _cleanobj _obj _build-tools
504   WMAKE_TGTS+=    _cross-tools
505   .endif
506   WMAKE_TGTS+=    _includes _libraries _depend everything
507 < .if ${TARGET_ARCH} == "amd64" && !defined(NO_LIB32)
507 > .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
508   WMAKE_TGTS+=    build32
509   .endif
510  
511 < buildworld: ${WMAKE_TGTS}
512 < .ORDER: ${WMAKE_TGTS}
511 > buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
512 > .ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
513  
514 + buildworld_prologue:
515 +        @echo "--------------------------------------------------------------"
516 +        @echo ">>> World build started on `LC_ALL=C date`"
517 +        @echo "--------------------------------------------------------------"
518 +
519 + buildworld_epilogue:
520 +        @echo
521 +        @echo "--------------------------------------------------------------"
522 +        @echo ">>> World build completed on `LC_ALL=C date`"
523 +        @echo "--------------------------------------------------------------"
524 +
525 + #
526 + # We need to have this as a target because the indirection between Makefile
527 + # and Makefile.inc1 causes the correct PATH to be used, rather than a
528 + # modification of the current environment's PATH.  In addition, we need
529 + # to quote multiword values.
530 + #
531 + buildenvvars:
532 +        @echo ${WMAKEENV:Q}
533 +
534   buildenv:
535          @echo Entering world for ${TARGET_ARCH}:${TARGET}
536 <        @cd ${.CURDIR} && env ${WMAKEENV} sh || true
536 >        @cd ${.CURDIR} && env ${WMAKEENV} ${BUILDENV_SHELL} || true
537  
538   TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything:Nbuild32}
539   toolchain: ${TOOLCHAIN_TGTS}
540   kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries}
541  
542   #
543 < # Use this to add checks to installworld/installkernel targets.
543 > # installcheck
544   #
545 < SPECIAL_INSTALLCHECKS=
545 > # Checks to be sure system is ready for installworld/installkernel.
546 > #
547 > installcheck:
548  
549   #
550   # Require DESTDIR to be set if installing for a different architecture.
551   #
552   .if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE}
553   .if !make(distributeworld)
554 < SPECIAL_INSTALLCHECKS+= installcheck_DESTDIR
554 > installcheck: installcheck_DESTDIR
555   installcheck_DESTDIR:
556   .if !defined(DESTDIR) || empty(DESTDIR)
557          @echo "ERROR: Please set DESTDIR!"; \
# Line 496 | Line 561 | installcheck_DESTDIR:
561   .endif
562  
563   #
564 < # installcheck
564 > # Check for missing UIDs/GIDs.
565   #
501 # Checks to be sure system is ready for installworld
502 #
566   CHECK_UIDS=
567 < CHECK_GIDS=     audit  
568 < .if !defined(NO_SENDMAIL)
567 > CHECK_GIDS=     audit
568 > .if ${MK_SENDMAIL} != "no"
569   CHECK_UIDS+=    smmsp
570   CHECK_GIDS+=    smmsp
571   .endif
572 < .if !defined(NO_PF)
572 > .if ${MK_PF} != "no"
573   CHECK_UIDS+=    proxy
574   CHECK_GIDS+=    proxy authpf
575   .endif
576 < installcheck: ${SPECIAL_INSTALLCHECKS}
576 > installcheck: installcheck_UGID
577 > installcheck_UGID:
578   .for uid in ${CHECK_UIDS}
579          @if ! `id -u ${uid} >/dev/null 2>&1`; then \
580                  echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \
# Line 525 | Line 589 | installcheck: ${SPECIAL_INSTALLCHECKS}
589   .endfor
590  
591   #
592 + # Required install tools to be saved in a scratch dir for safety.
593 + #
594 + .if ${MK_INFO} != "no"
595 + _install-info=  install-info
596 + .endif
597 + .if ${MK_ZONEINFO} != "no"
598 + _zoneinfo=      zic tzsetup
599 + .endif
600 +
601 + ITOOLS= [ awk cap_mkdb cat chflags chmod chown \
602 +        date echo egrep find grep ${_install-info} \
603 +        ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
604 +        test true uname wc ${_zoneinfo}
605 +
606 + #
607   # distributeworld
608   #
609   # Distributes everything compiled by a `buildworld'.
# Line 533 | Line 612 | installcheck: ${SPECIAL_INSTALLCHECKS}
612   #
613   # Installs everything compiled by a 'buildworld'.
614   #
615 +
616 + # Non-base distributions produced by the base system
617 + EXTRA_DISTRIBUTIONS=    doc games
618 + .if defined(LIB32TMP) && ${MK_LIB32} != "no"
619 + EXTRA_DISTRIBUTIONS+=   lib32
620 + .endif
621 +
622   distributeworld installworld: installcheck
623          mkdir -p ${INSTALLTMP}
624 <        for prog in [ awk cap_mkdb cat chflags chmod chown \
625 <            date echo egrep find grep install-info \
626 <            ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
627 <            test true uname wc zic; do \
628 <                cp `which $$prog` ${INSTALLTMP}; \
629 <        done
630 <        ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
631 <        rm -rf ${INSTALLTMP}
624 >        progs=$$(for prog in ${ITOOLS}; do \
625 >                if progpath=`which $$prog`; then \
626 >                        echo $$progpath; \
627 >                else \
628 >                        echo "Required tool $$prog not found in PATH." >&2; \
629 >                        exit 1; \
630 >                fi; \
631 >            done); \
632 >        libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \
633 >            while read line; do \
634 >                set -- $$line; \
635 >                if [ "$$2 $$3" != "not found" ]; then \
636 >                        echo $$2; \
637 >                else \
638 >                        echo "Required library $$1 not found." >&2; \
639 >                        exit 1; \
640 >                fi; \
641 >            done); \
642 >        cp $$libs $$progs ${INSTALLTMP}
643 >        cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale
644 > .if make(distributeworld)
645 > .for dist in ${EXTRA_DISTRIBUTIONS}
646 >        -mkdir ${DESTDIR}/${DISTDIR}/${dist}
647 >        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
648 >            -p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null
649 >        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
650 >            -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
651 >        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
652 >            -p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null
653 > .endfor
654 >        -mkdir ${DESTDIR}/${DISTDIR}/base
655 >        ${_+_}cd ${.CURDIR}; ${IMAKE} distrib-dirs \
656 >            DESTDIR=${DESTDIR}/${DISTDIR}/base
657 > .endif
658 >        ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \
659 >            ${IMAKEENV} rm -rf ${INSTALLTMP}
660 > .if make(distributeworld)
661 > .for dist in ${EXTRA_DISTRIBUTIONS}
662 >        find ${DESTDIR}/${DISTDIR}/${dist} -empty -delete
663 > .endfor
664 > .endif
665  
666 + packageworld:
667 + .for dist in base ${EXTRA_DISTRIBUTIONS}
668 +        ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
669 +            tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz .
670 + .endfor
671 +
672   #
673   # reinstall
674   #
# Line 551 | Line 676 | distributeworld installworld: installcheck
676   # and do a 'make reinstall' on the *client* to install new binaries from the
677   # most recent server build.
678   #
679 < reinstall: ${SPECIAL_INSTALLCHECKS}
679 > reinstall:
680          @echo "--------------------------------------------------------------"
681          @echo ">>> Making hierarchy"
682          @echo "--------------------------------------------------------------"
# Line 561 | Line 686 | reinstall: ${SPECIAL_INSTALLCHECKS}
686          @echo ">>> Installing everything"
687          @echo "--------------------------------------------------------------"
688          ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
689 < .if ${TARGET_ARCH} == "amd64" && !defined(NO_LIB32)
689 > .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
690          ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32
691   .endif
692  
# Line 570 | Line 695 | redistribute:
695          @echo ">>> Distributing everything"
696          @echo "--------------------------------------------------------------"
697          ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
698 < .if ${TARGET_ARCH} == "amd64" && !defined(NO_LIB32)
699 <        ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 DISTRIBUTION=lib32
698 > .if defined(LIB32TMP) && ${MK_LIB32} != "no"
699 >        ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 \
700 >            DISTRIBUTION=lib32
701   .endif
702  
703   distrib-dirs distribution:
# Line 591 | Line 717 | distrib-dirs distribution:
717   # be set to cross-build, we have to make sure TARGET is set
718   # properly.
719  
720 + .if defined(KERNFAST)
721 + NO_KERNELCLEAN= t
722 + NO_KERNELCONFIG=        t
723 + NO_KERNELDEPEND=        t
724 + NO_KERNELOBJ=           t
725 + # Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah
726 + .if !defined(KERNCONF) && ${KERNFAST} != "1"
727 + KERNCONF=${KERNFAST}
728 + .endif
729 + .endif
730   .if !defined(KERNCONF) && defined(KERNEL)
731   KERNCONF=       ${KERNEL}
732   KERNWARN=
# Line 653 | Line 789 | buildkernel:
789          @echo "--------------------------------------------------------------"
790          @echo ">>> stage 2.1: cleaning up the object tree"
791          @echo "--------------------------------------------------------------"
792 <        cd ${KRNLOBJDIR}/${_kernel}; \
657 <            ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} ${CLEANDIR}
792 >        cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR}
793   .endif
794 + .if !defined(NO_KERNELOBJ)
795          @echo
796          @echo "--------------------------------------------------------------"
797          @echo ">>> stage 2.2: rebuilding the object tree"
798          @echo "--------------------------------------------------------------"
799 <        cd ${KRNLOBJDIR}/${_kernel}; \
800 <            ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} obj
799 >        cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj
800 > .endif
801          @echo
802          @echo "--------------------------------------------------------------"
803          @echo ">>> stage 2.3: build tools"
804          @echo "--------------------------------------------------------------"
805          cd ${KRNLOBJDIR}/${_kernel}; \
806 +            PATH=${BPATH}:${PATH} \
807              MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
808 <            ${MAKE} -DNO_CPU_CFLAGS -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
808 >            ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \
809 >            -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
810   # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
811   .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
812   .for target in obj depend all
813          cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \
814 +            PATH=${BPATH}:${PATH} \
815              MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \
816 <            ${MAKE} -DNO_CPU_CFLAGS ${target}
816 >            ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF ${target}
817   .endfor
818   .endif
819   .if !defined(NO_KERNELDEPEND)
# Line 682 | Line 821 | buildkernel:
821          @echo "--------------------------------------------------------------"
822          @echo ">>> stage 3.1: making dependencies"
823          @echo "--------------------------------------------------------------"
824 <        cd ${KRNLOBJDIR}/${_kernel}; \
686 <            ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend -DNO_MODULES_OBJ
824 >        cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ
825   .endif
826          @echo
827          @echo "--------------------------------------------------------------"
828          @echo ">>> stage 3.2: building everything"
829          @echo "--------------------------------------------------------------"
830 <        cd ${KRNLOBJDIR}/${_kernel}; \
693 <            ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all -DNO_MODULES_OBJ
830 >        cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
831          @echo "--------------------------------------------------------------"
832          @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
833          @echo "--------------------------------------------------------------"
# Line 702 | Line 839 | buildkernel:
839   # Install the kernel defined by INSTALLKERNEL
840   #
841   installkernel installkernel.debug \
842 < reinstallkernel reinstallkernel.debug: ${SPECIAL_INSTALLCHECKS}
842 > reinstallkernel reinstallkernel.debug: installcheck
843   .if empty(INSTALLKERNEL)
844          @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
845          false
846   .endif
847          @echo "--------------------------------------------------------------"
848 <        @echo ">>> Installing kernel"
848 >        @echo ">>> Installing kernel ${INSTALLKERNEL}"
849          @echo "--------------------------------------------------------------"
850          cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
851              ${CROSSENV} PATH=${TMPPATH} \
852              ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
853  
854 + distributekernel distributekernel.debug:
855 + .if empty(INSTALLKERNEL)
856 +        @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
857 +        false
858 + .endif
859 +        cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
860 +            ${CROSSENV} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \
861 +            DESTDIR=${DESTDIR}/${DISTDIR}/kernel \
862 +            ${.TARGET:S/distributekernel/install/}
863 +
864 + packagekernel:
865 +        ${_+_}cd ${DESTDIR}/${DISTDIR}/kernel; \
866 +            tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz .
867 +
868   #
869 + # doxygen
870 + #
871 + # Build the API documentation with doxygen
872 + #
873 + doxygen:
874 +        @if [ ! -x `/usr/bin/which doxygen` ]; then \
875 +                echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \
876 +                exit 1; \
877 +        fi
878 +        cd ${.CURDIR}/tools/kerneldoc/subsys && ${MAKE} obj all
879 +
880 + #
881   # update
882   #
883   # Update the source tree, by running cvsup and/or running cvs to update to the
# Line 763 | Line 926 | update:
926   # legacy: Build compatibility shims for the next three targets
927   #
928   legacy:
766 .if ${BOOTSTRAPPING} < 503000
767        @echo "ERROR: Source upgrades from versions prior to 5.3 not supported."; \
768        false
769 .endif
929   .for _tool in tools/build
930          ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \
931              cd ${.CURDIR}/${_tool}; \
# Line 780 | Line 939 | legacy:
939   #
940   # bootstrap-tools: Build tools needed for compatibility
941   #
942 < .if !defined(NO_GAMES)
942 > .if ${MK_GAMES} != "no"
943   _strfile=       games/fortune/strfile
944   .endif
945  
946 < .if !defined(NO_CXX)
946 > .if ${MK_CXX} != "no"
947   _gperf=         gnu/usr.bin/gperf
948 < .if ${BOOTSTRAPPING} < 600101
948 > .if ${BOOTSTRAPPING} < 700004
949   _groff=         gnu/usr.bin/groff
950   .else
951   _groff=         gnu/usr.bin/groff/tmac
952   .endif
953   .endif
954  
955 < .if ${BOOTSTRAPPING} < 600029
797 < _texinfo=       gnu/usr.bin/texinfo
798 < .endif
799 <
800 < .if ${BOOTSTRAPPING} < 600015
801 < _cap_mkdb=      usr.bin/cap_mkdb
802 < .endif
803 <
804 < .if ${BOOTSTRAPPING} < 600018
805 < _colldef=       usr.bin/colldef
806 < .endif
807 <
808 < .if ${BOOTSTRAPPING} < 600017
809 < _gencat=        usr.bin/gencat
810 < .endif
811 <
812 < .if ${BOOTSTRAPPING} < 600016
813 < _mklocale=      usr.bin/mklocale
814 < .endif
815 <
816 < .if ${BOOTSTRAPPING} < 600106
955 > .if ${BOOTSTRAPPING} < 700018
956   _gensnmptree=   usr.sbin/bsnmpd/gensnmptree
957   .endif
958  
959 < .if !defined(NO_RESCUE) && \
960 <    ${BOOTSTRAPPING} < 600008
959 > .if ${MK_RESCUE} != "no" && \
960 >    ${BOOTSTRAPPING} < 700026
961   _crunchgen=     usr.sbin/crunch/crunchgen
962   .endif
963  
825 .if ${BOOTSTRAPPING} < 600020
826 _pwd_mkdb=      usr.sbin/pwd_mkdb
827 .endif
828
964   bootstrap-tools:
965   .for _tool in \
966      ${_strfile} \
967      ${_gperf} \
968      ${_groff} \
834    ${_texinfo} \
835    ${_cap_mkdb} \
836    ${_colldef} \
837    ${_gencat} \
969      usr.bin/lorder \
970      usr.bin/makewhatis \
840    ${_mklocale} \
971      usr.bin/rpcgen \
842    ${_gensnmptree} \
972      usr.bin/xinstall \
973 +    ${_gensnmptree} \
974      usr.sbin/config \
975 <    ${_crunchgen} \
846 <    ${_pwd_mkdb}
975 >    ${_crunchgen}
976          ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
977                  cd ${.CURDIR}/${_tool}; \
978                  ${MAKE} DIRPRFX=${_tool}/ obj; \
# Line 863 | Line 992 | _aicasm= sys/modules/aic7xxx/aicasm
992   _share= share/syscons/scrnmaps
993   .endif
994  
995 < .if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL)
995 > .if ${MK_KERBEROS} != "no"
996   _kerberos5_tools= kerberos5/tools
997   .endif
998  
999 < .if !defined(NO_RESCUE)
999 > .if ${MK_RESCUE} != "no"
1000   _rescue= rescue/rescue
1001   .endif
1002  
# Line 876 | Line 1005 | build-tools:
1005      bin/csh \
1006      bin/sh \
1007      ${_rescue} \
1008 <    lib/libncurses \
1008 >    ${LOCAL_TOOL_DIRS} \
1009 >    lib/ncurses/ncurses \
1010 >    lib/ncurses/ncursesw \
1011      ${_share} \
1012      ${_aicasm} \
1013      usr.bin/awk \
# Line 900 | Line 1031 | build-tools:
1031   #
1032   # cross-tools: Build cross-building tools
1033   #
1034 < .if (${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386") && \
1035 <    ${TARGET_ARCH} != ${MACHINE_ARCH}
1034 > .if ${TARGET_ARCH} != ${MACHINE_ARCH}
1035 > .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
1036   _btxld=         usr.sbin/btxld
1037   .endif
1038 <
908 < .if (!defined(NO_RESCUE) || defined(RELEASEDIR)) && \
909 <    ${TARGET_ARCH} != ${MACHINE_ARCH}
1038 > .if ${MK_RESCUE} != "no" || defined(RELEASEDIR)
1039   _crunchide=     usr.sbin/crunch/crunchide
1040   .endif
1041 <
913 < .if ${TARGET_ARCH} == "i386" && ${TARGET_ARCH} != ${MACHINE_ARCH} && \
914 <    defined(RELEASEDIR)
1041 > .if ${TARGET_ARCH} == "i386" && defined(RELEASEDIR)
1042   _kgzip=         usr.sbin/kgzip
1043   .endif
1044 + .endif
1045  
1046   cross-tools:
1047   .for _tool in \
1048      gnu/usr.bin/binutils \
1049      gnu/usr.bin/cc \
1050 +    usr.bin/sed \
1051      usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
1052      ${_btxld} \
1053      ${_crunchide} \
# Line 946 | Line 1075 | hierarchy:
1075   #
1076   libraries:
1077          cd ${.CURDIR}; \
1078 +            ${MAKE} -f Makefile.inc1 _prereq_libs; \
1079              ${MAKE} -f Makefile.inc1 _startup_libs; \
1080              ${MAKE} -f Makefile.inc1 _prebuild_libs; \
1081              ${MAKE} -f Makefile.inc1 _generic_libs;
1082  
1083 + #
1084 + # static libgcc.a prerequisite for shared libc
1085 + #
1086 + _prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc
1087 +
1088   # These dependencies are not automatically generated:
1089   #
1090 < # gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
1091 < # shared libraries for ELF.
1090 > # gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before
1091 > # all shared libraries for ELF.
1092   #
1093 < _startup_libs=  gnu/lib/csu gnu/lib/libgcc
1093 > _startup_libs=  gnu/lib/csu
1094   .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
1095   _startup_libs+= lib/csu/${MACHINE_ARCH}-elf
1096   .else
1097   _startup_libs+= lib/csu/${MACHINE_ARCH}
1098   .endif
1099 + _startup_libs+= gnu/lib/libgcc
1100 + _startup_libs+= lib/libc
1101  
1102 < _prebuild_libs=
1102 > gnu/lib/libgcc__L: lib/libc__L
1103  
1104 < _generic_libs=  gnu/lib
1104 > _prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libkrb5} \
1105 >                ${_kerberos5_lib_libroken} \
1106 >                lib/libbz2 lib/libcom_err lib/libcrypt \
1107 >                lib/libexpat \
1108 >                ${_lib_libgssapi} ${_lib_libipx} \
1109 >                lib/libkiconv lib/libkvm lib/libmd \
1110 >                lib/ncurses/ncurses lib/ncurses/ncursesw \
1111 >                lib/libopie lib/libpam ${_default_thread_lib} \
1112 >                lib/libradius lib/libsbuf lib/libtacplus lib/libutil \
1113 >                ${_lib_libypclnt} lib/libz lib/msun \
1114 >                ${_secure_lib_libcrypto} ${_secure_lib_libssh} \
1115 >                ${_secure_lib_libssl} lib/libsqlite3 lib/liblzma \
1116 >                lib/libarchive lib/libfetch lib/libmagic
1117  
1118 < .if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL)
1119 < _prebuild_libs+=        kerberos5/lib/libasn1
1120 < _prebuild_libs+=        kerberos5/lib/libgssapi
1121 < _prebuild_libs+=        kerberos5/lib/libkrb5
1122 < _prebuild_libs+=        kerberos5/lib/libroken
1123 < _generic_libs+= kerberos5/lib
1118 > .if ${MK_LIBTHR} != "no" && ${MK_LIBKSE} != "no"
1119 > _default_thread_lib=    lib/${DEFAULT_THREAD_LIB}
1120 > .elif ${MK_LIBTHR} != "no"
1121 > _default_thread_lib=    lib/libthr
1122 > .elif ${MK_LIBKSE} != "no"
1123 > _default_thread_lib=    lib/libkse
1124   .endif
1125  
1126 < _prebuild_libs+= lib/libcom_err lib/libcrypt lib/libexpat \
978 <                lib/libkvm lib/libmd \
979 <                lib/libncurses lib/libnetgraph lib/libopie lib/libpam \
980 <                lib/libradius \
981 <                lib/libsbuf lib/libtacplus lib/libutil \
982 <                lib/libz lib/msun
1126 > _generic_libs=  ${_apache_lib} ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib
1127  
1128   lib/libopie__L lib/libtacplus__L: lib/libmd__L
1129  
1130 < _generic_libs+= lib
1130 > .if ${MK_APACHE} != "no"
1131 > _apache_lib= apache/lib
1132 > .endif
1133  
1134 < .if !defined(NO_CRYPT)
1135 < .if !defined(NO_OPENSSL)
1136 < _prebuild_libs+=        secure/lib/libcrypto secure/lib/libssl
1137 < lib/libradius__L: secure/lib/libssl__L
1138 < secure/lib/libssl__L: secure/lib/libcrypto__L
1139 < .if !defined(NO_OPENSSH)
1140 < _prebuild_libs+=        secure/lib/libssh
1134 > .if ${MK_CDDL} != "no"
1135 > _cddl_lib= cddl/lib
1136 > .endif
1137 >
1138 > .if ${MK_CRYPT} != "no"
1139 > .if ${MK_OPENSSL} != "no"
1140 > _secure_lib_libcrypto= secure/lib/libcrypto
1141 > _secure_lib_libssl= secure/lib/libssl
1142 > lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L
1143 > .if ${MK_OPENSSH} != "no"
1144 > _secure_lib_libssh= secure/lib/libssh
1145   secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L
1146 < .if !defined(NO_KERBEROS)
1147 < secure/lib/libssh__L: kerberos5/lib/libgssapi__L kerberos5/lib/libkrb5__L \
1146 > .if ${MK_KERBEROS} != "no"
1147 > secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \
1148      kerberos5/lib/libasn1__L lib/libcom_err__L lib/libmd__L \
1149      kerberos5/lib/libroken__L
1150   .endif
1151   .endif
1152   .endif
1153 < _generic_libs+= secure/lib
1153 > _secure_lib=    secure/lib
1154   .endif
1155  
1156 < .if defined(NO_CRYPT) || defined(NO_OPENSSL)
1157 < lib/libradius__L: lib/libmd__L
1156 > .if ${MK_IPX} != "no"
1157 > _lib_libipx=    lib/libipx
1158   .endif
1159  
1160 < .if !defined(NO_NIS)
1161 < _prebuild_libs+=        lib/libypclnt
1160 > .if ${MK_KERBEROS} != "no"
1161 > _kerberos5_lib= kerberos5/lib
1162 > _kerberos5_lib_libasn1= kerberos5/lib/libasn1
1163 > _kerberos5_lib_libkrb5= kerberos5/lib/libkrb5
1164 > _kerberos5_lib_libroken= kerberos5/lib/libroken
1165 > _lib_libgssapi= lib/libgssapi
1166   .endif
1167  
1168 < _generic_libs+= usr.bin/lex/lib
1168 > .if ${MK_NIS} != "no"
1169 > _lib_libypclnt= lib/libypclnt
1170 > .endif
1171  
1172 < .if ${MACHINE} == "i386"
1173 < _generic_libs+= usr.sbin/pcvt/keycap
1172 > .if ${MK_OPENSSL} == "no"
1173 > lib/libradius__L: lib/libmd__L
1174   .endif
1175  
1176 + .for _lib in ${_prereq_libs}
1177 + ${_lib}__PL: .PHONY
1178 + .if exists(${.CURDIR}/${_lib})
1179 +        ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
1180 +                cd ${.CURDIR}/${_lib}; \
1181 +                ${MAKE} DIRPRFX=${_lib}/ obj; \
1182 +                ${MAKE} DIRPRFX=${_lib}/ depend; \
1183 +                ${MAKE} -DNO_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all; \
1184 +                ${MAKE} -DNO_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install
1185 + .endif
1186 + .endfor
1187 +
1188   .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
1189   ${_lib}__L: .PHONY
1190   .if exists(${.CURDIR}/${_lib})
1191 <        ${_+_}@${ECHODIR} "===> ${_lib} (depend,all,install)"; \
1191 >        ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
1192                  cd ${.CURDIR}/${_lib}; \
1193 +                ${MAKE} DIRPRFX=${_lib}/ obj; \
1194                  ${MAKE} DIRPRFX=${_lib}/ depend; \
1195                  ${MAKE} DIRPRFX=${_lib}/ all; \
1196                  ${MAKE} DIRPRFX=${_lib}/ install
# Line 1032 | Line 1201 | ${_lib}__L: .PHONY
1201   # static PAM library, and dynamic PAM library before dynamic PAM
1202   # modules.
1203   lib/libpam__L: .PHONY
1204 <        ${_+_}@${ECHODIR} "===> lib/libpam (depend,all,install)"; \
1204 >        ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \
1205                  cd ${.CURDIR}/lib/libpam; \
1206 +                ${MAKE} DIRPRFX=lib/libpam/ obj; \
1207                  ${MAKE} DIRPRFX=lib/libpam/ depend; \
1208                  ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \
1209                  ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install
1210  
1211 + _prereq_libs: ${_prereq_libs:S/$/__PL/}
1212   _startup_libs: ${_startup_libs:S/$/__L/}
1213   _prebuild_libs: ${_prebuild_libs:S/$/__L/}
1214   _generic_libs: ${_generic_libs:S/$/__L/}
# Line 1061 | Line 1232 | par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
1232  
1233   .include <bsd.subdir.mk>
1234  
1235 < .if make(delete-old) || make(delete-old-libs) || make(check-old)
1235 > .if make(check-old) || make(check-old-dirs) || \
1236 >    make(check-old-files) || make(check-old-libs) || \
1237 >    make(delete-old) || make(delete-old-dirs) || \
1238 >    make(delete-old-files) || make(delete-old-libs)
1239  
1240   #
1241   # check for / delete old files section
# Line 1082 | Line 1256 | RM_I=-v
1256  
1257   delete-old-files:
1258          @echo ">>> Removing old files (only deletes safe to delete libs)"
1085 .for file in ${OLD_FILES}
1259   # Ask for every old file if the user really wants to remove it.
1260   # It's annoying, but better safe than sorry.
1261 <        @[ ! -f "${DESTDIR}/${file}" ] || (rm ${RM_I} "${DESTDIR}/${file}" \
1262 <                ||  ([ -f "${DESTDIR}/${file}" ] \
1263 <                        && echo "Removing schg flag on ${DESTDIR}/${file}" \
1264 <                        && chflags noschg "${DESTDIR}/${file}" \
1265 <                        && rm ${RM_I} "${DESTDIR}/${file}"))
1266 < .endfor
1261 > # NB: We cannot pass the list of OLD_FILES as a parameter because the
1262 > # argument list will get too long. Using .for/.endfor make "loops" will make
1263 > # the Makefile parser segfault.
1264 >        @exec 3<&0; \
1265 >        ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
1266 >            -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
1267 >        while read file; do \
1268 >                if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1269 >                        chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
1270 >                        rm ${RM_I} "${DESTDIR}/$${file}" <&3; \
1271 >                fi; \
1272 >        done
1273   # Remove catpages without corresponding manpages.
1274 <        @3<&0; \
1274 >        @exec 3<&0; \
1275          find ${DESTDIR}/usr/share/man/cat* ! -type d | \
1276          sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
1277          while read catpage; do \
1278                  read manpage; \
1279                  if [ ! -e "$${manpage}" ]; then \
1280 <                        rm ${RM_I} $${catpage} <&3 ; \
1280 >                        rm ${RM_I} $${catpage} <&3; \
1281                  fi; \
1282          done
1283          @echo ">>> Old files removed"
1284  
1285   check-old-files:
1286          @echo ">>> Checking for old files"
1287 < .for file in ${OLD_FILES}
1288 <        @[ ! -f "${DESTDIR}/${file}" ] || echo "${DESTDIR}/${file}"
1289 < .endfor
1287 >        @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
1288 >            -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
1289 >        while read file; do \
1290 >                if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1291 >                        echo "${DESTDIR}/$${file}"; \
1292 >                fi; \
1293 >        done
1294   # Check for catpages without corresponding manpages.
1295          @find ${DESTDIR}/usr/share/man/cat* ! -type d | \
1296          sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
1297          while read catpage; do \
1298                  read manpage; \
1299                  if [ ! -e "$${manpage}" ]; then \
1300 <                        echo $${catpage} ; \
1300 >                        echo $${catpage}; \
1301                  fi; \
1302          done
1303  
1304   delete-old-libs:
1305          @echo ">>> Removing old libraries"
1306          @echo "${OLD_LIBS_MESSAGE}" | fmt
1307 < .for file in ${OLD_LIBS}
1308 <        @[ ! -f "${DESTDIR}/${file}" ] || (rm ${RM_I} "${DESTDIR}/${file}" \
1309 <                ||  ([ -f "${DESTDIR}/${file}" ] \
1310 <                        && echo "Removing schg flag on ${DESTDIR}/${file}" \
1311 <                        && chflags noschg "${DESTDIR}/${file}" \
1312 <                        && rm ${RM_I} "${DESTDIR}/${file}"))
1313 < .endfor
1307 >        @exec 3<&0; \
1308 >        ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
1309 >            -V OLD_LIBS | xargs -n1 | \
1310 >        while read file; do \
1311 >                if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1312 >                        chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
1313 >                        rm ${RM_I} "${DESTDIR}/$${file}" <&3; \
1314 >                fi; \
1315 >        done
1316          @echo ">>> Old libraries removed"
1317  
1318   check-old-libs:
1319          @echo ">>> Checking for old libraries"
1320 < .for file in ${OLD_LIBS}
1321 <        @[ ! -f "${DESTDIR}/${file}" ] || echo "${DESTDIR}/${file}"
1322 < .endfor
1320 >        @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
1321 >            -V OLD_LIBS | xargs -n1 | \
1322 >        while read file; do \
1323 >                if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1324 >                        echo "${DESTDIR}/$${file}"; \
1325 >                fi; \
1326 >        done
1327  
1328   delete-old-dirs:
1329          @echo ">>> Removing old directories"
1330 < .for dir in ${OLD_DIRS}
1331 < # Don't fail if an old directory isn't empty.
1332 <        @[ ! -d "${DESTDIR}/${dir}" ] || (rmdir -v "${DESTDIR}/${dir}" || true)
1333 < .endfor
1330 >        @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
1331 >            -V OLD_DIRS | xargs -n1 | \
1332 >        while read dir; do \
1333 >                if [ -d "${DESTDIR}/$${dir}" ]; then \
1334 >                        rmdir -v "${DESTDIR}/$${dir}" || true; \
1335 >                elif [ -L "${DESTDIR}/$${dir}" ]; then \
1336 >                        echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
1337 >                fi; \
1338 >        done
1339          @echo ">>> Old directories removed"
1340  
1341   check-old-dirs:
1342          @echo ">>> Checking for old directories"
1343 < .for dir in ${OLD_DIRS}
1344 <        @[ ! -d "${DESTDIR}/${dir}" ] || echo "${DESTDIR}/${dir}"
1345 < .endfor
1343 >        @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
1344 >            -V OLD_DIRS | xargs -n1 | \
1345 >        while read dir; do \
1346 >                if [ -d "${DESTDIR}/$${dir}" ]; then \
1347 >                        echo "${DESTDIR}/$${dir}"; \
1348 >                elif [ -L "${DESTDIR}/$${dir}" ]; then \
1349 >                        echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
1350 >                fi; \
1351 >        done
1352  
1353   delete-old: delete-old-files delete-old-dirs
1354          @echo "To remove old libraries run '${MAKE} delete-old-libs'."
# Line 1159 | Line 1359 | check-old: check-old-files check-old-libs check-old-di
1359  
1360   .endif
1361  
1362 + #
1363 + # showconfig - show build configuration.
1364 + #
1365 + showconfig:
1366 +        @${MAKE} -n -f bsd.own.mk -V dummy -dg1 | grep ^MK_ | sort

Comparing trunk/Makefile.inc1 (property cvs2svn:cvs-rev):
Revision 687 by laffer1, Fri Jan 19 02:22:33 2007 UTC vs.
Revision 4657 by laffer1, Sun Feb 19 23:07:13 2012 UTC

# Line 1 | Line 1
1 < 1.7
1 > 1.38

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines