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.20 2009/04/15 02:01:29 laffer1 Exp $ |
2 |
> |
# $MidnightBSD$ |
3 |
|
# |
4 |
|
# Make command line options: |
5 |
|
# -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir |
6 |
|
# -DNO_CLEAN do not clean at all |
7 |
|
# -DNO_SHARE do not go into share subdir |
8 |
+ |
# -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ} |
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_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel |
13 |
|
# -DNO_PORTSUPDATE do not update ports in ${MAKE} update |
14 |
|
# -DNO_DOCUPDATE do not update doc in ${MAKE} update |
15 |
+ |
# -DNO_CTF do not run the DTrace CTF conversion tools on built objects |
16 |
|
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list |
17 |
|
# TARGET="machine" to crossbuild world for a different machine type |
18 |
+ |
# TARGET_ARCH= may be required when a TARGET supports multiple endians |
19 |
|
|
20 |
|
# |
21 |
|
# The intended user-driven targets are: |
28 |
|
# /usr/share/mk. These include: |
29 |
|
# obj depend all install clean cleandepend cleanobj |
30 |
|
|
31 |
+ |
# You are supposed to define both of these when calling Makefile.inc1 |
32 |
+ |
# directly. However, some old scripts don't. Cope for the moment, but |
33 |
+ |
# issue a new warning for a transition period. |
34 |
+ |
.if defined(TARGET) && !defined(TARGET_ARCH) |
35 |
+ |
.warning "You must pass both TARGET and TARGET_ARCH to Makefile.inc1. Setting TARGET_ARCH=${TARGET}." |
36 |
+ |
TARGET_ARCH=${TARGET} |
37 |
+ |
.endif |
38 |
+ |
.if !defined(TARGET) || !defined(TARGET_ARCH) |
39 |
+ |
.error "Both TARGET and TARGET_ARCH must be defined." |
40 |
+ |
.endif |
41 |
+ |
|
42 |
|
.include <bsd.own.mk> |
43 |
+ |
.include <bsd.arch.inc.mk> |
44 |
+ |
.include <bsd.compiler.mk> |
45 |
|
|
46 |
|
# We must do share/info early so that installation of info `dir' |
47 |
|
# entries works correctly. Do it first since it is less likely to |
54 |
|
# |
55 |
|
SUBDIR= share/info lib libexec |
56 |
|
SUBDIR+=bin |
57 |
+ |
.if ${MK_APACHE} != "no" |
58 |
+ |
SUBDIR+=apache |
59 |
+ |
.endif |
60 |
|
.if ${MK_GAMES} != "no" |
61 |
|
SUBDIR+=games |
62 |
|
.endif |
78 |
|
SUBDIR+=share |
79 |
|
.endif |
80 |
|
SUBDIR+=sys usr.bin usr.sbin |
81 |
+ |
.if ${MK_OFED} != "no" |
82 |
+ |
SUBDIR+=contrib/ofed |
83 |
+ |
.endif |
84 |
|
# |
85 |
|
# We must do etc/ last for install/distribute to work. |
86 |
|
# |
107 |
|
CLEANDIR= cleandir |
108 |
|
.endif |
109 |
|
|
110 |
< |
CVS?= cvs |
111 |
< |
CVSFLAGS?= -r . -P -d -I! |
90 |
< |
SUP?= /usr/local/bin/cvsup |
91 |
< |
SUPFLAGS?= -g -L 2 |
92 |
< |
.if defined(SUPHOST) |
93 |
< |
SUPFLAGS+= -h ${SUPHOST} |
94 |
< |
.endif |
110 |
> |
SVN?= /usr/local/bin/svn |
111 |
> |
SVNFLAGS?= -r HEAD |
112 |
|
|
113 |
|
MAKEOBJDIRPREFIX?= /usr/obj |
114 |
|
.if !defined(OSRELDATE) |
120 |
|
.endif |
121 |
|
.endif |
122 |
|
|
123 |
< |
# Guess machine architecture from machine type, and vice versa. |
124 |
< |
.if !defined(TARGET_ARCH) && defined(TARGET) |
125 |
< |
TARGET_ARCH= ${TARGET:S/sun4v/sparc64/} |
109 |
< |
.elif !defined(TARGET) && defined(TARGET_ARCH) && \ |
110 |
< |
${TARGET_ARCH} != ${MACHINE_ARCH} |
111 |
< |
TARGET= ${TARGET_ARCH} |
123 |
> |
.if !defined(VERSION) |
124 |
> |
VERSION!= uname -srp |
125 |
> |
VERSION+= ${OSRELDATE} |
126 |
|
.endif |
113 |
– |
# Otherwise, default to current machine type and architecture. |
114 |
– |
TARGET?= ${MACHINE} |
115 |
– |
TARGET_ARCH?= ${MACHINE_ARCH} |
127 |
|
|
128 |
< |
KNOWN_ARCHES?= amd64 i386 sparc64 sparc64/sun4v |
128 |
> |
|
129 |
> |
KNOWN_ARCHES?= amd64 i386 |
130 |
|
.if ${TARGET} == ${TARGET_ARCH} |
131 |
|
_t= ${TARGET} |
132 |
|
.else |
160 |
|
.error To cross-build, set TARGET_ARCH. |
161 |
|
.endif |
162 |
|
.endif |
163 |
< |
.if ${MACHINE} == ${TARGET} && !defined(CROSS_BUILD_TESTING) |
163 |
> |
.if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING) |
164 |
|
OBJTREE= ${MAKEOBJDIRPREFIX} |
165 |
|
.else |
166 |
< |
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET} |
166 |
> |
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH} |
167 |
|
.endif |
168 |
|
WORLDTMP= ${OBJTREE}${.CURDIR}/tmp |
169 |
|
# /usr/games added for fortune which depend on strfile |
172 |
|
STRICTTMPPATH= ${BPATH}:${XPATH} |
173 |
|
TMPPATH= ${STRICTTMPPATH}:${PATH} |
174 |
|
|
175 |
+ |
# |
176 |
+ |
# Avoid running mktemp(1) unless actually needed. |
177 |
+ |
# It may not be functional, e.g., due to new ABI |
178 |
+ |
# when in the middle of installing over this system. |
179 |
+ |
# |
180 |
+ |
.if make(distributeworld) || make(installworld) |
181 |
|
INSTALLTMP!= /usr/bin/mktemp -d -u -t install |
182 |
+ |
.endif |
183 |
|
|
184 |
|
# |
185 |
|
# Building a world goes through the following stages |
210 |
|
|
211 |
|
# Common environment for world related stages |
212 |
|
CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \ |
213 |
+ |
MACHINE_INCLUDES="${WORLDTMP}/include" \ |
214 |
|
MACHINE_ARCH=${TARGET_ARCH} \ |
215 |
|
MACHINE=${TARGET} \ |
216 |
< |
CPUTYPE=${TARGET_CPUTYPE} \ |
217 |
< |
GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \ |
216 |
> |
CPUTYPE=${TARGET_CPUTYPE} |
217 |
> |
.if ${OSRELDATE} < 4015 |
218 |
> |
CROSSENV+= AR=gnu-ar RANLIB=gnu-ranlib |
219 |
> |
.endif |
220 |
> |
.if ${MK_GROFF} != "no" |
221 |
> |
CROSSENV+= GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \ |
222 |
|
GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \ |
223 |
|
GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac |
224 |
+ |
.endif |
225 |
|
|
226 |
|
# bootstrap-tools stage |
227 |
|
BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ |
228 |
+ |
MACHINE_INCLUDES="${WORLDTMP}/include" \ |
229 |
|
PATH=${BPATH}:${PATH} \ |
230 |
|
WORLDTMP=${WORLDTMP} \ |
231 |
< |
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" |
231 |
> |
VERSION="${VERSION}" \ |
232 |
> |
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ |
233 |
> |
COMPILER_TYPE=${COMPILER_TYPE} |
234 |
|
BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ |
235 |
|
${BMAKEENV} ${MAKE} -f Makefile.inc1 \ |
236 |
|
DESTDIR= \ |
237 |
|
BOOTSTRAPPING=${OSRELDATE} \ |
238 |
+ |
SSP_CFLAGS= \ |
239 |
|
-DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \ |
240 |
< |
-DWITHOUT_NLS -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \ |
241 |
< |
-DNO_CPU_CFLAGS -DNO_WARNS |
240 |
> |
-DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \ |
241 |
> |
-DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD |
242 |
|
|
243 |
|
# build-tools stage |
244 |
|
TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ |
245 |
|
${BMAKEENV} ${MAKE} -f Makefile.inc1 \ |
246 |
|
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ |
247 |
|
DESTDIR= \ |
248 |
< |
BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS |
248 |
> |
BOOTSTRAPPING=${OSRELDATE} \ |
249 |
> |
SSP_CFLAGS= \ |
250 |
> |
-DNO_LINT \ |
251 |
> |
-DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD |
252 |
|
|
253 |
|
# cross-tools stage |
254 |
|
XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ |
258 |
|
# world stage |
259 |
|
WMAKEENV= ${CROSSENV} \ |
260 |
|
_SHLIBDIRPREFIX=${WORLDTMP} \ |
261 |
+ |
_LDSCRIPTROOT= \ |
262 |
+ |
MACHINE_INCLUDES="${WORLDTMP}/include" \ |
263 |
+ |
VERSION="${VERSION}" \ |
264 |
|
INSTALL="sh ${.CURDIR}/tools/install.sh" \ |
265 |
|
PATH=${TMPPATH} |
266 |
+ |
.if ${MK_CDDL} == "no" |
267 |
+ |
WMAKEENV+= NO_CTF=1 |
268 |
+ |
.endif |
269 |
+ |
.if ${CC:T:Mgcc} == "gcc" |
270 |
+ |
WMAKE_COMPILER_TYPE= gcc |
271 |
+ |
.elif ${CC:T:Mclang} == "clang" |
272 |
+ |
WMAKE_COMPILER_TYPE= clang |
273 |
+ |
.elif ${MK_CLANG_IS_CC} == "no" |
274 |
+ |
WMAKE_COMPILER_TYPE= gcc |
275 |
+ |
.else |
276 |
+ |
WMAKE_COMPILER_TYPE= clang |
277 |
+ |
.endif |
278 |
+ |
WMAKEENV+= COMPILER_TYPE=${WMAKE_COMPILER_TYPE} |
279 |
|
WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP} |
280 |
|
|
281 |
|
.if ${TARGET_ARCH} == "amd64" |
282 |
|
# 32 bit world |
283 |
|
LIB32TMP= ${OBJTREE}${.CURDIR}/lib32 |
284 |
|
|
285 |
+ |
.if ${TARGET_ARCH} == "amd64" |
286 |
|
.if empty(TARGET_CPUTYPE) |
287 |
< |
LIB32CPUTYPE= -march=i686 -mmmx -msse -msse2 |
287 |
> |
LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2 |
288 |
|
.else |
289 |
< |
LIB32CPUTYPE= ${TARGET_CPUTYPE} |
289 |
> |
LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} |
290 |
|
.endif |
291 |
< |
LIB32FLAGS= -m32 -march=${LIB32CPUTYPE} -mfancy-math-387 -DCOMPAT_32BIT \ |
292 |
< |
-iprefix ${LIB32TMP}/usr/ \ |
291 |
> |
LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \ |
292 |
> |
MACHINE_CPU="i686 mmx sse sse2" \ |
293 |
> |
LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \ |
294 |
> |
AS="${AS} --32" |
295 |
> |
.endif |
296 |
> |
|
297 |
> |
|
298 |
> |
LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -DCOMPAT_32BIT \ |
299 |
> |
-isystem ${LIB32TMP}/usr/include/ \ |
300 |
|
-L${LIB32TMP}/usr/lib32 \ |
301 |
|
-B${LIB32TMP}/usr/lib32 |
302 |
|
|
303 |
|
# Yes, the flags are redundant. |
304 |
< |
LIB32WMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \ |
304 |
> |
LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \ |
305 |
|
_SHLIBDIRPREFIX=${LIB32TMP} \ |
306 |
< |
MACHINE=i386 \ |
307 |
< |
MACHINE_ARCH=i386 \ |
306 |
> |
_LDSCRIPTROOT=${LIB32TMP} \ |
307 |
> |
VERSION="${VERSION}" \ |
308 |
|
INSTALL="sh ${.CURDIR}/tools/install.sh" \ |
309 |
|
PATH=${TMPPATH} \ |
310 |
|
CC="${CC} ${LIB32FLAGS}" \ |
311 |
|
CXX="${CXX} ${LIB32FLAGS}" \ |
256 |
– |
OBJC="${OBJC} ${LIB32FLAGS}" \ |
257 |
– |
LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \ |
258 |
– |
AS="${AS} --32" \ |
312 |
|
LIBDIR=/usr/lib32 \ |
313 |
< |
SHLIBDIR=/usr/lib32 |
313 |
> |
SHLIBDIR=/usr/lib32 \ |
314 |
> |
LIBPRIVATEDIR=/usr/lib32/private \ |
315 |
> |
MACHINE_INCLUDES="${WORLDTMP}/include" \ |
316 |
> |
COMPILER_TYPE=${WMAKE_COMPILER_TYPE} |
317 |
|
|
318 |
|
LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \ |
319 |
< |
-DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_INFO \ |
320 |
< |
-DWITHOUT_HTML DESTDIR=${LIB32TMP} |
321 |
< |
LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS |
319 |
> |
-DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO \ |
320 |
> |
-DWITHOUT_HTML -DNO_CTF -DNO_LINT -ECC -ECXX -EAS -ELD \ |
321 |
> |
DESTDIR=${LIB32TMP} |
322 |
> |
LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS |
323 |
|
.endif |
324 |
|
|
325 |
|
# install stage |
326 |
+ |
IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*} |
327 |
+ |
IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 |
328 |
|
.if empty(.MAKEFLAGS:M-n) |
329 |
< |
IMAKEENV= ${CROSSENV} \ |
330 |
< |
PATH=${STRICTTMPPATH}:${INSTALLTMP} |
329 |
> |
IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \ |
330 |
> |
LD_LIBRARY_PATH=${INSTALLTMP} \ |
331 |
> |
PATH_LOCALE=${INSTALLTMP}/locale |
332 |
> |
IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh |
333 |
|
.else |
334 |
< |
IMAKEENV= ${CROSSENV} \ |
274 |
< |
PATH=${TMPPATH}:${INSTALLTMP} |
334 |
> |
IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP} |
335 |
|
.endif |
276 |
– |
IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 |
336 |
|
|
337 |
|
# kernel stage |
338 |
|
KMAKEENV= ${WMAKEENV} |
359 |
|
@echo "--------------------------------------------------------------" |
360 |
|
.if !defined(NO_CLEAN) |
361 |
|
rm -rf ${WORLDTMP} |
362 |
< |
.if ${TARGET_ARCH} == "amd64" |
362 |
> |
.if defined(LIB32TMP) |
363 |
|
rm -rf ${LIB32TMP} |
364 |
|
.endif |
365 |
|
.else |
366 |
|
rm -rf ${WORLDTMP}/legacy/usr/include |
367 |
< |
# XXX - These two can depend on any header file. |
367 |
> |
# XXX - These three can depend on any header file. |
368 |
|
rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c |
369 |
+ |
rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c |
370 |
|
rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c |
371 |
|
.endif |
372 |
|
.for _dir in \ |
373 |
< |
usr/bin usr/games usr/include/sys usr/lib \ |
314 |
< |
usr/libexec usr/sbin usr/share/dict \ |
315 |
< |
usr/share/groff_font/devX100 \ |
316 |
< |
usr/share/groff_font/devX100-12 \ |
317 |
< |
usr/share/groff_font/devX75 \ |
318 |
< |
usr/share/groff_font/devX75-12 \ |
319 |
< |
usr/share/groff_font/devascii \ |
320 |
< |
usr/share/groff_font/devcp1047 \ |
321 |
< |
usr/share/groff_font/devdvi \ |
322 |
< |
usr/share/groff_font/devhtml \ |
323 |
< |
usr/share/groff_font/devkoi8-r \ |
324 |
< |
usr/share/groff_font/devlatin1 \ |
325 |
< |
usr/share/groff_font/devlbp \ |
326 |
< |
usr/share/groff_font/devlj4 \ |
327 |
< |
usr/share/groff_font/devps \ |
328 |
< |
usr/share/groff_font/devutf8 \ |
329 |
< |
usr/share/tmac/mdoc usr/share/tmac/mm |
330 |
< |
mkdir -p ${WORLDTMP}/legacy/${_dir} |
331 |
< |
.endfor |
332 |
< |
.for _dir in \ |
333 |
< |
lib usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \ |
334 |
< |
usr/libdata/pkgconfig usr/libexec usr/sbin usr/share/misc |
373 |
> |
lib usr legacy/usr legacy/usr/bin legacy/usr/sbin |
374 |
|
mkdir -p ${WORLDTMP}/${_dir} |
375 |
|
.endfor |
376 |
+ |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ |
377 |
+ |
-p ${WORLDTMP}/legacy/usr >/dev/null |
378 |
+ |
.if ${MK_GROFF} != "no" |
379 |
+ |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.groff.dist \ |
380 |
+ |
-p ${WORLDTMP}/legacy/usr >/dev/null |
381 |
+ |
.endif |
382 |
+ |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ |
383 |
+ |
-p ${WORLDTMP}/usr >/dev/null |
384 |
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ |
385 |
|
-p ${WORLDTMP}/usr/include >/dev/null |
386 |
|
ln -sf ${.CURDIR}/sys ${WORLDTMP} |
407 |
|
@echo ">>> stage 2.1: cleaning up the object tree" |
408 |
|
@echo "--------------------------------------------------------------" |
409 |
|
${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/} |
410 |
< |
.if ${TARGET_ARCH} == "amd64" |
410 |
> |
.if defined(LIB32TMP) |
411 |
|
${_+_}cd ${.CURDIR}; ${LIB32WMAKE} -f Makefile.inc1 ${CLEANDIR:S/^/par-/} |
412 |
|
.endif |
413 |
|
.endif |
442 |
|
@echo "--------------------------------------------------------------" |
443 |
|
${_+_}cd ${.CURDIR}; \ |
444 |
|
${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \ |
445 |
< |
-DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE libraries |
445 |
> |
-DWITHOUT_MAN -DWITHOUT_PROFILE libraries |
446 |
|
_depend: |
447 |
|
@echo |
448 |
|
@echo "--------------------------------------------------------------" |
455 |
|
@echo ">>> stage 4.4: building everything" |
456 |
|
@echo "--------------------------------------------------------------" |
457 |
|
${_+_}cd ${.CURDIR}; ${WMAKE} par-all |
458 |
< |
.if ${TARGET_ARCH} == "amd64" |
458 |
> |
.if defined(LIB32TMP) |
459 |
|
build32: |
460 |
|
@echo |
461 |
|
@echo "--------------------------------------------------------------" |
462 |
|
@echo ">>> stage 5.1: building 32 bit shim libraries" |
463 |
|
@echo "--------------------------------------------------------------" |
464 |
< |
.for _dir in \ |
465 |
< |
usr/include usr/lib32 usr/share/misc |
466 |
< |
mkdir -p ${LIB32TMP}/${_dir} |
420 |
< |
.endfor |
464 |
> |
mkdir -p ${LIB32TMP}/usr/include |
465 |
> |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ |
466 |
> |
-p ${LIB32TMP}/usr >/dev/null |
467 |
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ |
468 |
|
-p ${LIB32TMP}/usr/include >/dev/null |
469 |
|
mkdir -p ${WORLDTMP} |
470 |
|
ln -sf ${.CURDIR}/sys ${WORLDTMP} |
425 |
– |
.if ${MK_KERBEROS} != "no" |
426 |
– |
.for _t in obj depend all |
427 |
– |
cd ${.CURDIR}/kerberos5/tools; \ |
428 |
– |
MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} DESTDIR= ${_t} |
429 |
– |
.endfor |
430 |
– |
.endif |
471 |
|
.for _t in obj includes |
472 |
< |
cd ${.CURDIR}/include; ${LIB32WMAKE} ${_t} |
473 |
< |
cd ${.CURDIR}/lib; ${LIB32WMAKE} ${_t} |
472 |
> |
cd ${.CURDIR}/include; ${LIB32WMAKE} DIRPRFX=include/ ${_t} |
473 |
> |
cd ${.CURDIR}/lib; ${LIB32WMAKE} DIRPRFX=lib/ ${_t} |
474 |
> |
.if ${MK_APACHE} != "no" |
475 |
> |
cd ${.CURDIR}/apache/lib; ${LIB32WMAKE} ${_t} |
476 |
> |
.endif |
477 |
|
.if ${MK_CDDL} != "no" |
478 |
< |
cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} ${_t} |
478 |
> |
cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} DIRPRFX=cddl/lib/ ${_t} |
479 |
|
.endif |
480 |
< |
cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} ${_t} |
480 |
> |
cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} DIRPRFX=gnu/lib/ ${_t} |
481 |
|
.if ${MK_CRYPT} != "no" |
482 |
< |
cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} ${_t} |
482 |
> |
cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} DIRPRFX=secure/lib/ ${_t} |
483 |
|
.endif |
484 |
|
.if ${MK_KERBEROS} != "no" |
485 |
< |
cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} ${_t} |
485 |
> |
cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} DIRPRFX=kerberos5/lib ${_t} |
486 |
|
.endif |
487 |
|
.endfor |
488 |
|
.for _dir in usr.bin/lex/lib |
489 |
< |
cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} obj |
489 |
> |
cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} DIRPRFX=${_dir}/ obj |
490 |
|
.endfor |
491 |
|
.for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic |
492 |
|
cd ${.CURDIR}/${_dir}; \ |
493 |
< |
MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} DESTDIR= build-tools |
493 |
> |
WORLDTMP=${WORLDTMP} \ |
494 |
> |
MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ |
495 |
> |
DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \ |
496 |
> |
-DEARLY_BUILD build-tools |
497 |
|
.endfor |
498 |
|
cd ${.CURDIR}; \ |
499 |
|
${LIB32WMAKE} -f Makefile.inc1 libraries |
500 |
|
.for _t in obj depend all |
501 |
< |
cd ${.CURDIR}/libexec/rtld-elf; \ |
502 |
< |
PROG=ld-elf32.so.1 ${LIB32WMAKE} ${_t} |
501 |
> |
cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \ |
502 |
> |
DIRPRFX=libexec/rtld-elf/ ${_t} |
503 |
> |
cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \ |
504 |
> |
DIRPRFX=usr.bin/ldd ${_t} |
505 |
|
.endfor |
506 |
|
|
507 |
|
distribute32 install32: |
460 |
– |
.if make(distribute32) |
461 |
– |
mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32 # XXX add to mtree |
462 |
– |
.else |
463 |
– |
mkdir -p ${DESTDIR}/usr/lib32 # XXX add to mtree |
464 |
– |
.endif |
508 |
|
cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} |
509 |
+ |
.if ${MK_CDDL} != "no" |
510 |
+ |
cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} |
511 |
+ |
.endif |
512 |
|
cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} |
513 |
|
.if ${MK_CRYPT} != "no" |
514 |
|
cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} |
515 |
|
.endif |
516 |
< |
cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//} |
516 |
> |
.if ${MK_KERBEROS} != "no" |
517 |
> |
cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} |
518 |
|
.endif |
519 |
+ |
cd ${.CURDIR}/libexec/rtld-elf; \ |
520 |
+ |
PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//} |
521 |
+ |
cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//} |
522 |
+ |
.endif |
523 |
|
|
473 |
– |
|
524 |
|
WMAKE_TGTS= |
525 |
|
.if !defined(SUBDIR_OVERRIDE) |
526 |
|
WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools |
530 |
|
WMAKE_TGTS+= _cross-tools |
531 |
|
.endif |
532 |
|
WMAKE_TGTS+= _includes _libraries _depend everything |
533 |
< |
.if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no" |
533 |
> |
.if defined(LIB32TMP) && ${MK_LIB32} != "no" |
534 |
|
WMAKE_TGTS+= build32 |
535 |
|
.endif |
536 |
|
|
615 |
|
.endfor |
616 |
|
|
617 |
|
# |
618 |
+ |
# Required install tools to be saved in a scratch dir for safety. |
619 |
+ |
# |
620 |
+ |
.if ${MK_INFO} != "no" |
621 |
+ |
_install-info= install-info |
622 |
+ |
.endif |
623 |
+ |
.if ${MK_ZONEINFO} != "no" |
624 |
+ |
_zoneinfo= zic tzsetup |
625 |
+ |
.endif |
626 |
+ |
|
627 |
+ |
ITOOLS= [ awk cap_mkdb cat chflags chmod chown \ |
628 |
+ |
date echo egrep find grep ${_install-info} \ |
629 |
+ |
ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \ |
630 |
+ |
test true uname wc ${_zoneinfo} |
631 |
+ |
|
632 |
+ |
# |
633 |
|
# distributeworld |
634 |
|
# |
635 |
|
# Distributes everything compiled by a `buildworld'. |
638 |
|
# |
639 |
|
# Installs everything compiled by a 'buildworld'. |
640 |
|
# |
641 |
+ |
|
642 |
+ |
# Non-base distributions produced by the base system |
643 |
+ |
EXTRA_DISTRIBUTIONS= doc |
644 |
+ |
.if ${MK_GAMES} != "no" |
645 |
+ |
EXTRA_DISTRIBUTIONS+= games |
646 |
+ |
.endif |
647 |
+ |
.if defined(LIB32TMP) && ${MK_LIB32} != "no" |
648 |
+ |
EXTRA_DISTRIBUTIONS+= lib32 |
649 |
+ |
.endif |
650 |
+ |
|
651 |
|
distributeworld installworld: installcheck |
652 |
|
mkdir -p ${INSTALLTMP} |
653 |
< |
for prog in [ awk cap_mkdb cat chflags chmod chown \ |
654 |
< |
date echo egrep find grep install-info \ |
655 |
< |
ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \ |
656 |
< |
test true uname wc zic; do \ |
657 |
< |
cp `which $$prog` ${INSTALLTMP}; \ |
658 |
< |
done |
659 |
< |
${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//} |
660 |
< |
rm -rf ${INSTALLTMP} |
653 |
> |
progs=$$(for prog in ${ITOOLS}; do \ |
654 |
> |
if progpath=`which $$prog`; then \ |
655 |
> |
echo $$progpath; \ |
656 |
> |
else \ |
657 |
> |
echo "Required tool $$prog not found in PATH." >&2; \ |
658 |
> |
exit 1; \ |
659 |
> |
fi; \ |
660 |
> |
done); \ |
661 |
> |
libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \ |
662 |
> |
while read line; do \ |
663 |
> |
set -- $$line; \ |
664 |
> |
if [ "$$2 $$3" != "not found" ]; then \ |
665 |
> |
echo $$2; \ |
666 |
> |
else \ |
667 |
> |
echo "Required library $$1 not found." >&2; \ |
668 |
> |
exit 1; \ |
669 |
> |
fi; \ |
670 |
> |
done); \ |
671 |
> |
cp $$libs $$progs ${INSTALLTMP} |
672 |
> |
cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale |
673 |
> |
.if make(distributeworld) |
674 |
> |
.for dist in ${EXTRA_DISTRIBUTIONS} |
675 |
> |
-mkdir ${DESTDIR}/${DISTDIR}/${dist} |
676 |
> |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \ |
677 |
> |
-p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null |
678 |
> |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ |
679 |
> |
-p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null |
680 |
> |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ |
681 |
> |
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null |
682 |
> |
.endfor |
683 |
> |
-mkdir ${DESTDIR}/${DISTDIR}/base |
684 |
> |
${_+_}cd ${.CURDIR}; ${IMAKE} distrib-dirs \ |
685 |
> |
DESTDIR=${DESTDIR}/${DISTDIR}/base |
686 |
> |
.endif |
687 |
> |
${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \ |
688 |
> |
${IMAKEENV} rm -rf ${INSTALLTMP} |
689 |
> |
.if make(distributeworld) |
690 |
> |
.for dist in ${EXTRA_DISTRIBUTIONS} |
691 |
> |
find ${DESTDIR}/${DISTDIR}/${dist} -empty -delete |
692 |
> |
.endfor |
693 |
> |
.endif |
694 |
|
|
695 |
+ |
packageworld: |
696 |
+ |
.for dist in base ${EXTRA_DISTRIBUTIONS} |
697 |
+ |
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ |
698 |
+ |
tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz . |
699 |
+ |
.endfor |
700 |
+ |
|
701 |
|
# |
702 |
|
# reinstall |
703 |
|
# |
715 |
|
@echo ">>> Installing everything" |
716 |
|
@echo "--------------------------------------------------------------" |
717 |
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install |
718 |
< |
.if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no" |
718 |
> |
.if defined(LIB32TMP) && ${MK_LIB32} != "no" |
719 |
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32 |
720 |
|
.endif |
721 |
|
|
724 |
|
@echo ">>> Distributing everything" |
725 |
|
@echo "--------------------------------------------------------------" |
726 |
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute |
727 |
< |
.if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no" |
728 |
< |
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 DISTRIBUTION=lib32 |
727 |
> |
.if defined(LIB32TMP) && ${MK_LIB32} != "no" |
728 |
> |
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 \ |
729 |
> |
DISTRIBUTION=lib32 |
730 |
|
.endif |
731 |
|
|
732 |
|
distrib-dirs distribution: |
746 |
|
# be set to cross-build, we have to make sure TARGET is set |
747 |
|
# properly. |
748 |
|
|
749 |
+ |
.if defined(KERNFAST) |
750 |
+ |
NO_KERNELCLEAN= t |
751 |
+ |
NO_KERNELCONFIG= t |
752 |
+ |
NO_KERNELDEPEND= t |
753 |
+ |
NO_KERNELOBJ= t |
754 |
+ |
# Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah |
755 |
+ |
.if !defined(KERNCONF) && ${KERNFAST} != "1" |
756 |
+ |
KERNCONF=${KERNFAST} |
757 |
+ |
.endif |
758 |
+ |
.endif |
759 |
|
.if !defined(KERNCONF) && defined(KERNEL) |
760 |
|
KERNCONF= ${KERNEL} |
761 |
|
KERNWARN= |
820 |
|
@echo "--------------------------------------------------------------" |
821 |
|
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR} |
822 |
|
.endif |
823 |
+ |
.if !defined(NO_KERNELOBJ) |
824 |
|
@echo |
825 |
|
@echo "--------------------------------------------------------------" |
826 |
|
@echo ">>> stage 2.2: rebuilding the object tree" |
827 |
|
@echo "--------------------------------------------------------------" |
828 |
|
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj |
829 |
+ |
.endif |
830 |
|
@echo |
831 |
|
@echo "--------------------------------------------------------------" |
832 |
|
@echo ">>> stage 2.3: build tools" |
833 |
|
@echo "--------------------------------------------------------------" |
834 |
|
cd ${KRNLOBJDIR}/${_kernel}; \ |
835 |
+ |
PATH=${BPATH}:${PATH} \ |
836 |
|
MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ |
837 |
< |
${MAKE} -DNO_CPU_CFLAGS -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile |
837 |
> |
${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF -DEARLY_BUILD \ |
838 |
> |
-f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile |
839 |
|
# XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. |
840 |
|
.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) |
841 |
|
.for target in obj depend all |
842 |
|
cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \ |
843 |
+ |
PATH=${BPATH}:${PATH} \ |
844 |
|
MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ |
845 |
< |
${MAKE} -DNO_CPU_CFLAGS ${target} |
845 |
> |
${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF -DEARLY_BUILD ${target} |
846 |
|
.endfor |
847 |
|
.endif |
848 |
|
.if !defined(NO_KERNELDEPEND) |
874 |
|
false |
875 |
|
.endif |
876 |
|
@echo "--------------------------------------------------------------" |
877 |
< |
@echo ">>> Installing kernel" |
877 |
> |
@echo ">>> Installing kernel ${INSTALLKERNEL}" |
878 |
|
@echo "--------------------------------------------------------------" |
879 |
|
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ |
880 |
|
${CROSSENV} PATH=${TMPPATH} \ |
881 |
|
${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} |
882 |
|
|
883 |
+ |
distributekernel distributekernel.debug: |
884 |
+ |
.if empty(INSTALLKERNEL) |
885 |
+ |
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \ |
886 |
+ |
false |
887 |
+ |
.endif |
888 |
+ |
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ |
889 |
+ |
${CROSSENV} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \ |
890 |
+ |
DESTDIR=${DESTDIR}/${DISTDIR}/kernel \ |
891 |
+ |
${.TARGET:S/distributekernel/install/} |
892 |
+ |
.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} |
893 |
+ |
cd ${KRNLOBJDIR}/${_kernel}; \ |
894 |
+ |
${CROSSENV} PATH=${TMPPATH} ${MAKE} \ |
895 |
+ |
KERNEL=${INSTKERNNAME}.${_kernel} \ |
896 |
+ |
DESTDIR=${DESTDIR}/${DISTDIR}/kernel.${_kernel} \ |
897 |
+ |
${.TARGET:S/distributekernel/install/} |
898 |
+ |
.endfor |
899 |
+ |
|
900 |
+ |
packagekernel: |
901 |
+ |
cd ${DESTDIR}/${DISTDIR}/kernel; \ |
902 |
+ |
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz . |
903 |
+ |
.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} |
904 |
+ |
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ |
905 |
+ |
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz . |
906 |
+ |
.endfor |
907 |
+ |
|
908 |
|
# |
909 |
|
# doxygen |
910 |
|
# |
920 |
|
# |
921 |
|
# update |
922 |
|
# |
923 |
< |
# Update the source tree, by running cvsup and/or running cvs to update to the |
923 |
> |
# Update the source tree(s), by running cvsup/cvs/svn to update to the |
924 |
|
# latest copy. |
925 |
|
# |
926 |
|
update: |
945 |
|
.endif |
946 |
|
.endif |
947 |
|
.if defined(CVS_UPDATE) |
948 |
< |
@echo "--------------------------------------------------------------" |
949 |
< |
@echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT} |
950 |
< |
@echo "--------------------------------------------------------------" |
951 |
< |
cd ${.CURDIR}; ${CVS} -R -q update ${CVSFLAGS} |
948 |
> |
@cd ${.CURDIR} ; \ |
949 |
> |
if [ -d CVS ] ; then \ |
950 |
> |
echo "--------------------------------------------------------------" ; \ |
951 |
> |
echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT} ; \ |
952 |
> |
echo "--------------------------------------------------------------" ; \ |
953 |
> |
echo ${CVS} -R -q update ${CVSFLAGS} ; \ |
954 |
> |
${CVS} -R -q update ${CVSFLAGS} ; \ |
955 |
> |
fi |
956 |
|
.endif |
957 |
+ |
.if defined(SVN_UPDATE) |
958 |
+ |
@cd ${.CURDIR} ; \ |
959 |
+ |
if [ -d .svn ] ; then \ |
960 |
+ |
echo "--------------------------------------------------------------" ; \ |
961 |
+ |
echo ">>> Updating ${.CURDIR} using Subversion" ; \ |
962 |
+ |
echo "--------------------------------------------------------------" ; \ |
963 |
+ |
echo ${SVN} update ${SVNFLAGS} ; \ |
964 |
+ |
${SVN} update ${SVNFLAGS} ; \ |
965 |
+ |
fi |
966 |
+ |
.endif |
967 |
|
|
968 |
|
# |
969 |
|
# ------------------------------------------------------------------------ |
980 |
|
# legacy: Build compatibility shims for the next three targets |
981 |
|
# |
982 |
|
legacy: |
983 |
+ |
.if ${BOOTSTRAPPING} < 4000 && ${BOOTSTRAPPING} != 0 |
984 |
+ |
@echo "ERROR: Source upgrades from versions prior to 0.4 not supported."; \ |
985 |
+ |
false |
986 |
+ |
.endif |
987 |
+ |
mkdir -p ${MAKEOBJDIRPREFIX}/legacy/usr/bin |
988 |
|
.for _tool in tools/build |
989 |
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \ |
990 |
< |
cd ${.CURDIR}/${_tool}; \ |
991 |
< |
${MAKE} DIRPRFX=${_tool}/ obj; \ |
992 |
< |
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \ |
993 |
< |
${MAKE} DIRPRFX=${_tool}/ depend; \ |
994 |
< |
${MAKE} DIRPRFX=${_tool}/ all; \ |
990 |
> |
cd ${.CURDIR}/${_tool} && \ |
991 |
> |
${MAKE} DIRPRFX=${_tool}/ obj && \ |
992 |
> |
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes && \ |
993 |
> |
${MAKE} DIRPRFX=${_tool}/ depend && \ |
994 |
> |
${MAKE} DIRPRFX=${_tool}/ all && \ |
995 |
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install |
996 |
|
.endfor |
997 |
|
|
1004 |
|
|
1005 |
|
.if ${MK_CXX} != "no" |
1006 |
|
_gperf= gnu/usr.bin/gperf |
1007 |
< |
.if ${BOOTSTRAPPING} < 700004 |
1007 |
> |
.endif |
1008 |
> |
|
1009 |
> |
.if ${MK_GROFF} != "no" |
1010 |
|
_groff= gnu/usr.bin/groff |
835 |
– |
.else |
836 |
– |
_groff= gnu/usr.bin/groff/tmac |
1011 |
|
.endif |
1012 |
+ |
|
1013 |
+ |
.if ${BOOTSTRAPPING} >= 4000 && ${BOOTSTRAPPING} < 4015 |
1014 |
+ |
_ar= usr.bin/ar |
1015 |
|
.endif |
1016 |
|
|
1017 |
< |
.if ${BOOTSTRAPPING} < 700018 |
1017 |
> |
.if ${BOOTSTRAPPING} < 4015 |
1018 |
> |
_mklocale= usr.bin/mklocale |
1019 |
> |
.endif |
1020 |
> |
|
1021 |
> |
.if ${BOOTSTRAPPING} < 4015 |
1022 |
> |
_sed= usr.bin/sed |
1023 |
> |
.endif |
1024 |
> |
|
1025 |
> |
.if ${BOOTSTRAPPING} < 7003 |
1026 |
> |
_m4= usr.bin/m4 |
1027 |
> |
.endif |
1028 |
> |
|
1029 |
> |
.if ${BOOTSTRAPPING} < 7003 |
1030 |
> |
_lex= usr.bin/lex |
1031 |
> |
.endif |
1032 |
> |
|
1033 |
> |
.if ${BOOTSTRAPPING} < 7003 |
1034 |
> |
_yacc= lib/liby \ |
1035 |
> |
usr.bin/yacc |
1036 |
> |
.endif |
1037 |
> |
|
1038 |
> |
.if ${MK_BSNMP} != "no" && \ |
1039 |
> |
(${BOOTSTRAPPING} < 4015 || !exists(/usr/sbin/gensnmptree)) |
1040 |
|
_gensnmptree= usr.sbin/bsnmpd/gensnmptree |
1041 |
|
.endif |
1042 |
|
|
1043 |
|
.if ${MK_RESCUE} != "no" && \ |
1044 |
< |
${BOOTSTRAPPING} < 700026 |
1044 |
> |
${BOOTSTRAPPING} < 4015 |
1045 |
|
_crunchgen= usr.sbin/crunch/crunchgen |
1046 |
|
.endif |
1047 |
|
|
1048 |
+ |
.if ${MK_CLANG} != "no" |
1049 |
+ |
_clang_tblgen= \ |
1050 |
+ |
lib/clang/libllvmsupport \ |
1051 |
+ |
lib/clang/libllvmtablegen \ |
1052 |
+ |
usr.bin/clang/tblgen \ |
1053 |
+ |
usr.bin/clang/clang-tblgen |
1054 |
+ |
.endif |
1055 |
+ |
|
1056 |
+ |
.if ${MK_CDDL} != "no" && \ |
1057 |
+ |
${BOOTSTRAPPING} < 4015 && \ |
1058 |
+ |
!(${BOOTSTRAPPING} >= 4000 && ${BOOTSTRAPPING} < 4015) |
1059 |
+ |
_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ |
1060 |
+ |
lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge |
1061 |
+ |
.endif |
1062 |
+ |
|
1063 |
+ |
.if ${MK_FDT} != "no" |
1064 |
+ |
_dtc= gnu/usr.bin/dtc |
1065 |
+ |
.endif |
1066 |
+ |
|
1067 |
+ |
# Please document (add comment) why something is in 'bootstrap-tools'. |
1068 |
+ |
# Try to bound the building of the bootstrap-tool to just the |
1069 |
+ |
# MidnightBSD versions that need the tool built at this stage of the build. |
1070 |
|
bootstrap-tools: |
1071 |
|
.for _tool in \ |
1072 |
+ |
${_clang_tblgen} \ |
1073 |
+ |
${_kerberos5_bootstrap_tools} \ |
1074 |
+ |
${_dtrace_tools} \ |
1075 |
|
${_strfile} \ |
1076 |
|
${_gperf} \ |
1077 |
|
${_groff} \ |
1078 |
+ |
${_ar} \ |
1079 |
+ |
${_dtc} \ |
1080 |
+ |
${_awk} \ |
1081 |
|
usr.bin/lorder \ |
1082 |
|
usr.bin/makewhatis \ |
1083 |
+ |
${_mklocale} \ |
1084 |
|
usr.bin/rpcgen \ |
1085 |
+ |
${_sed} \ |
1086 |
+ |
${_yacc} \ |
1087 |
+ |
${_m4} \ |
1088 |
+ |
${_lex} \ |
1089 |
+ |
lib/libmd \ |
1090 |
|
usr.bin/xinstall \ |
1091 |
|
${_gensnmptree} \ |
1092 |
|
usr.sbin/config \ |
1110 |
|
_share= share/syscons/scrnmaps |
1111 |
|
.endif |
1112 |
|
|
1113 |
+ |
.if ${MK_GCC} != "no" && (${MK_CLANG_IS_CC} == "no" || ${TARGET} == "pc98") |
1114 |
+ |
_gcc_tools= gnu/usr.bin/cc/cc_tools |
1115 |
+ |
.endif |
1116 |
+ |
|
1117 |
|
.if ${MK_KERBEROS} != "no" |
1118 |
< |
_kerberos5_tools= kerberos5/tools |
1118 |
> |
_kerberos5_bootstrap_tools= \ |
1119 |
> |
kerberos5/tools/make-roken \ |
1120 |
> |
kerberos5/lib/libroken \ |
1121 |
> |
kerberos5/lib/libvers \ |
1122 |
> |
kerberos5/tools/asn1_compile \ |
1123 |
> |
kerberos5/tools/slc \ |
1124 |
> |
usr.bin/compile_et |
1125 |
> |
|
1126 |
> |
.ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g} |
1127 |
|
.endif |
1128 |
|
|
1129 |
|
.if ${MK_RESCUE} != "no" |
1141 |
|
${_aicasm} \ |
1142 |
|
usr.bin/awk \ |
1143 |
|
lib/libmagic \ |
1144 |
< |
usr.sbin/sysinstall |
1144 |
> |
usr.sbin/sysinstall \ |
1145 |
> |
usr.bin/mkesdb_static \ |
1146 |
> |
usr.bin/mkcsmapper_static |
1147 |
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \ |
1148 |
|
cd ${.CURDIR}/${_tool}; \ |
1149 |
|
${MAKE} DIRPRFX=${_tool}/ obj; \ |
1150 |
|
${MAKE} DIRPRFX=${_tool}/ build-tools |
1151 |
|
.endfor |
1152 |
|
.for _tool in \ |
1153 |
< |
gnu/usr.bin/cc/cc_tools \ |
1154 |
< |
${_kerberos5_tools} |
1155 |
< |
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \ |
1156 |
< |
cd ${.CURDIR}/${_tool}; \ |
1157 |
< |
${MAKE} DIRPRFX=${_tool}/ obj; \ |
1158 |
< |
${MAKE} DIRPRFX=${_tool}/ depend; \ |
1159 |
< |
${MAKE} DIRPRFX=${_tool}/ all |
1153 |
> |
${_gcc_tools} \ |
1154 |
> |
${_kerberos5_bootstrap_tools} |
1155 |
> |
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ |
1156 |
> |
cd ${.CURDIR}/${_tool} && \ |
1157 |
> |
${MAKE} DIRPRFX=${_tool}/ obj && \ |
1158 |
> |
${MAKE} DIRPRFX=${_tool}/ depend && \ |
1159 |
> |
${MAKE} DIRPRFX=${_tool}/ all && \ |
1160 |
> |
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP}/legacy install |
1161 |
|
.endfor |
1162 |
|
|
1163 |
|
# |
1164 |
|
# cross-tools: Build cross-building tools |
1165 |
|
# |
1166 |
< |
.if ${TARGET_ARCH} != ${MACHINE_ARCH} |
1166 |
> |
.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 4016 |
1167 |
|
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" |
1168 |
|
_btxld= usr.sbin/btxld |
1169 |
|
.endif |
1170 |
+ |
.endif |
1171 |
+ |
.if ${TARGET_ARCH} != ${MACHINE_ARCH} |
1172 |
|
.if ${MK_RESCUE} != "no" || defined(RELEASEDIR) |
1173 |
|
_crunchide= usr.sbin/crunch/crunchide |
1174 |
|
.endif |
1177 |
|
.endif |
1178 |
|
.endif |
1179 |
|
|
1180 |
+ |
.if ${MK_BINUTILS} != "no" |
1181 |
+ |
_binutils= gnu/usr.bin/binutils |
1182 |
+ |
.endif |
1183 |
+ |
|
1184 |
+ |
.if ${MK_CLANG} != "no" && (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") |
1185 |
+ |
_clang= usr.bin/clang |
1186 |
+ |
_clang_libs= lib/clang |
1187 |
+ |
.endif |
1188 |
+ |
|
1189 |
+ |
.if ${MK_GCC} != "no" && (${MK_CLANG_IS_CC} == "no" || ${TARGET} == "pc98") |
1190 |
+ |
_cc= gnu/usr.bin/cc |
1191 |
+ |
.endif |
1192 |
+ |
|
1193 |
|
cross-tools: |
1194 |
|
.for _tool in \ |
1195 |
< |
gnu/usr.bin/binutils \ |
1196 |
< |
gnu/usr.bin/cc \ |
1197 |
< |
usr.bin/sed \ |
1195 |
> |
${_clang_libs} \ |
1196 |
> |
${_clang} \ |
1197 |
> |
${_binutils} \ |
1198 |
> |
${_cc} \ |
1199 |
|
usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ |
1200 |
|
${_btxld} \ |
1201 |
|
${_crunchide} \ |
1231 |
|
# |
1232 |
|
# static libgcc.a prerequisite for shared libc |
1233 |
|
# |
1234 |
< |
_prereq_libs= gnu/lib/libgcc |
1234 |
> |
_prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc lib/libcompiler_rt |
1235 |
|
|
1236 |
|
# These dependencies are not automatically generated: |
1237 |
|
# |
1241 |
|
_startup_libs= gnu/lib/csu |
1242 |
|
.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf) |
1243 |
|
_startup_libs+= lib/csu/${MACHINE_ARCH}-elf |
1244 |
< |
.else |
1244 |
> |
.elif exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}) |
1245 |
|
_startup_libs+= lib/csu/${MACHINE_ARCH} |
1246 |
+ |
.else |
1247 |
+ |
_startup_libs+= lib/csu/${MACHINE_CPUARCH} |
1248 |
|
.endif |
1249 |
|
_startup_libs+= gnu/lib/libgcc |
1250 |
+ |
_startup_libs+= lib/libcompiler_rt |
1251 |
|
_startup_libs+= lib/libc |
1252 |
+ |
.if ${MK_LIBCPLUSPLUS} != "no" |
1253 |
+ |
_startup_libs+= lib/libcxxrt |
1254 |
+ |
.endif |
1255 |
|
|
1256 |
|
gnu/lib/libgcc__L: lib/libc__L |
1257 |
+ |
.if ${MK_LIBCPLUSPLUS} != "no" |
1258 |
+ |
lib/libcxxrt__L: gnu/lib/libgcc__L |
1259 |
+ |
.endif |
1260 |
|
|
1261 |
< |
_prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libkrb5} \ |
1261 |
> |
_prebuild_libs= ${_kerberos5_lib_libasn1} \ |
1262 |
> |
${_kerberos5_lib_libhdb} \ |
1263 |
> |
${_kerberos5_lib_libheimbase} \ |
1264 |
> |
${_kerberos5_lib_libheimntlm} \ |
1265 |
> |
${_kerberos5_lib_libheimsqlite} \ |
1266 |
> |
${_kerberos5_lib_libheimipcc} \ |
1267 |
> |
${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \ |
1268 |
|
${_kerberos5_lib_libroken} \ |
1269 |
< |
lib/libbz2 lib/libcom_err lib/libcrypt lib/libexpat \ |
1269 |
> |
${_kerberos5_lib_libwind} \ |
1270 |
> |
lib/libbz2 lib/libcom_err lib/libcrypt \ |
1271 |
> |
lib/libelf lib/libexpat \ |
1272 |
|
${_lib_libgssapi} ${_lib_libipx} \ |
1273 |
< |
lib/libkiconv lib/libkvm lib/libmd \ |
1273 |
> |
lib/libkiconv lib/libkvm lib/liblzma lib/libmd \ |
1274 |
|
lib/ncurses/ncurses lib/ncurses/ncursesw \ |
1275 |
< |
lib/libopie lib/libpam ${_default_thread_lib} \ |
1276 |
< |
lib/libradius lib/libsbuf lib/libtacplus lib/libutil \ |
1277 |
< |
${_lib_libypclnt} lib/libz lib/msun \ |
1275 |
> |
lib/libopie lib/libpam ${_lib_libthr} \ |
1276 |
> |
lib/libradius lib/libsbuf lib/libtacplus \ |
1277 |
> |
${_cddl_lib_libumem} \ |
1278 |
> |
lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ |
1279 |
|
${_secure_lib_libcrypto} ${_secure_lib_libssh} \ |
1280 |
< |
${_secure_lib_libssl} |
1280 |
> |
${_secure_lib_libssl} lib/libsqlite3 \ |
1281 |
> |
lib/libarchive lib/libfetch lib/libmagic \ |
1282 |
> |
lib/libblocksruntime |
1283 |
> |
.if ${MK_LIBTHR} != "no" |
1284 |
> |
_lib_libthr= lib/libthr |
1285 |
> |
.endif |
1286 |
|
|
1287 |
< |
.if ${MK_LIBTHR} != "no" && ${MK_LIBKSE} != "no" |
1288 |
< |
_default_thread_lib= lib/${DEFAULT_THREAD_LIB} |
1002 |
< |
.elif ${MK_LIBTHR} != "no" |
1003 |
< |
_default_thread_lib= lib/libthr |
1004 |
< |
.elif ${MK_LIBKSE} != "no" |
1005 |
< |
_default_thread_lib= lib/libkse |
1287 |
> |
.if ${MK_OFED} != "no" |
1288 |
> |
_ofed_lib= contrib/ofed/usr.lib/ |
1289 |
|
.endif |
1290 |
|
|
1291 |
< |
_generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib |
1291 |
> |
_generic_libs= ${_apache_lib} ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib} |
1292 |
|
|
1293 |
|
lib/libopie__L lib/libtacplus__L: lib/libmd__L |
1294 |
|
|
1295 |
+ |
.if ${MK_APACHE} != "no" |
1296 |
+ |
_apache_lib= apache/lib |
1297 |
+ |
.endif |
1298 |
+ |
|
1299 |
|
.if ${MK_CDDL} != "no" |
1300 |
+ |
_cddl_lib_libumem= cddl/lib/libumem |
1301 |
|
_cddl_lib= cddl/lib |
1302 |
|
.endif |
1303 |
|
|
1309 |
|
.if ${MK_OPENSSH} != "no" |
1310 |
|
_secure_lib_libssh= secure/lib/libssh |
1311 |
|
secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L |
1312 |
< |
.if ${MK_KERBEROS} != "no" |
1312 |
> |
.if ${MK_KERBEROS_SUPPORT} != "no" |
1313 |
|
secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \ |
1314 |
< |
kerberos5/lib/libasn1__L lib/libcom_err__L lib/libmd__L \ |
1315 |
< |
kerberos5/lib/libroken__L |
1314 |
> |
kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \ |
1315 |
> |
lib/libmd__L kerberos5/lib/libroken__L |
1316 |
|
.endif |
1317 |
|
.endif |
1318 |
|
.endif |
1319 |
|
_secure_lib= secure/lib |
1320 |
|
.endif |
1321 |
|
|
1322 |
+ |
.if ${MK_KERBEROS} != "no" |
1323 |
+ |
kerberos5/lib/libasn1__L: lib/libcom_err__L kerberos5/lib/libroken__L |
1324 |
+ |
kerberos5/lib/libhdb__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ |
1325 |
+ |
kerberos5/lib/libkrb5__L kerberos5/lib/libroken__L \ |
1326 |
+ |
kerberos5/lib/libwind__L kerberos5/lib/libheimsqlite__L |
1327 |
+ |
kerberos5/lib/libheimntlm__L: secure/lib/libcrypto__L kerberos5/lib/libkrb5__L \ |
1328 |
+ |
kerberos5/lib/libroken__L lib/libcom_err__L |
1329 |
+ |
kerberos5/lib/libhx509__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ |
1330 |
+ |
secure/lib/libcrypto__L kerberos5/lib/libroken__L kerberos5/lib/libwind__L |
1331 |
+ |
kerberos5/lib/libkrb5__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ |
1332 |
+ |
lib/libcrypt__L secure/lib/libcrypto__L kerberos5/lib/libhx509__L \ |
1333 |
+ |
kerberos5/lib/libroken__L kerberos5/lib/libwind__L \ |
1334 |
+ |
kerberos5/lib/libheimbase__L kerberos5/lib/libheimipcc__L |
1335 |
+ |
kerberos5/lib/libroken__L: lib/libcrypt__L |
1336 |
+ |
kerberos5/lib/libwind__L: kerberos5/lib/libroken__L lib/libcom_err__L |
1337 |
+ |
kerberos5/lib/libheimbase__L: lib/libthr__L |
1338 |
+ |
kerberos5/lib/libheimipcc__L: kerberos5/lib/libroken__L kerberos5/lib/libheimbase__L lib/libthr__L |
1339 |
+ |
kerberos5/lib/libheimsqlite__L: lib/libthr__L |
1340 |
+ |
.endif |
1341 |
+ |
|
1342 |
+ |
.if ${MK_GSSAPI} != "no" |
1343 |
+ |
_lib_libgssapi= lib/libgssapi |
1344 |
+ |
.endif |
1345 |
+ |
|
1346 |
|
.if ${MK_IPX} != "no" |
1347 |
|
_lib_libipx= lib/libipx |
1348 |
|
.endif |
1349 |
|
|
1350 |
|
.if ${MK_KERBEROS} != "no" |
1351 |
< |
_kerberos5_lib= kerberos5/lib |
1351 |
> |
_kerberos5_lib= kerberos5/lib |
1352 |
|
_kerberos5_lib_libasn1= kerberos5/lib/libasn1 |
1353 |
+ |
_kerberos5_lib_libhdb= kerberos5/lib/libhdb |
1354 |
+ |
_kerberos5_lib_libheimbase= kerberos5/lib/libheimbase |
1355 |
|
_kerberos5_lib_libkrb5= kerberos5/lib/libkrb5 |
1356 |
+ |
_kerberos5_lib_libhx509= kerberos5/lib/libhx509 |
1357 |
|
_kerberos5_lib_libroken= kerberos5/lib/libroken |
1358 |
< |
_lib_libgssapi= lib/libgssapi |
1358 |
> |
_kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm |
1359 |
> |
_kerberos5_lib_libheimsqlite= kerberos5/lib/libheimsqlite |
1360 |
> |
_kerberos5_lib_libheimipcc= kerberos5/lib/libheimipcc |
1361 |
> |
_kerberos5_lib_libwind= kerberos5/lib/libwind |
1362 |
> |
_libcom_err= lib/libcom_err |
1363 |
|
.endif |
1364 |
|
|
1365 |
|
.if ${MK_NIS} != "no" |
1371 |
|
.endif |
1372 |
|
|
1373 |
|
.for _lib in ${_prereq_libs} |
1374 |
< |
${_lib}__PL: .PHONY |
1374 |
> |
${_lib}__PL: .PHONY .MAKE |
1375 |
|
.if exists(${.CURDIR}/${_lib}) |
1376 |
|
${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ |
1377 |
< |
cd ${.CURDIR}/${_lib}; \ |
1378 |
< |
${MAKE} DIRPRFX=${_lib}/ obj; \ |
1379 |
< |
${MAKE} DIRPRFX=${_lib}/ depend; \ |
1380 |
< |
${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all; \ |
1377 |
> |
cd ${.CURDIR}/${_lib} && \ |
1378 |
> |
${MAKE} DIRPRFX=${_lib}/ obj && \ |
1379 |
> |
${MAKE} DIRPRFX=${_lib}/ depend && \ |
1380 |
> |
${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all && \ |
1381 |
|
${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install |
1382 |
|
.endif |
1383 |
|
.endfor |
1386 |
|
${_lib}__L: .PHONY |
1387 |
|
.if exists(${.CURDIR}/${_lib}) |
1388 |
|
${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ |
1389 |
< |
cd ${.CURDIR}/${_lib}; \ |
1390 |
< |
${MAKE} DIRPRFX=${_lib}/ obj; \ |
1391 |
< |
${MAKE} DIRPRFX=${_lib}/ depend; \ |
1392 |
< |
${MAKE} DIRPRFX=${_lib}/ all; \ |
1389 |
> |
cd ${.CURDIR}/${_lib} && \ |
1390 |
> |
${MAKE} DIRPRFX=${_lib}/ obj && \ |
1391 |
> |
${MAKE} DIRPRFX=${_lib}/ depend && \ |
1392 |
> |
${MAKE} DIRPRFX=${_lib}/ all && \ |
1393 |
|
${MAKE} DIRPRFX=${_lib}/ install |
1394 |
|
.endif |
1395 |
|
.endfor |
1455 |
|
@echo ">>> Removing old files (only deletes safe to delete libs)" |
1456 |
|
# Ask for every old file if the user really wants to remove it. |
1457 |
|
# It's annoying, but better safe than sorry. |
1458 |
< |
@for file in ${OLD_FILES}; do \ |
1458 |
> |
# NB: We cannot pass the list of OLD_FILES as a parameter because the |
1459 |
> |
# argument list will get too long. Using .for/.endfor make "loops" will make |
1460 |
> |
# the Makefile parser segfault. |
1461 |
> |
@exec 3<&0; \ |
1462 |
> |
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1463 |
> |
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \ |
1464 |
> |
while read file; do \ |
1465 |
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ |
1466 |
|
chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ |
1467 |
< |
rm ${RM_I} "${DESTDIR}/$${file}"; \ |
1467 |
> |
rm ${RM_I} "${DESTDIR}/$${file}" <&3; \ |
1468 |
|
fi; \ |
1469 |
|
done |
1470 |
|
# Remove catpages without corresponding manpages. |
1471 |
< |
@3<&0; \ |
1471 |
> |
@exec 3<&0; \ |
1472 |
|
find ${DESTDIR}/usr/share/man/cat* ! -type d | \ |
1473 |
|
sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ |
1474 |
|
while read catpage; do \ |
1475 |
|
read manpage; \ |
1476 |
|
if [ ! -e "$${manpage}" ]; then \ |
1477 |
< |
rm ${RM_I} $${catpage} <&3 ; \ |
1477 |
> |
rm ${RM_I} $${catpage} <&3; \ |
1478 |
|
fi; \ |
1479 |
|
done |
1480 |
|
@echo ">>> Old files removed" |
1481 |
|
|
1482 |
|
check-old-files: |
1483 |
|
@echo ">>> Checking for old files" |
1484 |
< |
@for file in ${OLD_FILES}; do \ |
1484 |
> |
@${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1485 |
> |
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \ |
1486 |
> |
while read file; do \ |
1487 |
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ |
1488 |
|
echo "${DESTDIR}/$${file}"; \ |
1489 |
|
fi; \ |
1494 |
|
while read catpage; do \ |
1495 |
|
read manpage; \ |
1496 |
|
if [ ! -e "$${manpage}" ]; then \ |
1497 |
< |
echo $${catpage} ; \ |
1497 |
> |
echo $${catpage}; \ |
1498 |
|
fi; \ |
1499 |
|
done |
1500 |
|
|
1501 |
|
delete-old-libs: |
1502 |
|
@echo ">>> Removing old libraries" |
1503 |
|
@echo "${OLD_LIBS_MESSAGE}" | fmt |
1504 |
< |
@for file in ${OLD_LIBS}; do \ |
1504 |
> |
@exec 3<&0; \ |
1505 |
> |
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1506 |
> |
-V OLD_LIBS | xargs -n1 | \ |
1507 |
> |
while read file; do \ |
1508 |
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ |
1509 |
|
chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ |
1510 |
< |
rm ${RM_I} "${DESTDIR}/$${file}"; \ |
1510 |
> |
rm ${RM_I} "${DESTDIR}/$${file}" <&3; \ |
1511 |
|
fi; \ |
1512 |
|
done |
1513 |
|
@echo ">>> Old libraries removed" |
1514 |
|
|
1515 |
|
check-old-libs: |
1516 |
|
@echo ">>> Checking for old libraries" |
1517 |
< |
@for file in ${OLD_LIBS}; do \ |
1517 |
> |
@${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1518 |
> |
-V OLD_LIBS | xargs -n1 | \ |
1519 |
> |
while read file; do \ |
1520 |
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ |
1521 |
|
echo "${DESTDIR}/$${file}"; \ |
1522 |
|
fi; \ |
1524 |
|
|
1525 |
|
delete-old-dirs: |
1526 |
|
@echo ">>> Removing old directories" |
1527 |
< |
@for dir in ${OLD_DIRS}; do \ |
1527 |
> |
@${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1528 |
> |
-V OLD_DIRS | xargs -n1 | \ |
1529 |
> |
while read dir; do \ |
1530 |
|
if [ -d "${DESTDIR}/$${dir}" ]; then \ |
1531 |
|
rmdir -v "${DESTDIR}/$${dir}" || true; \ |
1532 |
|
elif [ -L "${DESTDIR}/$${dir}" ]; then \ |
1537 |
|
|
1538 |
|
check-old-dirs: |
1539 |
|
@echo ">>> Checking for old directories" |
1540 |
< |
@for dir in ${OLD_DIRS}; do \ |
1540 |
> |
@${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1541 |
> |
-V OLD_DIRS | xargs -n1 | \ |
1542 |
> |
while read dir; do \ |
1543 |
|
if [ -d "${DESTDIR}/$${dir}" ]; then \ |
1544 |
|
echo "${DESTDIR}/$${dir}"; \ |
1545 |
|
elif [ -L "${DESTDIR}/$${dir}" ]; then \ |
1561 |
|
# |
1562 |
|
showconfig: |
1563 |
|
@${MAKE} -n -f bsd.own.mk -V dummy -dg1 | grep ^MK_ | sort |
1564 |
+ |
|
1565 |
+ |
.if !empty(KRNLOBJDIR) && !empty(KERNCONF) |
1566 |
+ |
DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/ |
1567 |
+ |
|
1568 |
+ |
.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE) |
1569 |
+ |
.if exists(${KERNCONFDIR}/${KERNCONF}) |
1570 |
+ |
FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \ |
1571 |
+ |
${KERNCONFDIR}/${KERNCONF} ; echo |
1572 |
+ |
.endif |
1573 |
+ |
.endif |
1574 |
+ |
|
1575 |
+ |
.endif |
1576 |
+ |
|
1577 |
+ |
.if !defined(DTBOUTPUTPATH) || !exists(${DTBOUTPUTPATH}) |
1578 |
+ |
DTBOUTPUTPATH= ${.CURDIR} |
1579 |
+ |
.endif |
1580 |
+ |
|
1581 |
+ |
# |
1582 |
+ |
# Build 'standalone' Device Tree Blob |
1583 |
+ |
# |
1584 |
+ |
builddtb: |
1585 |
+ |
@if [ "${FDT_DTS_FILE}" = "" ]; then \ |
1586 |
+ |
echo "ERROR: FDT_DTS_FILE must be specified!"; \ |
1587 |
+ |
exit 1; \ |
1588 |
+ |
fi; \ |
1589 |
+ |
if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} ]; then \ |
1590 |
+ |
echo "ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \ |
1591 |
+ |
exist!"; \ |
1592 |
+ |
exit 1; \ |
1593 |
+ |
fi; \ |
1594 |
+ |
if [ "${DTBOUTPUTPATH}" = "${.CURDIR}" ]; then \ |
1595 |
+ |
echo "WARNING: DTB will be placed in the current working \ |
1596 |
+ |
directory"; \ |
1597 |
+ |
fi |
1598 |
+ |
@PATH=${TMPPATH} \ |
1599 |
+ |
dtc -O dtb -o \ |
1600 |
+ |
${DTBOUTPUTPATH}/`echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 \ |
1601 |
+ |
-p 1024 ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} |
1602 |
+ |
|
1603 |
+ |
############### |
1604 |
+ |
|
1605 |
+ |
.if defined(XDEV) && defined(XDEV_ARCH) |
1606 |
+ |
|
1607 |
+ |
.if ${XDEV} == ${MACHINE} && ${XDEV_ARCH} == ${MACHINE_ARCH} |
1608 |
+ |
XDEV_CPUTYPE?=${CPUTYPE} |
1609 |
+ |
.else |
1610 |
+ |
XDEV_CPUTYPE?=${TARGET_CPUTYPE} |
1611 |
+ |
.endif |
1612 |
+ |
|
1613 |
+ |
NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \ |
1614 |
+ |
-DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE \ |
1615 |
+ |
-DWITHOUT_KERBEROS -DWITHOUT_RESCUE -DNO_WARNS \ |
1616 |
+ |
TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ |
1617 |
+ |
CPUTYPE=${XDEV_CPUTYPE} |
1618 |
+ |
|
1619 |
+ |
XDDIR=${XDEV_ARCH}-midnightbsd |
1620 |
+ |
XDTP=/usr/${XDDIR} |
1621 |
+ |
CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \ |
1622 |
+ |
INSTALL="sh ${.CURDIR}/tools/install.sh" |
1623 |
+ |
CDENV= ${CDBENV} \ |
1624 |
+ |
_SHLIBDIRPREFIX=${XDTP} \ |
1625 |
+ |
TOOLS_PREFIX=${XDTP} |
1626 |
+ |
CD2ENV=${CDENV} \ |
1627 |
+ |
MACHINE=${XDEV} MACHINE_ARCH=${XDEV_ARCH} |
1628 |
+ |
|
1629 |
+ |
CDTMP= ${MAKEOBJDIRPREFIX}/${XDEV}/${.CURDIR}/tmp |
1630 |
+ |
CDMAKE=${CDENV} ${MAKE} ${NOFUN} |
1631 |
+ |
CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDTP}/usr/bin:${PATH} ${MAKE} ${NOFUN} |
1632 |
+ |
XDDESTDIR=${DESTDIR}${XDTP} |
1633 |
+ |
.if !defined(OSREL) |
1634 |
+ |
OSREL!= uname -r | sed -e 's/[-(].*//' |
1635 |
+ |
.endif |
1636 |
+ |
|
1637 |
+ |
.ORDER: xdev-build xdev-install |
1638 |
+ |
xdev: xdev-build xdev-install |
1639 |
+ |
|
1640 |
+ |
.ORDER: _xb-build-tools _xb-cross-tools |
1641 |
+ |
xdev-build: _xb-build-tools _xb-cross-tools |
1642 |
+ |
|
1643 |
+ |
_xb-build-tools: |
1644 |
+ |
${_+_}@cd ${.CURDIR}; \ |
1645 |
+ |
${CDBENV} ${MAKE} -f Makefile.inc1 ${NOFUN} build-tools |
1646 |
+ |
|
1647 |
+ |
_xb-cross-tools: |
1648 |
+ |
.for _tool in \ |
1649 |
+ |
gnu/usr.bin/binutils \ |
1650 |
+ |
gnu/usr.bin/cc \ |
1651 |
+ |
usr.bin/ar |
1652 |
+ |
${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ |
1653 |
+ |
cd ${.CURDIR}/${_tool}; \ |
1654 |
+ |
${CDMAKE} DIRPRFX=${_tool}/ obj; \ |
1655 |
+ |
${CDMAKE} DIRPRFX=${_tool}/ depend; \ |
1656 |
+ |
${CDMAKE} DIRPRFX=${_tool}/ all |
1657 |
+ |
.endfor |
1658 |
+ |
|
1659 |
+ |
_xi-mtree: |
1660 |
+ |
${_+_}@${ECHODIR} "mtree populating ${XDDESTDIR}" |
1661 |
+ |
mkdir -p ${XDDESTDIR} |
1662 |
+ |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \ |
1663 |
+ |
-p ${XDDESTDIR} >/dev/null |
1664 |
+ |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ |
1665 |
+ |
-p ${XDDESTDIR}/usr >/dev/null |
1666 |
+ |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ |
1667 |
+ |
-p ${XDDESTDIR}/usr/include >/dev/null |
1668 |
+ |
|
1669 |
+ |
.ORDER: _xi-mtree _xi-cross-tools _xi-includes _xi-libraries _xi-links |
1670 |
+ |
xdev-install: _xi-mtree _xi-cross-tools _xi-includes _xi-libraries _xi-links |
1671 |
+ |
|
1672 |
+ |
_xi-cross-tools: |
1673 |
+ |
@echo "_xi-cross-tools" |
1674 |
+ |
.for _tool in \ |
1675 |
+ |
gnu/usr.bin/binutils \ |
1676 |
+ |
gnu/usr.bin/cc \ |
1677 |
+ |
usr.bin/ar |
1678 |
+ |
${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \ |
1679 |
+ |
cd ${.CURDIR}/${_tool}; \ |
1680 |
+ |
${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR} |
1681 |
+ |
.endfor |
1682 |
+ |
|
1683 |
+ |
_xi-includes: |
1684 |
+ |
${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 par-includes \ |
1685 |
+ |
DESTDIR=${XDDESTDIR} |
1686 |
+ |
|
1687 |
+ |
_xi-libraries: |
1688 |
+ |
${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 libraries \ |
1689 |
+ |
DESTDIR=${XDDESTDIR} |
1690 |
+ |
|
1691 |
+ |
_xi-links: |
1692 |
+ |
${_+_}cd ${XDDESTDIR}/usr/bin; \ |
1693 |
+ |
for i in *; do \ |
1694 |
+ |
ln -sf ../../${XDTP}/usr/bin/$$i \ |
1695 |
+ |
../../../../usr/bin/${XDDIR}-$$i; \ |
1696 |
+ |
ln -sf ../../${XDTP}/usr/bin/$$i \ |
1697 |
+ |
../../../../usr/bin/${XDDIR}${OSREL}-$$i; \ |
1698 |
+ |
done |
1699 |
+ |
.endif |