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.15 2009/04/05 23:02:05 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_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir |
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 |
+ |
# 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 |
|
# |
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' |
50 |
|
# |
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 |
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/local/bin/cvsup |
121 |
|
.endif |
122 |
|
.endif |
123 |
|
|
106 |
– |
.if !defined(VERSION) |
107 |
– |
VERSION!= uname -srp |
108 |
– |
VERSION+= ${OSRELDATE} |
109 |
– |
.endif |
110 |
– |
|
124 |
|
# Guess machine architecture from machine type, and vice versa. |
125 |
|
.if !defined(TARGET_ARCH) && defined(TARGET) |
126 |
< |
TARGET_ARCH= ${TARGET:S/sun4v/sparc64/} |
126 |
> |
TARGET_ARCH= ${TARGET} |
127 |
|
.elif !defined(TARGET) && defined(TARGET_ARCH) && \ |
128 |
|
${TARGET_ARCH} != ${MACHINE_ARCH} |
129 |
|
TARGET= ${TARGET_ARCH} |
132 |
|
TARGET?= ${MACHINE} |
133 |
|
TARGET_ARCH?= ${MACHINE_ARCH} |
134 |
|
|
135 |
< |
KNOWN_ARCHES?= amd64 i386 sparc64 sparc64/sun4v |
135 |
> |
KNOWN_ARCHES?= amd64 i386 sparc64 |
136 |
|
.if ${TARGET} == ${TARGET_ARCH} |
137 |
|
_t= ${TARGET} |
138 |
|
.else |
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 |
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 |
227 |
|
BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ |
228 |
|
PATH=${BPATH}:${PATH} \ |
229 |
|
WORLDTMP=${WORLDTMP} \ |
210 |
– |
VERSION=${VERSION} \ |
230 |
|
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" |
231 |
|
BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ |
232 |
|
${BMAKEENV} ${MAKE} -f Makefile.inc1 \ |
233 |
|
DESTDIR= \ |
234 |
|
BOOTSTRAPPING=${OSRELDATE} \ |
235 |
|
-DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \ |
236 |
< |
-DWITHOUT_NLS -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \ |
236 |
> |
-DWITHOUT_NLS -DNO_PIC -DNO_PROFILE -DNO_SHARED \ |
237 |
|
-DNO_CPU_CFLAGS -DNO_WARNS |
238 |
|
|
239 |
|
# build-tools stage |
260 |
|
LIB32TMP= ${OBJTREE}${.CURDIR}/lib32 |
261 |
|
|
262 |
|
.if empty(TARGET_CPUTYPE) |
263 |
< |
LIB32CPUTYPE= -march=i686 -mmmx -msse -msse2 |
263 |
> |
LIB32CPUTYPE= k8 |
264 |
|
.else |
265 |
|
LIB32CPUTYPE= ${TARGET_CPUTYPE} |
266 |
|
.endif |
267 |
< |
LIB32FLAGS= -m32 -march=${LIB32CPUTYPE} -mfancy-math-387 -DCOMPAT_32BIT \ |
267 |
> |
LIB32FLAGS= -m32 -march=${LIB32CPUTYPE} -DCOMPAT_32BIT \ |
268 |
|
-iprefix ${LIB32TMP}/usr/ \ |
269 |
|
-L${LIB32TMP}/usr/lib32 \ |
270 |
|
-B${LIB32TMP}/usr/lib32 |
286 |
|
|
287 |
|
LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \ |
288 |
|
-DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_INFO \ |
289 |
< |
-DWITHOUT_HTML DESTDIR=${LIB32TMP} |
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} \ |
280 |
< |
PATH=${TMPPATH}:${INSTALLTMP} |
303 |
> |
IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP} |
304 |
|
.endif |
282 |
– |
IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 |
305 |
|
|
306 |
|
# kernel stage |
307 |
|
KMAKEENV= ${WMAKEENV} |
335 |
|
rm -rf ${WORLDTMP}/legacy/usr/include |
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/sys usr/lib \ |
320 |
< |
usr/libexec usr/sbin usr/share/dict \ |
321 |
< |
usr/share/groff_font/devX100 \ |
322 |
< |
usr/share/groff_font/devX100-12 \ |
323 |
< |
usr/share/groff_font/devX75 \ |
324 |
< |
usr/share/groff_font/devX75-12 \ |
325 |
< |
usr/share/groff_font/devascii \ |
326 |
< |
usr/share/groff_font/devcp1047 \ |
327 |
< |
usr/share/groff_font/devdvi \ |
328 |
< |
usr/share/groff_font/devhtml \ |
329 |
< |
usr/share/groff_font/devkoi8-r \ |
330 |
< |
usr/share/groff_font/devlatin1 \ |
331 |
< |
usr/share/groff_font/devlbp \ |
332 |
< |
usr/share/groff_font/devlj4 \ |
333 |
< |
usr/share/groff_font/devps \ |
334 |
< |
usr/share/groff_font/devutf8 \ |
335 |
< |
usr/share/tmac/mdoc usr/share/tmac/mm |
336 |
< |
mkdir -p ${WORLDTMP}/legacy/${_dir} |
337 |
< |
.endfor |
338 |
< |
.for _dir in \ |
339 |
< |
lib usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \ |
340 |
< |
usr/libexec usr/sbin usr/share/misc |
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} |
407 |
|
@echo "--------------------------------------------------------------" |
408 |
|
${_+_}cd ${.CURDIR}; \ |
409 |
|
${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \ |
410 |
< |
-DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE libraries |
410 |
> |
-DWITHOUT_MAN -DWITHOUT_NLS -DNO_PROFILE libraries |
411 |
|
_depend: |
412 |
|
@echo |
413 |
|
@echo "--------------------------------------------------------------" |
426 |
|
@echo "--------------------------------------------------------------" |
427 |
|
@echo ">>> stage 5.1: building 32 bit shim libraries" |
428 |
|
@echo "--------------------------------------------------------------" |
429 |
< |
.for _dir in \ |
430 |
< |
usr/include usr/lib32 usr/share/misc |
431 |
< |
mkdir -p ${LIB32TMP}/${_dir} |
426 |
< |
.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} |
442 |
|
.for _t in obj includes |
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 ${MK_CDDL} != "no" |
449 |
< |
cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} ${_t} |
449 |
> |
cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} DIRPRFX=cddl/lib/ ${_t} |
450 |
|
.endif |
451 |
< |
cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} ${_t} |
451 |
> |
cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} DIRPRFX=gnu/lib/ ${_t} |
452 |
|
.if ${MK_CRYPT} != "no" |
453 |
< |
cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} ${_t} |
453 |
> |
cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} DIRPRFX=secure/lib/ ${_t} |
454 |
|
.endif |
455 |
|
.if ${MK_KERBEROS} != "no" |
456 |
< |
cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} ${_t} |
456 |
> |
cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} DIRPRFX=kerberos5/lib ${_t} |
457 |
|
.endif |
458 |
|
.endfor |
459 |
|
.for _dir in usr.bin/lex/lib |
460 |
< |
cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} obj |
460 |
> |
cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} DIRPRFX=${_dir}/ obj |
461 |
|
.endfor |
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 |
|
${LIB32WMAKE} -f Makefile.inc1 libraries |
469 |
|
.for _t in obj depend all |
470 |
< |
cd ${.CURDIR}/libexec/rtld-elf; \ |
471 |
< |
PROG=ld-elf32.so.1 ${LIB32WMAKE} ${_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: |
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 ${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 |
|
|
479 |
– |
|
498 |
|
WMAKE_TGTS= |
499 |
|
.if !defined(SUBDIR_OVERRIDE) |
500 |
|
WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools |
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} |
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'. |
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 |
|
# |
695 |
|
@echo ">>> Distributing everything" |
696 |
|
@echo "--------------------------------------------------------------" |
697 |
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute |
698 |
< |
.if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no" |
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: |
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= |
791 |
|
@echo "--------------------------------------------------------------" |
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}; ${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) |
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 |
|
# |
972 |
|
usr.bin/xinstall \ |
973 |
|
${_gensnmptree} \ |
974 |
|
usr.sbin/config \ |
975 |
< |
${_crunchgen} \ |
975 |
> |
${_crunchgen} |
976 |
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ |
977 |
|
cd ${.CURDIR}/${_tool}; \ |
978 |
|
${MAKE} DIRPRFX=${_tool}/ obj; \ |
1005 |
|
bin/csh \ |
1006 |
|
bin/sh \ |
1007 |
|
${_rescue} \ |
1008 |
+ |
${LOCAL_TOOL_DIRS} \ |
1009 |
|
lib/ncurses/ncurses \ |
1010 |
|
lib/ncurses/ncursesw \ |
1011 |
|
${_share} \ |
1083 |
|
# |
1084 |
|
# static libgcc.a prerequisite for shared libc |
1085 |
|
# |
1086 |
< |
_prereq_libs= gnu/lib/libgcc |
1086 |
> |
_prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc |
1087 |
|
|
1088 |
|
# These dependencies are not automatically generated: |
1089 |
|
# |
1103 |
|
|
1104 |
|
_prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libkrb5} \ |
1105 |
|
${_kerberos5_lib_libroken} \ |
1106 |
< |
lib/libbz2 lib/libcom_err lib/libcrypt lib/libexpat \ |
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 \ |
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} |
1115 |
> |
${_secure_lib_libssl} lib/libsqlite3 lib/liblzma \ |
1116 |
> |
lib/libarchive lib/libfetch lib/libmagic |
1117 |
|
|
1118 |
|
.if ${MK_LIBTHR} != "no" && ${MK_LIBKSE} != "no" |
1119 |
|
_default_thread_lib= lib/${DEFAULT_THREAD_LIB} |
1123 |
|
_default_thread_lib= lib/libkse |
1124 |
|
.endif |
1125 |
|
|
1126 |
< |
_generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib |
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 |
+ |
.if ${MK_APACHE} != "no" |
1131 |
+ |
_apache_lib= apache/lib |
1132 |
+ |
.endif |
1133 |
+ |
|
1134 |
|
.if ${MK_CDDL} != "no" |
1135 |
|
_cddl_lib= cddl/lib |
1136 |
|
.endif |
1180 |
|
cd ${.CURDIR}/${_lib}; \ |
1181 |
|
${MAKE} DIRPRFX=${_lib}/ obj; \ |
1182 |
|
${MAKE} DIRPRFX=${_lib}/ depend; \ |
1183 |
< |
${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all; \ |
1184 |
< |
${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install |
1183 |
> |
${MAKE} -DNO_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all; \ |
1184 |
> |
${MAKE} -DNO_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install |
1185 |
|
.endif |
1186 |
|
.endfor |
1187 |
|
|
1258 |
|
@echo ">>> Removing old files (only deletes safe to delete libs)" |
1259 |
|
# Ask for every old file if the user really wants to remove it. |
1260 |
|
# It's annoying, but better safe than sorry. |
1261 |
< |
@for file in ${OLD_FILES}; do \ |
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}"; \ |
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}; do \ |
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; \ |
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}; do \ |
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}"; \ |
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}; do \ |
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; \ |
1327 |
|
|
1328 |
|
delete-old-dirs: |
1329 |
|
@echo ">>> Removing old directories" |
1330 |
< |
@for dir in ${OLD_DIRS}; do \ |
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 \ |
1340 |
|
|
1341 |
|
check-old-dirs: |
1342 |
|
@echo ">>> Checking for old directories" |
1343 |
< |
@for dir in ${OLD_DIRS}; do \ |
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 \ |