ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/src/trunk/Makefile.inc1
Revision: 3883
Committed: Sun Mar 13 17:16:38 2011 UTC (13 years, 1 month ago) by laffer1
File size: 37688 byte(s)
Log Message:
Build 32bit apache libs

File Contents

# Content
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.28 2011/03/13 02:05:39 laffer1 Exp $
4 #
5 # Make command line options:
6 # -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
7 # -DNO_CLEAN do not clean at all
8 # -DNO_SHARE do not go into share subdir
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="machine" to crossbuild world for a different machine type
16
17 #
18 # The intended user-driven targets are:
19 # buildworld - rebuild *everything*, including glue to help do upgrades
20 # installworld- install everything built by "buildworld"
21 # doxygen - build API documentation of the kernel
22 # update - convenient way to update your source tree (eg: cvsup/cvs)
23 #
24 # Standard targets (not defined here) are documented in the makefiles in
25 # /usr/share/mk. These include:
26 # obj depend all install clean cleandepend cleanobj
27
28 .include <bsd.own.mk>
29
30 # We must do share/info early so that installation of info `dir'
31 # entries works correctly. Do it first since it is less likely to
32 # grow dependencies on include and lib than vice versa.
33 #
34 # We must do lib/ and libexec/ before bin/, because if installworld
35 # installs a new /bin/sh, the 'make' command will *immediately*
36 # use that new version. And the new (dynamically-linked) /bin/sh
37 # will expect to find appropriate libraries in /lib and /libexec.
38 #
39 SUBDIR= share/info lib libexec
40 SUBDIR+=bin
41 .if ${MK_APACHE} != "no"
42 SUBDIR+=apache
43 .endif
44 .if ${MK_GAMES} != "no"
45 SUBDIR+=games
46 .endif
47 .if ${MK_CDDL} != "no"
48 SUBDIR+=cddl
49 .endif
50 SUBDIR+=gnu include
51 .if ${MK_KERBEROS} != "no"
52 SUBDIR+=kerberos5
53 .endif
54 .if ${MK_RESCUE} != "no"
55 SUBDIR+=rescue
56 .endif
57 SUBDIR+=sbin
58 .if ${MK_CRYPT} != "no"
59 SUBDIR+=secure
60 .endif
61 .if !defined(NO_SHARE)
62 SUBDIR+=share
63 .endif
64 SUBDIR+=sys usr.bin usr.sbin
65 #
66 # We must do etc/ last for install/distribute to work.
67 #
68 SUBDIR+=etc
69
70 # These are last, since it is nice to at least get the base system
71 # rebuilt before you do them.
72 .for _DIR in ${LOCAL_DIRS}
73 .if exists(${.CURDIR}/${_DIR}/Makefile)
74 SUBDIR+= ${_DIR}
75 .endif
76 .endfor
77
78 .if defined(SUBDIR_OVERRIDE)
79 SUBDIR= ${SUBDIR_OVERRIDE}
80 .endif
81
82 .if defined(NOCLEAN)
83 NO_CLEAN= ${NOCLEAN}
84 .endif
85 .if defined(NO_CLEANDIR)
86 CLEANDIR= clean cleandepend
87 .else
88 CLEANDIR= cleandir
89 .endif
90
91 CVS?= cvs
92 CVSFLAGS?= -r . -P -d -I!
93 SUP?= /usr/local/bin/cvsup
94 SUPFLAGS?= -g -L 2
95 .if defined(SUPHOST)
96 SUPFLAGS+= -h ${SUPHOST}
97 .endif
98
99 MAKEOBJDIRPREFIX?= /usr/obj
100 .if !defined(OSRELDATE)
101 .if exists(/usr/include/osreldate.h)
102 OSRELDATE!= awk '/^\#define[[:space:]]*__MidnightBSD_version/ { print $$3 }' \
103 /usr/include/osreldate.h
104 .else
105 OSRELDATE= 0
106 .endif
107 .endif
108
109 # Guess machine architecture from machine type, and vice versa.
110 .if !defined(TARGET_ARCH) && defined(TARGET)
111 TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/}
112 .elif !defined(TARGET) && defined(TARGET_ARCH) && \
113 ${TARGET_ARCH} != ${MACHINE_ARCH}
114 TARGET= ${TARGET_ARCH}
115 .endif
116 # Otherwise, default to current machine type and architecture.
117 TARGET?= ${MACHINE}
118 TARGET_ARCH?= ${MACHINE_ARCH}
119
120 KNOWN_ARCHES?= amd64 i386 sparc64 sparc64/sun4v
121 .if ${TARGET} == ${TARGET_ARCH}
122 _t= ${TARGET}
123 .else
124 _t= ${TARGET_ARCH}/${TARGET}
125 .endif
126 .for _t in ${_t}
127 .if empty(KNOWN_ARCHES:M${_t})
128 .error Unknown target ${TARGET_ARCH}:${TARGET}.
129 .endif
130 .endfor
131
132 .if ${TARGET} == ${MACHINE}
133 TARGET_CPUTYPE?=${CPUTYPE}
134 .else
135 TARGET_CPUTYPE?=
136 .endif
137
138 .if !empty(TARGET_CPUTYPE)
139 _TARGET_CPUTYPE=${TARGET_CPUTYPE}
140 .else
141 _TARGET_CPUTYPE=dummy
142 .endif
143 _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} \
144 -f /dev/null -m ${.CURDIR}/share/mk -V CPUTYPE
145 .if ${_CPUTYPE} != ${_TARGET_CPUTYPE}
146 .error CPUTYPE global should be set with ?=.
147 .endif
148 .if make(buildworld)
149 BUILD_ARCH!= uname -p
150 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
151 .error To cross-build, set TARGET_ARCH.
152 .endif
153 .endif
154 .if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING)
155 OBJTREE= ${MAKEOBJDIRPREFIX}
156 .else
157 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}
158 .endif
159 WORLDTMP= ${OBJTREE}${.CURDIR}/tmp
160 # /usr/games added for fortune which depend on strfile
161 BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games
162 XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
163 STRICTTMPPATH= ${BPATH}:${XPATH}
164 TMPPATH= ${STRICTTMPPATH}:${PATH}
165
166 INSTALLTMP!= /usr/bin/mktemp -d -u -t install
167
168 #
169 # Building a world goes through the following stages
170 #
171 # 1. legacy stage [BMAKE]
172 # This stage is responsible for creating compatibility
173 # shims that are needed by the bootstrap-tools,
174 # build-tools and cross-tools stages.
175 # 1. bootstrap-tools stage [BMAKE]
176 # This stage is responsible for creating programs that
177 # are needed for backward compatibility reasons. They
178 # are not built as cross-tools.
179 # 2. build-tools stage [TMAKE]
180 # This stage is responsible for creating the object
181 # tree and building any tools that are needed during
182 # the build process.
183 # 3. cross-tools stage [XMAKE]
184 # This stage is responsible for creating any tools that
185 # are needed for cross-builds. A cross-compiler is one
186 # of them.
187 # 4. world stage [WMAKE]
188 # This stage actually builds the world.
189 # 5. install stage (optional) [IMAKE]
190 # This stage installs a previously built world.
191 #
192
193 BOOTSTRAPPING?= 0
194
195 # Common environment for world related stages
196 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
197 MACHINE_ARCH=${TARGET_ARCH} \
198 MACHINE=${TARGET} \
199 CPUTYPE=${TARGET_CPUTYPE} \
200 GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \
201 GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \
202 GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac
203
204 # bootstrap-tools stage
205 BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
206 PATH=${BPATH}:${PATH} \
207 WORLDTMP=${WORLDTMP} \
208 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
209 BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
210 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
211 DESTDIR= \
212 BOOTSTRAPPING=${OSRELDATE} \
213 -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
214 -DWITHOUT_NLS -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \
215 -DNO_CPU_CFLAGS -DNO_WARNS
216
217 # build-tools stage
218 TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
219 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
220 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
221 DESTDIR= \
222 BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS
223
224 # cross-tools stage
225 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
226 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
227 -DWITHOUT_GDB
228
229 # world stage
230 WMAKEENV= ${CROSSENV} \
231 _SHLIBDIRPREFIX=${WORLDTMP} \
232 INSTALL="sh ${.CURDIR}/tools/install.sh" \
233 PATH=${TMPPATH}
234 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP}
235
236 .if ${TARGET_ARCH} == "amd64"
237 # 32 bit world
238 LIB32TMP= ${OBJTREE}${.CURDIR}/lib32
239
240 .if empty(TARGET_CPUTYPE)
241 LIB32CPUTYPE= k8
242 .else
243 LIB32CPUTYPE= ${TARGET_CPUTYPE}
244 .endif
245 LIB32FLAGS= -m32 -march=${LIB32CPUTYPE} -mfancy-math-387 -DCOMPAT_32BIT \
246 -iprefix ${LIB32TMP}/usr/ \
247 -L${LIB32TMP}/usr/lib32 \
248 -B${LIB32TMP}/usr/lib32
249
250 # Yes, the flags are redundant.
251 LIB32WMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
252 _SHLIBDIRPREFIX=${LIB32TMP} \
253 MACHINE=i386 \
254 MACHINE_ARCH=i386 \
255 INSTALL="sh ${.CURDIR}/tools/install.sh" \
256 PATH=${TMPPATH} \
257 CC="${CC} ${LIB32FLAGS}" \
258 CXX="${CXX} ${LIB32FLAGS}" \
259 OBJC="${OBJC} ${LIB32FLAGS}" \
260 LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \
261 AS="${AS} --32" \
262 LIBDIR=/usr/lib32 \
263 SHLIBDIR=/usr/lib32
264
265 LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \
266 -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_INFO \
267 -DWITHOUT_HTML DESTDIR=${LIB32TMP}
268 LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS
269 .endif
270
271 # install stage
272 .if empty(.MAKEFLAGS:M-n)
273 IMAKEENV= ${CROSSENV} \
274 PATH=${STRICTTMPPATH}:${INSTALLTMP}
275 .else
276 IMAKEENV= ${CROSSENV} \
277 PATH=${TMPPATH}:${INSTALLTMP}
278 .endif
279 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
280
281 # kernel stage
282 KMAKEENV= ${WMAKEENV}
283 KMAKE= ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME}
284
285 #
286 # buildworld
287 #
288 # Attempt to rebuild the entire system, with reasonable chance of
289 # success, regardless of how old your existing system is.
290 #
291 _worldtmp:
292 .if ${.CURDIR:C/[^,]//g} != ""
293 # The m4 build of sendmail files doesn't like it if ',' is used
294 # anywhere in the path of it's files.
295 @echo
296 @echo "*** Error: path to source tree contains a comma ','"
297 @echo
298 false
299 .endif
300 @echo
301 @echo "--------------------------------------------------------------"
302 @echo ">>> Rebuilding the temporary build tree"
303 @echo "--------------------------------------------------------------"
304 .if !defined(NO_CLEAN)
305 rm -rf ${WORLDTMP}
306 .if ${TARGET_ARCH} == "amd64"
307 rm -rf ${LIB32TMP}
308 .endif
309 .else
310 rm -rf ${WORLDTMP}/legacy/usr/include
311 # XXX - These two can depend on any header file.
312 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
313 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
314 .endif
315 .for _dir in \
316 usr/bin usr/games usr/include/sys usr/lib \
317 usr/libexec usr/sbin usr/share/dict \
318 usr/share/groff_font/devX100 \
319 usr/share/groff_font/devX100-12 \
320 usr/share/groff_font/devX75 \
321 usr/share/groff_font/devX75-12 \
322 usr/share/groff_font/devascii \
323 usr/share/groff_font/devcp1047 \
324 usr/share/groff_font/devdvi \
325 usr/share/groff_font/devhtml \
326 usr/share/groff_font/devkoi8-r \
327 usr/share/groff_font/devlatin1 \
328 usr/share/groff_font/devlbp \
329 usr/share/groff_font/devlj4 \
330 usr/share/groff_font/devps \
331 usr/share/groff_font/devutf8 \
332 usr/share/tmac/mdoc usr/share/tmac/mm
333 mkdir -p ${WORLDTMP}/legacy/${_dir}
334 .endfor
335 .for _dir in \
336 lib usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \
337 usr/libdata/pkgconfig usr/libexec usr/sbin usr/share/misc
338 mkdir -p ${WORLDTMP}/${_dir}
339 .endfor
340 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
341 -p ${WORLDTMP}/usr/include >/dev/null
342 ln -sf ${.CURDIR}/sys ${WORLDTMP}
343 .if ${MK_BIND_LIBS} != "no"
344 mtree -deU -f ${.CURDIR}/etc/mtree/BIND.include.dist \
345 -p ${WORLDTMP}/usr/include >/dev/null
346 .endif
347 _legacy:
348 @echo
349 @echo "--------------------------------------------------------------"
350 @echo ">>> stage 1.1: legacy release compatibility shims"
351 @echo "--------------------------------------------------------------"
352 ${_+_}cd ${.CURDIR}; ${BMAKE} legacy
353 _bootstrap-tools:
354 @echo
355 @echo "--------------------------------------------------------------"
356 @echo ">>> stage 1.2: bootstrap tools"
357 @echo "--------------------------------------------------------------"
358 ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools
359 _cleanobj:
360 .if !defined(NO_CLEAN)
361 @echo
362 @echo "--------------------------------------------------------------"
363 @echo ">>> stage 2.1: cleaning up the object tree"
364 @echo "--------------------------------------------------------------"
365 ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
366 .if ${TARGET_ARCH} == "amd64"
367 ${_+_}cd ${.CURDIR}; ${LIB32WMAKE} -f Makefile.inc1 ${CLEANDIR:S/^/par-/}
368 .endif
369 .endif
370 _obj:
371 @echo
372 @echo "--------------------------------------------------------------"
373 @echo ">>> stage 2.2: rebuilding the object tree"
374 @echo "--------------------------------------------------------------"
375 ${_+_}cd ${.CURDIR}; ${WMAKE} par-obj
376 _build-tools:
377 @echo
378 @echo "--------------------------------------------------------------"
379 @echo ">>> stage 2.3: build tools"
380 @echo "--------------------------------------------------------------"
381 ${_+_}cd ${.CURDIR}; ${TMAKE} build-tools
382 _cross-tools:
383 @echo
384 @echo "--------------------------------------------------------------"
385 @echo ">>> stage 3: cross tools"
386 @echo "--------------------------------------------------------------"
387 ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
388 _includes:
389 @echo
390 @echo "--------------------------------------------------------------"
391 @echo ">>> stage 4.1: building includes"
392 @echo "--------------------------------------------------------------"
393 ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
394 _libraries:
395 @echo
396 @echo "--------------------------------------------------------------"
397 @echo ">>> stage 4.2: building libraries"
398 @echo "--------------------------------------------------------------"
399 ${_+_}cd ${.CURDIR}; \
400 ${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
401 -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE libraries
402 _depend:
403 @echo
404 @echo "--------------------------------------------------------------"
405 @echo ">>> stage 4.3: make dependencies"
406 @echo "--------------------------------------------------------------"
407 ${_+_}cd ${.CURDIR}; ${WMAKE} par-depend
408 everything:
409 @echo
410 @echo "--------------------------------------------------------------"
411 @echo ">>> stage 4.4: building everything"
412 @echo "--------------------------------------------------------------"
413 ${_+_}cd ${.CURDIR}; ${WMAKE} par-all
414 .if ${TARGET_ARCH} == "amd64"
415 build32:
416 @echo
417 @echo "--------------------------------------------------------------"
418 @echo ">>> stage 5.1: building 32 bit shim libraries"
419 @echo "--------------------------------------------------------------"
420 .for _dir in \
421 usr/include usr/lib32 usr/share/misc
422 mkdir -p ${LIB32TMP}/${_dir}
423 .endfor
424 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
425 -p ${LIB32TMP}/usr/include >/dev/null
426 mkdir -p ${WORLDTMP}
427 ln -sf ${.CURDIR}/sys ${WORLDTMP}
428 .if ${MK_KERBEROS} != "no"
429 .for _t in obj depend all
430 cd ${.CURDIR}/kerberos5/tools; \
431 MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} DESTDIR= ${_t}
432 .endfor
433 .endif
434 .for _t in obj includes
435 cd ${.CURDIR}/include; ${LIB32WMAKE} ${_t}
436 cd ${.CURDIR}/lib; ${LIB32WMAKE} ${_t}
437 .if ${MK_APACHE} != "no"
438 cd ${.CURDIR}/apache/lib; ${LIB32WMAKE} ${_t}
439 .endif
440 .if ${MK_CDDL} != "no"
441 cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} ${_t}
442 .endif
443 cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} ${_t}
444 .if ${MK_CRYPT} != "no"
445 cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} ${_t}
446 .endif
447 .if ${MK_KERBEROS} != "no"
448 cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} ${_t}
449 .endif
450 .endfor
451 .for _dir in usr.bin/lex/lib
452 cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} obj
453 .endfor
454 .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic
455 cd ${.CURDIR}/${_dir}; \
456 MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} DESTDIR= build-tools
457 .endfor
458 cd ${.CURDIR}; \
459 ${LIB32WMAKE} -f Makefile.inc1 libraries
460 .for _t in obj depend all
461 cd ${.CURDIR}/libexec/rtld-elf; \
462 PROG=ld-elf32.so.1 ${LIB32WMAKE} ${_t}
463 .endfor
464
465 distribute32 install32:
466 .if make(distribute32)
467 mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32 # XXX add to mtree
468 .else
469 mkdir -p ${DESTDIR}/usr/lib32 # XXX add to mtree
470 .endif
471 cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
472 cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
473 .if ${MK_CRYPT} != "no"
474 cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
475 .endif
476 cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//}
477 .endif
478
479
480 WMAKE_TGTS=
481 .if !defined(SUBDIR_OVERRIDE)
482 WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools
483 .endif
484 WMAKE_TGTS+= _cleanobj _obj _build-tools
485 .if !defined(SUBDIR_OVERRIDE)
486 WMAKE_TGTS+= _cross-tools
487 .endif
488 WMAKE_TGTS+= _includes _libraries _depend everything
489 .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
490 WMAKE_TGTS+= build32
491 .endif
492
493 buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
494 .ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
495
496 buildworld_prologue:
497 @echo "--------------------------------------------------------------"
498 @echo ">>> World build started on `LC_ALL=C date`"
499 @echo "--------------------------------------------------------------"
500
501 buildworld_epilogue:
502 @echo
503 @echo "--------------------------------------------------------------"
504 @echo ">>> World build completed on `LC_ALL=C date`"
505 @echo "--------------------------------------------------------------"
506
507 #
508 # We need to have this as a target because the indirection between Makefile
509 # and Makefile.inc1 causes the correct PATH to be used, rather than a
510 # modification of the current environment's PATH. In addition, we need
511 # to quote multiword values.
512 #
513 buildenvvars:
514 @echo ${WMAKEENV:Q}
515
516 buildenv:
517 @echo Entering world for ${TARGET_ARCH}:${TARGET}
518 @cd ${.CURDIR} && env ${WMAKEENV} sh || true
519
520 TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything:Nbuild32}
521 toolchain: ${TOOLCHAIN_TGTS}
522 kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries}
523
524 #
525 # installcheck
526 #
527 # Checks to be sure system is ready for installworld/installkernel.
528 #
529 installcheck:
530
531 #
532 # Require DESTDIR to be set if installing for a different architecture.
533 #
534 .if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE}
535 .if !make(distributeworld)
536 installcheck: installcheck_DESTDIR
537 installcheck_DESTDIR:
538 .if !defined(DESTDIR) || empty(DESTDIR)
539 @echo "ERROR: Please set DESTDIR!"; \
540 false
541 .endif
542 .endif
543 .endif
544
545 #
546 # Check for missing UIDs/GIDs.
547 #
548 CHECK_UIDS=
549 CHECK_GIDS= audit
550 .if ${MK_SENDMAIL} != "no"
551 CHECK_UIDS+= smmsp
552 CHECK_GIDS+= smmsp
553 .endif
554 .if ${MK_PF} != "no"
555 CHECK_UIDS+= proxy
556 CHECK_GIDS+= proxy authpf
557 .endif
558 installcheck: installcheck_UGID
559 installcheck_UGID:
560 .for uid in ${CHECK_UIDS}
561 @if ! `id -u ${uid} >/dev/null 2>&1`; then \
562 echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \
563 false; \
564 fi
565 .endfor
566 .for gid in ${CHECK_GIDS}
567 @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \
568 echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \
569 false; \
570 fi
571 .endfor
572
573 #
574 # distributeworld
575 #
576 # Distributes everything compiled by a `buildworld'.
577 #
578 # installworld
579 #
580 # Installs everything compiled by a 'buildworld'.
581 #
582 distributeworld installworld: installcheck
583 mkdir -p ${INSTALLTMP}
584 for prog in [ awk cap_mkdb cat chflags chmod chown \
585 date echo egrep find grep install-info \
586 ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
587 test true uname wc zic; do \
588 cp `which $$prog` ${INSTALLTMP}; \
589 done
590 ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
591 rm -rf ${INSTALLTMP}
592
593 #
594 # reinstall
595 #
596 # If you have a build server, you can NFS mount the source and obj directories
597 # and do a 'make reinstall' on the *client* to install new binaries from the
598 # most recent server build.
599 #
600 reinstall:
601 @echo "--------------------------------------------------------------"
602 @echo ">>> Making hierarchy"
603 @echo "--------------------------------------------------------------"
604 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
605 @echo
606 @echo "--------------------------------------------------------------"
607 @echo ">>> Installing everything"
608 @echo "--------------------------------------------------------------"
609 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
610 .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
611 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32
612 .endif
613
614 redistribute:
615 @echo "--------------------------------------------------------------"
616 @echo ">>> Distributing everything"
617 @echo "--------------------------------------------------------------"
618 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
619 .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
620 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 DISTRIBUTION=lib32
621 .endif
622
623 distrib-dirs distribution:
624 cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} ${.TARGET}
625
626 #
627 # buildkernel and installkernel
628 #
629 # Which kernels to build and/or install is specified by setting
630 # KERNCONF. If not defined a GENERIC kernel is built/installed.
631 # Only the existing (depending TARGET) config files are used
632 # for building kernels and only the first of these is designated
633 # as the one being installed.
634 #
635 # Note that we have to use TARGET instead of TARGET_ARCH when
636 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
637 # be set to cross-build, we have to make sure TARGET is set
638 # properly.
639
640 .if !defined(KERNCONF) && defined(KERNEL)
641 KERNCONF= ${KERNEL}
642 KERNWARN=
643 .else
644 KERNCONF?= GENERIC
645 .endif
646 INSTKERNNAME?= kernel
647
648 KERNSRCDIR?= ${.CURDIR}/sys
649 KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf
650 KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR}
651 KERNCONFDIR?= ${KRNLCONFDIR}
652
653 BUILDKERNELS=
654 INSTALLKERNEL=
655 .for _kernel in ${KERNCONF}
656 .if exists(${KERNCONFDIR}/${_kernel})
657 BUILDKERNELS+= ${_kernel}
658 .if empty(INSTALLKERNEL)
659 INSTALLKERNEL= ${_kernel}
660 .endif
661 .endif
662 .endfor
663
664 #
665 # buildkernel
666 #
667 # Builds all kernels defined by BUILDKERNELS.
668 #
669 buildkernel:
670 .if empty(BUILDKERNELS)
671 @echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \
672 false
673 .endif
674 .if defined(KERNWARN)
675 @echo "--------------------------------------------------------------"
676 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
677 @echo "--------------------------------------------------------------"
678 @sleep 3
679 .endif
680 @echo
681 .for _kernel in ${BUILDKERNELS}
682 @echo "--------------------------------------------------------------"
683 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
684 @echo "--------------------------------------------------------------"
685 @echo "===> ${_kernel}"
686 mkdir -p ${KRNLOBJDIR}
687 .if !defined(NO_KERNELCONFIG)
688 @echo
689 @echo "--------------------------------------------------------------"
690 @echo ">>> stage 1: configuring the kernel"
691 @echo "--------------------------------------------------------------"
692 cd ${KRNLCONFDIR}; \
693 PATH=${TMPPATH} \
694 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
695 ${KERNCONFDIR}/${_kernel}
696 .endif
697 .if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN)
698 @echo
699 @echo "--------------------------------------------------------------"
700 @echo ">>> stage 2.1: cleaning up the object tree"
701 @echo "--------------------------------------------------------------"
702 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR}
703 .endif
704 @echo
705 @echo "--------------------------------------------------------------"
706 @echo ">>> stage 2.2: rebuilding the object tree"
707 @echo "--------------------------------------------------------------"
708 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj
709 @echo
710 @echo "--------------------------------------------------------------"
711 @echo ">>> stage 2.3: build tools"
712 @echo "--------------------------------------------------------------"
713 cd ${KRNLOBJDIR}/${_kernel}; \
714 MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
715 ${MAKE} -DNO_CPU_CFLAGS -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
716 # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
717 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
718 .for target in obj depend all
719 cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \
720 MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \
721 ${MAKE} -DNO_CPU_CFLAGS ${target}
722 .endfor
723 .endif
724 .if !defined(NO_KERNELDEPEND)
725 @echo
726 @echo "--------------------------------------------------------------"
727 @echo ">>> stage 3.1: making dependencies"
728 @echo "--------------------------------------------------------------"
729 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ
730 .endif
731 @echo
732 @echo "--------------------------------------------------------------"
733 @echo ">>> stage 3.2: building everything"
734 @echo "--------------------------------------------------------------"
735 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
736 @echo "--------------------------------------------------------------"
737 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
738 @echo "--------------------------------------------------------------"
739 .endfor
740
741 #
742 # installkernel, etc.
743 #
744 # Install the kernel defined by INSTALLKERNEL
745 #
746 installkernel installkernel.debug \
747 reinstallkernel reinstallkernel.debug: installcheck
748 .if empty(INSTALLKERNEL)
749 @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
750 false
751 .endif
752 @echo "--------------------------------------------------------------"
753 @echo ">>> Installing kernel"
754 @echo "--------------------------------------------------------------"
755 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
756 ${CROSSENV} PATH=${TMPPATH} \
757 ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
758
759 #
760 # doxygen
761 #
762 # Build the API documentation with doxygen
763 #
764 doxygen:
765 @if [ ! -x `/usr/bin/which doxygen` ]; then \
766 echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \
767 exit 1; \
768 fi
769 cd ${.CURDIR}/tools/kerneldoc/subsys && ${MAKE} obj all
770
771 #
772 # update
773 #
774 # Update the source tree, by running cvsup and/or running cvs to update to the
775 # latest copy.
776 #
777 update:
778 .if defined(SUP_UPDATE)
779 @echo "--------------------------------------------------------------"
780 @echo ">>> Running ${SUP}"
781 @echo "--------------------------------------------------------------"
782 .if defined(SUPFILE)
783 @${SUP} ${SUPFLAGS} ${SUPFILE}
784 .endif
785 .if defined(SUPFILE1)
786 @${SUP} ${SUPFLAGS} ${SUPFILE1}
787 .endif
788 .if defined(SUPFILE2)
789 @${SUP} ${SUPFLAGS} ${SUPFILE2}
790 .endif
791 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
792 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
793 .endif
794 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
795 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
796 .endif
797 .endif
798 .if defined(CVS_UPDATE)
799 @echo "--------------------------------------------------------------"
800 @echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT}
801 @echo "--------------------------------------------------------------"
802 cd ${.CURDIR}; ${CVS} -R -q update ${CVSFLAGS}
803 .endif
804
805 #
806 # ------------------------------------------------------------------------
807 #
808 # From here onwards are utility targets used by the 'make world' and
809 # related targets. If your 'world' breaks, you may like to try to fix
810 # the problem and manually run the following targets to attempt to
811 # complete the build. Beware, this is *not* guaranteed to work, you
812 # need to have a pretty good grip on the current state of the system
813 # to attempt to manually finish it. If in doubt, 'make world' again.
814 #
815
816 #
817 # legacy: Build compatibility shims for the next three targets
818 #
819 legacy:
820 .for _tool in tools/build
821 ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \
822 cd ${.CURDIR}/${_tool}; \
823 ${MAKE} DIRPRFX=${_tool}/ obj; \
824 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \
825 ${MAKE} DIRPRFX=${_tool}/ depend; \
826 ${MAKE} DIRPRFX=${_tool}/ all; \
827 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
828 .endfor
829
830 #
831 # bootstrap-tools: Build tools needed for compatibility
832 #
833 .if ${MK_GAMES} != "no"
834 _strfile= games/fortune/strfile
835 .endif
836
837 .if ${MK_CXX} != "no"
838 _gperf= gnu/usr.bin/gperf
839 .if ${BOOTSTRAPPING} < 700004
840 _groff= gnu/usr.bin/groff
841 .else
842 _groff= gnu/usr.bin/groff/tmac
843 .endif
844 .endif
845
846 .if ${BOOTSTRAPPING} < 700018
847 _gensnmptree= usr.sbin/bsnmpd/gensnmptree
848 .endif
849
850 .if ${MK_RESCUE} != "no" && \
851 ${BOOTSTRAPPING} < 700026
852 _crunchgen= usr.sbin/crunch/crunchgen
853 .endif
854
855 bootstrap-tools:
856 .for _tool in \
857 ${_strfile} \
858 ${_gperf} \
859 ${_groff} \
860 usr.bin/lorder \
861 usr.bin/makewhatis \
862 usr.bin/rpcgen \
863 usr.bin/xinstall \
864 ${_gensnmptree} \
865 usr.sbin/config \
866 ${_crunchgen}
867 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
868 cd ${.CURDIR}/${_tool}; \
869 ${MAKE} DIRPRFX=${_tool}/ obj; \
870 ${MAKE} DIRPRFX=${_tool}/ depend; \
871 ${MAKE} DIRPRFX=${_tool}/ all; \
872 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
873 .endfor
874
875 #
876 # build-tools: Build special purpose build tools
877 #
878 .if defined(MODULES_WITH_WORLD) && exists(${KERNSRCDIR}/modules)
879 _aicasm= sys/modules/aic7xxx/aicasm
880 .endif
881
882 .if !defined(NO_SHARE)
883 _share= share/syscons/scrnmaps
884 .endif
885
886 .if ${MK_KERBEROS} != "no"
887 _kerberos5_tools= kerberos5/tools
888 .endif
889
890 .if ${MK_RESCUE} != "no"
891 _rescue= rescue/rescue
892 .endif
893
894 build-tools:
895 .for _tool in \
896 bin/csh \
897 bin/sh \
898 ${_rescue} \
899 lib/ncurses/ncurses \
900 lib/ncurses/ncursesw \
901 ${_share} \
902 ${_aicasm} \
903 usr.bin/awk \
904 lib/libmagic \
905 usr.sbin/sysinstall
906 ${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \
907 cd ${.CURDIR}/${_tool}; \
908 ${MAKE} DIRPRFX=${_tool}/ obj; \
909 ${MAKE} DIRPRFX=${_tool}/ build-tools
910 .endfor
911 .for _tool in \
912 gnu/usr.bin/cc/cc_tools \
913 ${_kerberos5_tools}
914 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \
915 cd ${.CURDIR}/${_tool}; \
916 ${MAKE} DIRPRFX=${_tool}/ obj; \
917 ${MAKE} DIRPRFX=${_tool}/ depend; \
918 ${MAKE} DIRPRFX=${_tool}/ all
919 .endfor
920
921 #
922 # cross-tools: Build cross-building tools
923 #
924 .if ${TARGET_ARCH} != ${MACHINE_ARCH}
925 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
926 _btxld= usr.sbin/btxld
927 .endif
928 .if ${MK_RESCUE} != "no" || defined(RELEASEDIR)
929 _crunchide= usr.sbin/crunch/crunchide
930 .endif
931 .if ${TARGET_ARCH} == "i386" && defined(RELEASEDIR)
932 _kgzip= usr.sbin/kgzip
933 .endif
934 .endif
935
936 cross-tools:
937 .for _tool in \
938 gnu/usr.bin/binutils \
939 gnu/usr.bin/cc \
940 usr.bin/sed \
941 usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
942 ${_btxld} \
943 ${_crunchide} \
944 ${_kgzip}
945 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
946 cd ${.CURDIR}/${_tool}; \
947 ${MAKE} DIRPRFX=${_tool}/ obj; \
948 ${MAKE} DIRPRFX=${_tool}/ depend; \
949 ${MAKE} DIRPRFX=${_tool}/ all; \
950 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
951 .endfor
952
953 #
954 # hierarchy - ensure that all the needed directories are present
955 #
956 hierarchy:
957 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
958
959 #
960 # libraries - build all libraries, and install them under ${DESTDIR}.
961 #
962 # The list of libraries with dependents (${_prebuild_libs}) and their
963 # interdependencies (__L) are built automatically by the
964 # ${.CURDIR}/tools/make_libdeps.sh script.
965 #
966 libraries:
967 cd ${.CURDIR}; \
968 ${MAKE} -f Makefile.inc1 _prereq_libs; \
969 ${MAKE} -f Makefile.inc1 _startup_libs; \
970 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
971 ${MAKE} -f Makefile.inc1 _generic_libs;
972
973 #
974 # static libgcc.a prerequisite for shared libc
975 #
976 _prereq_libs= gnu/lib/libgcc
977
978 # These dependencies are not automatically generated:
979 #
980 # gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before
981 # all shared libraries for ELF.
982 #
983 _startup_libs= gnu/lib/csu
984 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
985 _startup_libs+= lib/csu/${MACHINE_ARCH}-elf
986 .else
987 _startup_libs+= lib/csu/${MACHINE_ARCH}
988 .endif
989 _startup_libs+= gnu/lib/libgcc
990 _startup_libs+= lib/libc
991
992 gnu/lib/libgcc__L: lib/libc__L
993
994 _prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libkrb5} \
995 ${_kerberos5_lib_libroken} \
996 lib/libbz2 lib/libcom_err lib/libcrypt lib/libexpat \
997 ${_lib_libgssapi} ${_lib_libipx} \
998 lib/libkiconv lib/libkvm lib/libmd \
999 lib/ncurses/ncurses lib/ncurses/ncursesw \
1000 lib/libopie lib/libpam ${_default_thread_lib} \
1001 lib/libradius lib/libsbuf lib/libtacplus lib/libutil \
1002 ${_lib_libypclnt} lib/libz lib/msun \
1003 ${_secure_lib_libcrypto} ${_secure_lib_libssh} \
1004 ${_secure_lib_libssl} lib/libsqlite3 lib/liblzma \
1005 lib/libarchive lib/libfetch
1006
1007 .if ${MK_LIBTHR} != "no" && ${MK_LIBKSE} != "no"
1008 _default_thread_lib= lib/${DEFAULT_THREAD_LIB}
1009 .elif ${MK_LIBTHR} != "no"
1010 _default_thread_lib= lib/libthr
1011 .elif ${MK_LIBKSE} != "no"
1012 _default_thread_lib= lib/libkse
1013 .endif
1014
1015 _generic_libs= ${_apache_lib} ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib
1016
1017 lib/libopie__L lib/libtacplus__L: lib/libmd__L
1018
1019 .if ${MK_APACHE} != "no"
1020 _apache_lib= apache/lib
1021 .endif
1022
1023 .if ${MK_CDDL} != "no"
1024 _cddl_lib= cddl/lib
1025 .endif
1026
1027 .if ${MK_CRYPT} != "no"
1028 .if ${MK_OPENSSL} != "no"
1029 _secure_lib_libcrypto= secure/lib/libcrypto
1030 _secure_lib_libssl= secure/lib/libssl
1031 lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L
1032 .if ${MK_OPENSSH} != "no"
1033 _secure_lib_libssh= secure/lib/libssh
1034 secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L
1035 .if ${MK_KERBEROS} != "no"
1036 secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \
1037 kerberos5/lib/libasn1__L lib/libcom_err__L lib/libmd__L \
1038 kerberos5/lib/libroken__L
1039 .endif
1040 .endif
1041 .endif
1042 _secure_lib= secure/lib
1043 .endif
1044
1045 .if ${MK_IPX} != "no"
1046 _lib_libipx= lib/libipx
1047 .endif
1048
1049 .if ${MK_KERBEROS} != "no"
1050 _kerberos5_lib= kerberos5/lib
1051 _kerberos5_lib_libasn1= kerberos5/lib/libasn1
1052 _kerberos5_lib_libkrb5= kerberos5/lib/libkrb5
1053 _kerberos5_lib_libroken= kerberos5/lib/libroken
1054 _lib_libgssapi= lib/libgssapi
1055 .endif
1056
1057 .if ${MK_NIS} != "no"
1058 _lib_libypclnt= lib/libypclnt
1059 .endif
1060
1061 .if ${MK_OPENSSL} == "no"
1062 lib/libradius__L: lib/libmd__L
1063 .endif
1064
1065 .for _lib in ${_prereq_libs}
1066 ${_lib}__PL: .PHONY
1067 .if exists(${.CURDIR}/${_lib})
1068 ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
1069 cd ${.CURDIR}/${_lib}; \
1070 ${MAKE} DIRPRFX=${_lib}/ obj; \
1071 ${MAKE} DIRPRFX=${_lib}/ depend; \
1072 ${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all; \
1073 ${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install
1074 .endif
1075 .endfor
1076
1077 .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
1078 ${_lib}__L: .PHONY
1079 .if exists(${.CURDIR}/${_lib})
1080 ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
1081 cd ${.CURDIR}/${_lib}; \
1082 ${MAKE} DIRPRFX=${_lib}/ obj; \
1083 ${MAKE} DIRPRFX=${_lib}/ depend; \
1084 ${MAKE} DIRPRFX=${_lib}/ all; \
1085 ${MAKE} DIRPRFX=${_lib}/ install
1086 .endif
1087 .endfor
1088
1089 # libpam is special: we need to build static PAM modules before
1090 # static PAM library, and dynamic PAM library before dynamic PAM
1091 # modules.
1092 lib/libpam__L: .PHONY
1093 ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \
1094 cd ${.CURDIR}/lib/libpam; \
1095 ${MAKE} DIRPRFX=lib/libpam/ obj; \
1096 ${MAKE} DIRPRFX=lib/libpam/ depend; \
1097 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \
1098 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install
1099
1100 _prereq_libs: ${_prereq_libs:S/$/__PL/}
1101 _startup_libs: ${_startup_libs:S/$/__L/}
1102 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
1103 _generic_libs: ${_generic_libs:S/$/__L/}
1104
1105 .for __target in all clean cleandepend cleandir depend includes obj
1106 .for entry in ${SUBDIR}
1107 ${entry}.${__target}__D: .PHONY
1108 ${_+_}@if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
1109 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH} (${__target})"; \
1110 edir=${entry}.${MACHINE_ARCH}; \
1111 cd ${.CURDIR}/$${edir}; \
1112 else \
1113 ${ECHODIR} "===> ${DIRPRFX}${entry} (${__target})"; \
1114 edir=${entry}; \
1115 cd ${.CURDIR}/$${edir}; \
1116 fi; \
1117 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
1118 .endfor
1119 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
1120 .endfor
1121
1122 .include <bsd.subdir.mk>
1123
1124 .if make(check-old) || make(check-old-dirs) || \
1125 make(check-old-files) || make(check-old-libs) || \
1126 make(delete-old) || make(delete-old-dirs) || \
1127 make(delete-old-files) || make(delete-old-libs)
1128
1129 #
1130 # check for / delete old files section
1131 #
1132
1133 .include "ObsoleteFiles.inc"
1134
1135 OLD_LIBS_MESSAGE="Please be sure no application still uses those libraries, \
1136 else you can not start such an application. Consult UPDATING for more \
1137 information regarding how to cope with the removal/revision bump of a \
1138 specific library."
1139
1140 .if !defined(BATCH_DELETE_OLD_FILES)
1141 RM_I=-i
1142 .else
1143 RM_I=-v
1144 .endif
1145
1146 delete-old-files:
1147 @echo ">>> Removing old files (only deletes safe to delete libs)"
1148 # Ask for every old file if the user really wants to remove it.
1149 # It's annoying, but better safe than sorry.
1150 @for file in ${OLD_FILES}; do \
1151 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1152 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
1153 rm ${RM_I} "${DESTDIR}/$${file}"; \
1154 fi; \
1155 done
1156 # Remove catpages without corresponding manpages.
1157 @3<&0; \
1158 find ${DESTDIR}/usr/share/man/cat* ! -type d | \
1159 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
1160 while read catpage; do \
1161 read manpage; \
1162 if [ ! -e "$${manpage}" ]; then \
1163 rm ${RM_I} $${catpage} <&3 ; \
1164 fi; \
1165 done
1166 @echo ">>> Old files removed"
1167
1168 check-old-files:
1169 @echo ">>> Checking for old files"
1170 @for file in ${OLD_FILES}; do \
1171 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1172 echo "${DESTDIR}/$${file}"; \
1173 fi; \
1174 done
1175 # Check for catpages without corresponding manpages.
1176 @find ${DESTDIR}/usr/share/man/cat* ! -type d | \
1177 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
1178 while read catpage; do \
1179 read manpage; \
1180 if [ ! -e "$${manpage}" ]; then \
1181 echo $${catpage} ; \
1182 fi; \
1183 done
1184
1185 delete-old-libs:
1186 @echo ">>> Removing old libraries"
1187 @echo "${OLD_LIBS_MESSAGE}" | fmt
1188 @for file in ${OLD_LIBS}; do \
1189 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1190 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
1191 rm ${RM_I} "${DESTDIR}/$${file}"; \
1192 fi; \
1193 done
1194 @echo ">>> Old libraries removed"
1195
1196 check-old-libs:
1197 @echo ">>> Checking for old libraries"
1198 @for file in ${OLD_LIBS}; do \
1199 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1200 echo "${DESTDIR}/$${file}"; \
1201 fi; \
1202 done
1203
1204 delete-old-dirs:
1205 @echo ">>> Removing old directories"
1206 @for dir in ${OLD_DIRS}; do \
1207 if [ -d "${DESTDIR}/$${dir}" ]; then \
1208 rmdir -v "${DESTDIR}/$${dir}" || true; \
1209 elif [ -L "${DESTDIR}/$${dir}" ]; then \
1210 echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
1211 fi; \
1212 done
1213 @echo ">>> Old directories removed"
1214
1215 check-old-dirs:
1216 @echo ">>> Checking for old directories"
1217 @for dir in ${OLD_DIRS}; do \
1218 if [ -d "${DESTDIR}/$${dir}" ]; then \
1219 echo "${DESTDIR}/$${dir}"; \
1220 elif [ -L "${DESTDIR}/$${dir}" ]; then \
1221 echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
1222 fi; \
1223 done
1224
1225 delete-old: delete-old-files delete-old-dirs
1226 @echo "To remove old libraries run '${MAKE} delete-old-libs'."
1227
1228 check-old: check-old-files check-old-libs check-old-dirs
1229 @echo "To remove old files and directories run '${MAKE} delete-old'."
1230 @echo "To remove old libraries run '${MAKE} delete-old-libs'."
1231
1232 .endif
1233
1234 #
1235 # showconfig - show build configuration.
1236 #
1237 showconfig:
1238 @${MAKE} -n -f bsd.own.mk -V dummy -dg1 | grep ^MK_ | sort

Properties

Name Value
cvs2svn:cvs-rev 1.29