1 |
|
# |
2 |
– |
# $FreeBSD: src/Makefile.inc1,v 1.499.2.7 2006/01/07 19:40:08 netchild Exp $ |
2 |
|
# $MidnightBSD$ |
3 |
|
# |
4 |
|
# Make command line options: |
6 |
– |
# -DNO_DYNAMICROOT do not link /bin and /sbin dynamically |
7 |
– |
# -DNO_KERBEROS Do not build Heimdal (Kerberos 5) |
8 |
– |
# -DNO_RESCUE do not build rescue binaries |
5 |
|
# -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir |
6 |
|
# -DNO_CLEAN do not clean at all |
7 |
< |
# -DNO_CRYPT will prevent building of crypt versions |
8 |
< |
# -DNO_MAN do not build the manual pages |
13 |
< |
# -DNO_NLS do not build Native Language Support files |
14 |
< |
# -DNO_PROFILE do not build profiled libraries |
15 |
< |
# -DNO_GAMES do not go into games subdir |
7 |
> |
# -DDB_FROM_SRC use the user/group databases in src/etc instead of |
8 |
> |
# the system database when installing. |
9 |
|
# -DNO_SHARE do not go into share subdir |
10 |
< |
# -DNO_INFO do not make or install info files |
18 |
< |
# -DNO_LIBC_R do not build libc_r. |
19 |
< |
# -DNO_FORTRAN do not build g77 and related libraries. |
10 |
> |
# -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ} |
11 |
|
# -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel |
12 |
|
# -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel |
13 |
|
# -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel |
14 |
+ |
# -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel |
15 |
|
# -DNO_PORTSUPDATE do not update ports in ${MAKE} update |
16 |
+ |
# -DNO_ROOT install without using root privilege |
17 |
|
# -DNO_DOCUPDATE do not update doc in ${MAKE} update |
18 |
+ |
# -DNO_CTF do not run the DTrace CTF conversion tools on built objects |
19 |
|
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list |
20 |
< |
# TARGET_ARCH="arch" to crossbuild world to a different arch |
20 |
> |
# LOCAL_MTREE="list of mtree files" to process to allow local directories |
21 |
> |
# to be created before files are installed |
22 |
> |
# METALOG="path to metadata log" to write permission and ownership |
23 |
> |
# when NO_ROOT is set. (default: ${DESTDIR}/METALOG) |
24 |
> |
# TARGET="machine" to crossbuild world for a different machine type |
25 |
> |
# TARGET_ARCH= may be required when a TARGET supports multiple endians |
26 |
|
|
27 |
|
# |
28 |
|
# The intended user-driven targets are: |
29 |
|
# buildworld - rebuild *everything*, including glue to help do upgrades |
30 |
|
# installworld- install everything built by "buildworld" |
31 |
+ |
# doxygen - build API documentation of the kernel |
32 |
|
# update - convenient way to update your source tree (eg: cvsup/cvs) |
33 |
|
# |
34 |
|
# Standard targets (not defined here) are documented in the makefiles in |
35 |
|
# /usr/share/mk. These include: |
36 |
|
# obj depend all install clean cleandepend cleanobj |
37 |
|
|
38 |
+ |
# You are supposed to define both of these when calling Makefile.inc1 |
39 |
+ |
# directly. However, some old scripts don't. Cope for the moment, but |
40 |
+ |
# issue a new warning for a transition period. |
41 |
+ |
.if defined(TARGET) && !defined(TARGET_ARCH) |
42 |
+ |
.warning "You must pass both TARGET and TARGET_ARCH to Makefile.inc1. Setting TARGET_ARCH=${TARGET}." |
43 |
+ |
TARGET_ARCH=${TARGET} |
44 |
+ |
.endif |
45 |
+ |
.if !defined(TARGET) || !defined(TARGET_ARCH) |
46 |
+ |
.error "Both TARGET and TARGET_ARCH must be defined." |
47 |
+ |
.endif |
48 |
+ |
|
49 |
+ |
.include <bsd.own.mk> |
50 |
+ |
.include <bsd.arch.inc.mk> |
51 |
+ |
.include <bsd.compiler.mk> |
52 |
+ |
|
53 |
|
# We must do share/info early so that installation of info `dir' |
54 |
|
# entries works correctly. Do it first since it is less likely to |
55 |
|
# grow dependencies on include and lib than vice versa. |
56 |
|
# |
57 |
< |
# We must do lib and libexec before bin, because if installworld |
57 |
> |
# We must do lib/ and libexec/ before bin/, because if installworld |
58 |
|
# installs a new /bin/sh, the 'make' command will *immediately* |
59 |
|
# use that new version. And the new (dynamically-linked) /bin/sh |
60 |
|
# will expect to find appropriate libraries in /lib and /libexec. |
61 |
|
# |
62 |
< |
# We must do etc last for install/distribute to work. |
63 |
< |
# |
64 |
< |
SUBDIR= share/info include lib libexec bin |
65 |
< |
.if !defined(NO_GAMES) |
62 |
> |
SUBDIR= share/info lib libexec |
63 |
> |
SUBDIR+=bin |
64 |
> |
.if ${MK_APACHE} != "no" |
65 |
> |
SUBDIR+=apache |
66 |
> |
.endif |
67 |
> |
.if ${MK_GAMES} != "no" |
68 |
|
SUBDIR+=games |
69 |
|
.endif |
70 |
< |
SUBDIR+=gnu |
71 |
< |
.if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL) |
70 |
> |
.if ${MK_CDDL} != "no" |
71 |
> |
SUBDIR+=cddl |
72 |
> |
.endif |
73 |
> |
SUBDIR+=gnu include |
74 |
> |
.if ${MK_KERBEROS} != "no" |
75 |
|
SUBDIR+=kerberos5 |
76 |
|
.endif |
77 |
< |
.if !defined(NO_RESCUE) |
77 |
> |
.if ${MK_RESCUE} != "no" |
78 |
|
SUBDIR+=rescue |
79 |
|
.endif |
80 |
|
SUBDIR+=sbin |
81 |
< |
.if !defined(NO_CRYPT) |
81 |
> |
.if ${MK_CRYPT} != "no" |
82 |
|
SUBDIR+=secure |
83 |
|
.endif |
84 |
|
.if !defined(NO_SHARE) |
85 |
|
SUBDIR+=share |
86 |
|
.endif |
87 |
< |
SUBDIR+=sys usr.bin usr.sbin etc |
87 |
> |
SUBDIR+=sys usr.bin usr.sbin |
88 |
> |
.if ${MK_OFED} != "no" |
89 |
> |
SUBDIR+=contrib/ofed |
90 |
> |
.endif |
91 |
> |
# |
92 |
> |
# We must do etc/ last for install/distribute to work. |
93 |
> |
# |
94 |
> |
SUBDIR+=etc |
95 |
|
|
96 |
|
# These are last, since it is nice to at least get the base system |
97 |
|
# rebuilt before you do them. |
114 |
|
CLEANDIR= cleandir |
115 |
|
.endif |
116 |
|
|
117 |
< |
CVS?= cvs |
118 |
< |
CVSFLAGS?= -r RELENG_6 -P -d -I! |
92 |
< |
SUP?= /usr/local/bin/cvsup |
93 |
< |
SUPFLAGS?= -g -L 2 -P - |
94 |
< |
.if defined(SUPHOST) |
95 |
< |
SUPFLAGS+= -h ${SUPHOST} |
96 |
< |
.endif |
117 |
> |
SVN?= /usr/local/bin/svn |
118 |
> |
SVNFLAGS?= -r HEAD |
119 |
|
|
120 |
|
MAKEOBJDIRPREFIX?= /usr/obj |
121 |
|
.if !defined(OSRELDATE) |
122 |
|
.if exists(/usr/include/osreldate.h) |
123 |
< |
OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ |
123 |
> |
OSRELDATE!= awk '/^\#define[[:space:]]*__MidnightBSD_version/ { print $$3 }' \ |
124 |
|
/usr/include/osreldate.h |
125 |
|
.else |
126 |
|
OSRELDATE= 0 |
127 |
|
.endif |
128 |
|
.endif |
129 |
< |
TARGET_ARCH?= ${MACHINE_ARCH} |
130 |
< |
.if ${TARGET_ARCH} == ${MACHINE_ARCH} |
131 |
< |
TARGET?= ${MACHINE} |
129 |
> |
|
130 |
> |
.if !defined(VERSION) |
131 |
> |
VERSION!= uname -srp |
132 |
> |
VERSION+= ${OSRELDATE} |
133 |
> |
.endif |
134 |
> |
|
135 |
> |
|
136 |
> |
KNOWN_ARCHES?= amd64 i386 |
137 |
> |
.if ${TARGET} == ${TARGET_ARCH} |
138 |
> |
_t= ${TARGET} |
139 |
> |
.else |
140 |
> |
_t= ${TARGET_ARCH}/${TARGET} |
141 |
> |
.endif |
142 |
> |
.for _t in ${_t} |
143 |
> |
.if empty(KNOWN_ARCHES:M${_t}) |
144 |
> |
.error Unknown target ${TARGET_ARCH}:${TARGET}. |
145 |
> |
.endif |
146 |
> |
.endfor |
147 |
> |
|
148 |
> |
.if ${TARGET} == ${MACHINE} |
149 |
|
TARGET_CPUTYPE?=${CPUTYPE} |
150 |
|
.else |
112 |
– |
TARGET?= ${TARGET_ARCH} |
151 |
|
TARGET_CPUTYPE?= |
152 |
|
.endif |
153 |
+ |
|
154 |
|
.if !empty(TARGET_CPUTYPE) |
155 |
|
_TARGET_CPUTYPE=${TARGET_CPUTYPE} |
156 |
|
.else |
162 |
|
.error CPUTYPE global should be set with ?=. |
163 |
|
.endif |
164 |
|
.if make(buildworld) |
165 |
< |
BUILD_ARCH!= sysctl -n hw.machine_arch |
165 |
> |
BUILD_ARCH!= uname -p |
166 |
|
.if ${MACHINE_ARCH} != ${BUILD_ARCH} |
167 |
|
.error To cross-build, set TARGET_ARCH. |
168 |
|
.endif |
169 |
|
.endif |
170 |
< |
.if ${MACHINE} == ${TARGET} && !defined(CROSS_BUILD_TESTING) |
170 |
> |
.if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING) |
171 |
|
OBJTREE= ${MAKEOBJDIRPREFIX} |
172 |
|
.else |
173 |
< |
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET} |
173 |
> |
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH} |
174 |
|
.endif |
175 |
|
WORLDTMP= ${OBJTREE}${.CURDIR}/tmp |
176 |
|
# /usr/games added for fortune which depend on strfile |
177 |
< |
BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games |
177 |
> |
BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games:${WORLDTMP}/legacy/bin |
178 |
|
XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games |
179 |
|
STRICTTMPPATH= ${BPATH}:${XPATH} |
180 |
|
TMPPATH= ${STRICTTMPPATH}:${PATH} |
181 |
|
|
182 |
+ |
# |
183 |
+ |
# Avoid running mktemp(1) unless actually needed. |
184 |
+ |
# It may not be functional, e.g., due to new ABI |
185 |
+ |
# when in the middle of installing over this system. |
186 |
+ |
# |
187 |
+ |
.if make(distributeworld) || make(installworld) |
188 |
|
INSTALLTMP!= /usr/bin/mktemp -d -u -t install |
189 |
+ |
.endif |
190 |
|
|
191 |
|
# |
192 |
|
# Building a world goes through the following stages |
217 |
|
|
218 |
|
# Common environment for world related stages |
219 |
|
CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \ |
220 |
+ |
MACHINE_INCLUDES="${WORLDTMP}/include" \ |
221 |
|
MACHINE_ARCH=${TARGET_ARCH} \ |
222 |
|
MACHINE=${TARGET} \ |
223 |
< |
CPUTYPE=${TARGET_CPUTYPE} \ |
224 |
< |
GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \ |
223 |
> |
CPUTYPE=${TARGET_CPUTYPE} |
224 |
> |
.if ${OSRELDATE} < 4015 |
225 |
> |
CROSSENV+= AR=gnu-ar RANLIB=gnu-ranlib |
226 |
> |
.endif |
227 |
> |
.if ${MK_GROFF} != "no" |
228 |
> |
CROSSENV+= GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \ |
229 |
|
GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \ |
230 |
|
GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac |
231 |
+ |
.endif |
232 |
|
|
233 |
|
# bootstrap-tools stage |
234 |
|
BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ |
235 |
+ |
MACHINE_INCLUDES="${WORLDTMP}/include" \ |
236 |
|
PATH=${BPATH}:${PATH} \ |
237 |
|
WORLDTMP=${WORLDTMP} \ |
238 |
< |
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" |
238 |
> |
VERSION="${VERSION}" \ |
239 |
> |
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ |
240 |
> |
COMPILER_TYPE=${COMPILER_TYPE} |
241 |
|
BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ |
242 |
|
${BMAKEENV} ${MAKE} -f Makefile.inc1 \ |
243 |
|
DESTDIR= \ |
244 |
|
BOOTSTRAPPING=${OSRELDATE} \ |
245 |
< |
-DNO_HTML -DNO_INFO -DNO_LINT -DNO_MAN -DNO_NLS -DNO_PIC \ |
246 |
< |
-DNO_PROFILE -DNO_SHARED -DNO_CPU_CFLAGS -DNO_WARNS |
245 |
> |
SSP_CFLAGS= \ |
246 |
> |
-DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \ |
247 |
> |
-DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \ |
248 |
> |
-DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD |
249 |
|
|
250 |
|
# build-tools stage |
251 |
|
TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ |
252 |
|
${BMAKEENV} ${MAKE} -f Makefile.inc1 \ |
253 |
+ |
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ |
254 |
|
DESTDIR= \ |
255 |
< |
BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS |
255 |
> |
BOOTSTRAPPING=${OSRELDATE} \ |
256 |
> |
SSP_CFLAGS= \ |
257 |
> |
-DNO_LINT \ |
258 |
> |
-DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD |
259 |
|
|
260 |
|
# cross-tools stage |
261 |
< |
XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB |
261 |
> |
XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ |
262 |
> |
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ |
263 |
> |
-DWITHOUT_GDB |
264 |
|
|
265 |
|
# world stage |
266 |
|
WMAKEENV= ${CROSSENV} \ |
267 |
|
_SHLIBDIRPREFIX=${WORLDTMP} \ |
268 |
+ |
_LDSCRIPTROOT= \ |
269 |
+ |
MACHINE_INCLUDES="${WORLDTMP}/include" \ |
270 |
+ |
VERSION="${VERSION}" \ |
271 |
|
INSTALL="sh ${.CURDIR}/tools/install.sh" \ |
272 |
|
PATH=${TMPPATH} |
273 |
+ |
.if ${MK_CDDL} == "no" |
274 |
+ |
WMAKEENV+= NO_CTF=1 |
275 |
+ |
.endif |
276 |
+ |
.if ${CC:T:Mgcc} == "gcc" |
277 |
+ |
WMAKE_COMPILER_TYPE= gcc |
278 |
+ |
.elif ${CC:T:Mclang} == "clang" |
279 |
+ |
WMAKE_COMPILER_TYPE= clang |
280 |
+ |
.elif ${MK_CLANG_IS_CC} == "no" |
281 |
+ |
WMAKE_COMPILER_TYPE= gcc |
282 |
+ |
.else |
283 |
+ |
WMAKE_COMPILER_TYPE= clang |
284 |
+ |
.endif |
285 |
+ |
WMAKEENV+= COMPILER_TYPE=${WMAKE_COMPILER_TYPE} |
286 |
|
WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP} |
287 |
|
|
288 |
|
.if ${TARGET_ARCH} == "amd64" |
289 |
|
# 32 bit world |
290 |
|
LIB32TMP= ${OBJTREE}${.CURDIR}/lib32 |
291 |
|
|
292 |
< |
LIB32PREFLAGS= -m32 -march=athlon-xp -msse2 -mfancy-math-387 -DCOMPAT_32BIT |
293 |
< |
LIB32POSTFLAGS= -I${LIB32TMP}/usr/include \ |
292 |
> |
.if ${TARGET_ARCH} == "amd64" |
293 |
> |
.if empty(TARGET_CPUTYPE) |
294 |
> |
LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2 |
295 |
> |
.else |
296 |
> |
LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} |
297 |
> |
.endif |
298 |
> |
LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \ |
299 |
> |
MACHINE_CPU="i686 mmx sse sse2" |
300 |
> |
LIB32WMAKEFLAGS= \ |
301 |
> |
AS="${AS} --32" \ |
302 |
> |
LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" |
303 |
> |
.endif |
304 |
> |
|
305 |
> |
|
306 |
> |
LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -DCOMPAT_32BIT \ |
307 |
> |
-isystem ${LIB32TMP}/usr/include/ \ |
308 |
|
-L${LIB32TMP}/usr/lib32 \ |
309 |
|
-B${LIB32TMP}/usr/lib32 |
217 |
– |
LIB32CC= ${LIB32PREFLAGS} \ |
218 |
– |
${LIB32POSTFLAGS} |
219 |
– |
LIB32CXX= ${LIB32PREFLAGS} -I${LIB32TMP}/usr/include/c++/3.4 \ |
220 |
– |
${LIB32POSTFLAGS} |
221 |
– |
LIB32OBJC= ${LIB32PREFLAGS} -I${LIB32TMP}/usr/include/objc \ |
222 |
– |
${LIB32POSTFLAGS} |
310 |
|
|
311 |
|
# Yes, the flags are redundant. |
312 |
< |
LIB32MAKEENV= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \ |
312 |
> |
LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \ |
313 |
|
_SHLIBDIRPREFIX=${LIB32TMP} \ |
314 |
< |
MACHINE=i386 \ |
315 |
< |
MACHINE_ARCH=i386 \ |
314 |
> |
_LDSCRIPTROOT=${LIB32TMP} \ |
315 |
> |
VERSION="${VERSION}" \ |
316 |
|
INSTALL="sh ${.CURDIR}/tools/install.sh" \ |
317 |
|
PATH=${TMPPATH} \ |
231 |
– |
CC="${CC} ${LIB32CC}" \ |
232 |
– |
CXX="${CXX} ${LIB32CXX}" \ |
233 |
– |
OBJC="${OBJC} ${LIB32OBJC}" \ |
234 |
– |
LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \ |
235 |
– |
AS="${AS} --32" \ |
318 |
|
LIBDIR=/usr/lib32 \ |
319 |
< |
SHLIBDIR=/usr/lib32 |
319 |
> |
SHLIBDIR=/usr/lib32 \ |
320 |
> |
LIBPRIVATEDIR=/usr/lib32/private \ |
321 |
> |
MACHINE_INCLUDES="${WORLDTMP}/include" \ |
322 |
> |
COMPILER_TYPE=${WMAKE_COMPILER_TYPE} |
323 |
> |
LIB32WMAKEFLAGS+= \ |
324 |
> |
CC="${CC} ${LIB32FLAGS}" \ |
325 |
> |
CXX="${CXX} ${LIB32FLAGS}" \ |
326 |
> |
DESTDIR=${LIB32TMP} \ |
327 |
> |
-DCOMPAT_32BIT \ |
328 |
> |
-DLIBRARIES_ONLY \ |
329 |
> |
-DNO_CPU_CFLAGS \ |
330 |
> |
-DNO_CTF \ |
331 |
> |
-DNO_LINT |
332 |
|
|
333 |
< |
LIB32MAKE= ${LIB32MAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \ |
334 |
< |
-DNO_BIND -DNO_MAN -DNO_NLS -DNO_INFO -DNO_HTML |
335 |
< |
LIB32IMAKE= ${LIB32MAKE:NINSTALL=*} -DNO_INCS |
333 |
> |
LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \ |
334 |
> |
-DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO \ |
335 |
> |
-DWITHOUT_HTML -DNO_CTF -DNO_LINT \ |
336 |
> |
DESTDIR=${LIB32TMP} |
337 |
> |
LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS \ |
338 |
> |
${IMAKE_INSTALL} |
339 |
|
.endif |
340 |
|
|
341 |
< |
# install stage |
341 |
> |
IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*} |
342 |
> |
IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ |
343 |
> |
${IMAKE_INSTALL} ${IMAKE_MTREE} |
344 |
|
.if empty(.MAKEFLAGS:M-n) |
345 |
< |
IMAKEENV= ${CROSSENV} \ |
346 |
< |
PATH=${STRICTTMPPATH}:${INSTALLTMP} |
345 |
> |
IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \ |
346 |
> |
LD_LIBRARY_PATH=${INSTALLTMP} \ |
347 |
> |
PATH_LOCALE=${INSTALLTMP}/locale |
348 |
> |
IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh |
349 |
|
.else |
350 |
< |
IMAKEENV= ${CROSSENV} \ |
250 |
< |
PATH=${TMPPATH}:${INSTALLTMP} |
350 |
> |
IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP} |
351 |
|
.endif |
352 |
< |
IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 |
352 |
> |
.if defined(DB_FROM_SRC) |
353 |
> |
INSTALLFLAGS+= -N ${.CURDIR}/etc |
354 |
> |
MTREEFLAGS+= -N ${.CURDIR}/etc |
355 |
> |
.endif |
356 |
> |
.if defined(NO_ROOT) |
357 |
> |
METALOG?= ${DESTDIR}/${DISTDIR}/METALOG |
358 |
> |
IMAKE+= -DNO_ROOT METALOG=${METALOG} |
359 |
> |
INSTALL_DDIR= ${DESTDIR}/${DISTDIR} |
360 |
> |
INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR:S://:/:g:C:/$::} |
361 |
> |
MTREEFLAGS+= -W |
362 |
> |
.endif |
363 |
> |
.if defined(DB_FROM_SRC) || defined(NO_ROOT) |
364 |
> |
IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}" |
365 |
> |
IMAKE_MTREE= MTREE_CMD="nmtree ${MTREEFLAGS}" |
366 |
> |
.endif |
367 |
|
|
368 |
|
# kernel stage |
369 |
|
KMAKEENV= ${WMAKEENV} |
370 |
+ |
KMAKE= ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} |
371 |
|
|
372 |
|
# |
373 |
|
# buildworld |
390 |
|
@echo "--------------------------------------------------------------" |
391 |
|
.if !defined(NO_CLEAN) |
392 |
|
rm -rf ${WORLDTMP} |
393 |
< |
.if ${TARGET_ARCH} == "amd64" |
393 |
> |
.if defined(LIB32TMP) |
394 |
|
rm -rf ${LIB32TMP} |
395 |
|
.endif |
396 |
|
.else |
397 |
|
rm -rf ${WORLDTMP}/legacy/usr/include |
398 |
< |
# XXX - These two can depend on any header file. |
398 |
> |
# XXX - These three can depend on any header file. |
399 |
|
rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c |
400 |
+ |
rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c |
401 |
|
rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c |
402 |
|
.endif |
403 |
|
.for _dir in \ |
404 |
< |
usr/bin usr/games usr/include/c++/3.4 usr/include/sys usr/lib \ |
289 |
< |
usr/libexec usr/sbin usr/share/dict \ |
290 |
< |
usr/share/groff_font/devX100 \ |
291 |
< |
usr/share/groff_font/devX100-12 \ |
292 |
< |
usr/share/groff_font/devX75 \ |
293 |
< |
usr/share/groff_font/devX75-12 \ |
294 |
< |
usr/share/groff_font/devascii \ |
295 |
< |
usr/share/groff_font/devcp1047 \ |
296 |
< |
usr/share/groff_font/devdvi \ |
297 |
< |
usr/share/groff_font/devhtml \ |
298 |
< |
usr/share/groff_font/devkoi8-r \ |
299 |
< |
usr/share/groff_font/devlatin1 \ |
300 |
< |
usr/share/groff_font/devlbp \ |
301 |
< |
usr/share/groff_font/devlj4 \ |
302 |
< |
usr/share/groff_font/devps \ |
303 |
< |
usr/share/groff_font/devutf8 \ |
304 |
< |
usr/share/tmac/mdoc usr/share/tmac/mm |
305 |
< |
mkdir -p ${WORLDTMP}/legacy/${_dir} |
306 |
< |
.endfor |
307 |
< |
.for _dir in \ |
308 |
< |
lib usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \ |
309 |
< |
usr/libexec usr/sbin usr/share/misc \ |
310 |
< |
usr/share/snmp/defs usr/share/snmp/mibs |
404 |
> |
lib usr legacy/bin legacy/usr legacy/usr/bin legacy/usr/sbin |
405 |
|
mkdir -p ${WORLDTMP}/${_dir} |
406 |
|
.endfor |
407 |
+ |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ |
408 |
+ |
-p ${WORLDTMP}/legacy/usr >/dev/null |
409 |
+ |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ |
410 |
+ |
-p ${WORLDTMP}/usr >/dev/null |
411 |
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ |
412 |
|
-p ${WORLDTMP}/usr/include >/dev/null |
413 |
|
ln -sf ${.CURDIR}/sys ${WORLDTMP} |
414 |
< |
.if defined(WITH_BIND_LIBS) && !defined(NO_BIND) |
414 |
> |
.if ${MK_BIND_LIBS} != "no" |
415 |
|
mtree -deU -f ${.CURDIR}/etc/mtree/BIND.include.dist \ |
416 |
|
-p ${WORLDTMP}/usr/include >/dev/null |
417 |
|
.endif |
418 |
+ |
.for _mtree in ${LOCAL_MTREE} |
419 |
+ |
mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null |
420 |
+ |
.endfor |
421 |
|
_legacy: |
422 |
|
@echo |
423 |
|
@echo "--------------------------------------------------------------" |
437 |
|
@echo ">>> stage 2.1: cleaning up the object tree" |
438 |
|
@echo "--------------------------------------------------------------" |
439 |
|
${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/} |
440 |
< |
.if ${TARGET_ARCH} == "amd64" |
441 |
< |
rm -rf ${OBJTREE}/lib32 |
440 |
> |
.if defined(LIB32TMP) |
441 |
> |
${_+_}cd ${.CURDIR}; ${LIB32WMAKE} -f Makefile.inc1 ${CLEANDIR:S/^/par-/} |
442 |
|
.endif |
443 |
|
.endif |
444 |
|
_obj: |
471 |
|
@echo ">>> stage 4.2: building libraries" |
472 |
|
@echo "--------------------------------------------------------------" |
473 |
|
${_+_}cd ${.CURDIR}; \ |
474 |
< |
${WMAKE} -DNO_FSCHG -DNO_HTML -DNO_INFO -DNO_LINT -DNO_MAN \ |
475 |
< |
-DNO_NLS -DNO_PROFILE libraries |
474 |
> |
${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \ |
475 |
> |
-DWITHOUT_MAN -DWITHOUT_PROFILE libraries |
476 |
|
_depend: |
477 |
|
@echo |
478 |
|
@echo "--------------------------------------------------------------" |
485 |
|
@echo ">>> stage 4.4: building everything" |
486 |
|
@echo "--------------------------------------------------------------" |
487 |
|
${_+_}cd ${.CURDIR}; ${WMAKE} par-all |
488 |
< |
.if ${TARGET_ARCH} == "amd64" |
488 |
> |
.if defined(LIB32TMP) |
489 |
|
build32: |
490 |
|
@echo |
491 |
|
@echo "--------------------------------------------------------------" |
492 |
|
@echo ">>> stage 5.1: building 32 bit shim libraries" |
493 |
|
@echo "--------------------------------------------------------------" |
494 |
< |
.for _dir in \ |
495 |
< |
lib lib32 usr/bin usr/include usr/lib32 usr/libdata/ldscripts \ |
496 |
< |
usr/libexec usr/sbin usr/share/misc \ |
396 |
< |
usr/share/snmp/defs usr/share/snmp/mibs |
397 |
< |
mkdir -p ${LIB32TMP}/${_dir} |
398 |
< |
.endfor |
494 |
> |
mkdir -p ${LIB32TMP}/usr/include |
495 |
> |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ |
496 |
> |
-p ${LIB32TMP}/usr >/dev/null |
497 |
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ |
498 |
|
-p ${LIB32TMP}/usr/include >/dev/null |
499 |
|
mkdir -p ${WORLDTMP} |
500 |
|
ln -sf ${.CURDIR}/sys ${WORLDTMP} |
403 |
– |
.if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL) |
404 |
– |
.for _t in obj depend all |
405 |
– |
cd ${.CURDIR}/kerberos5/tools; \ |
406 |
– |
MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} DESTDIR= ${_t} |
407 |
– |
.endfor |
408 |
– |
.endif |
501 |
|
.for _t in obj includes |
502 |
< |
cd ${.CURDIR}/include; \ |
503 |
< |
${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t} |
504 |
< |
cd ${.CURDIR}/lib; \ |
505 |
< |
${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t} |
414 |
< |
cd ${.CURDIR}/gnu/lib; \ |
415 |
< |
${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t} |
416 |
< |
.if !defined(NO_CRYPT) |
417 |
< |
cd ${.CURDIR}/secure/lib; \ |
418 |
< |
${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t} |
502 |
> |
cd ${.CURDIR}/include; ${LIB32WMAKE} DIRPRFX=include/ ${_t} |
503 |
> |
cd ${.CURDIR}/lib; ${LIB32WMAKE} DIRPRFX=lib/ ${_t} |
504 |
> |
.if ${MK_APACHE} != "no" |
505 |
> |
cd ${.CURDIR}/apache/lib; ${LIB32WMAKE} ${_t} |
506 |
|
.endif |
507 |
< |
.if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL) |
508 |
< |
cd ${.CURDIR}/kerberos5/lib; \ |
422 |
< |
${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t} |
507 |
> |
.if ${MK_CDDL} != "no" |
508 |
> |
cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} DIRPRFX=cddl/lib/ ${_t} |
509 |
|
.endif |
510 |
+ |
cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} DIRPRFX=gnu/lib/ ${_t} |
511 |
+ |
.if ${MK_CRYPT} != "no" |
512 |
+ |
cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} DIRPRFX=secure/lib/ ${_t} |
513 |
+ |
.endif |
514 |
+ |
.if ${MK_KERBEROS} != "no" |
515 |
+ |
cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} DIRPRFX=kerberos5/lib ${_t} |
516 |
+ |
.endif |
517 |
|
.endfor |
518 |
< |
.for _dir in usr.sbin/pcvt/keycap usr.bin/lex/lib |
519 |
< |
cd ${.CURDIR}/${_dir}; \ |
427 |
< |
${LIB32MAKE} DESTDIR=${LIB32TMP} obj |
518 |
> |
.for _dir in usr.bin/lex/lib |
519 |
> |
cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} DIRPRFX=${_dir}/ obj |
520 |
|
.endfor |
521 |
< |
.for _dir in lib/libncurses lib/libmagic |
521 |
> |
.for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic |
522 |
|
cd ${.CURDIR}/${_dir}; \ |
523 |
< |
MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} DESTDIR= build-tools |
523 |
> |
WORLDTMP=${WORLDTMP} \ |
524 |
> |
MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ |
525 |
> |
DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \ |
526 |
> |
-DEARLY_BUILD build-tools |
527 |
|
.endfor |
528 |
|
cd ${.CURDIR}; \ |
529 |
< |
${LIB32MAKE} -f Makefile.inc1 DESTDIR=${LIB32TMP} libraries |
529 |
> |
${LIB32WMAKE} -f Makefile.inc1 libraries |
530 |
|
.for _t in obj depend all |
531 |
< |
cd ${.CURDIR}/libexec/rtld-elf; \ |
532 |
< |
PROG=ld-elf32.so.1 ${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t} |
531 |
> |
cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \ |
532 |
> |
DIRPRFX=libexec/rtld-elf/ ${_t} |
533 |
> |
cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \ |
534 |
> |
DIRPRFX=usr.bin/ldd ${_t} |
535 |
|
.endfor |
536 |
|
|
537 |
|
distribute32 install32: |
441 |
– |
.if make(distribute32) |
442 |
– |
mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32 # XXX add to mtree |
443 |
– |
.else |
444 |
– |
mkdir -p ${DESTDIR}/usr/lib32 # XXX add to mtree |
445 |
– |
.endif |
538 |
|
cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} |
539 |
+ |
.if ${MK_CDDL} != "no" |
540 |
+ |
cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} |
541 |
+ |
.endif |
542 |
|
cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} |
543 |
< |
.if !defined(NO_CRYPT) |
543 |
> |
.if ${MK_CRYPT} != "no" |
544 |
|
cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} |
545 |
|
.endif |
546 |
< |
cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//} |
546 |
> |
.if ${MK_KERBEROS} != "no" |
547 |
> |
cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} |
548 |
|
.endif |
549 |
+ |
cd ${.CURDIR}/libexec/rtld-elf; \ |
550 |
+ |
PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//} |
551 |
+ |
cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//} |
552 |
+ |
.endif |
553 |
|
|
454 |
– |
|
554 |
|
WMAKE_TGTS= |
555 |
|
.if !defined(SUBDIR_OVERRIDE) |
556 |
|
WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools |
560 |
|
WMAKE_TGTS+= _cross-tools |
561 |
|
.endif |
562 |
|
WMAKE_TGTS+= _includes _libraries _depend everything |
563 |
< |
.if ${TARGET_ARCH} == "amd64" && !defined(NO_LIB32) |
563 |
> |
.if defined(LIB32TMP) && ${MK_LIB32} != "no" |
564 |
|
WMAKE_TGTS+= build32 |
565 |
|
.endif |
566 |
|
|
567 |
< |
buildworld: ${WMAKE_TGTS} |
568 |
< |
.ORDER: ${WMAKE_TGTS} |
567 |
> |
buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue |
568 |
> |
.ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue |
569 |
|
|
570 |
+ |
buildworld_prologue: |
571 |
+ |
@echo "--------------------------------------------------------------" |
572 |
+ |
@echo ">>> World build started on `LC_ALL=C date`" |
573 |
+ |
@echo "--------------------------------------------------------------" |
574 |
+ |
|
575 |
+ |
buildworld_epilogue: |
576 |
+ |
@echo |
577 |
+ |
@echo "--------------------------------------------------------------" |
578 |
+ |
@echo ">>> World build completed on `LC_ALL=C date`" |
579 |
+ |
@echo "--------------------------------------------------------------" |
580 |
+ |
|
581 |
+ |
# |
582 |
+ |
# We need to have this as a target because the indirection between Makefile |
583 |
+ |
# and Makefile.inc1 causes the correct PATH to be used, rather than a |
584 |
+ |
# modification of the current environment's PATH. In addition, we need |
585 |
+ |
# to quote multiword values. |
586 |
+ |
# |
587 |
+ |
buildenvvars: |
588 |
+ |
@echo ${WMAKEENV:Q} |
589 |
+ |
|
590 |
|
buildenv: |
591 |
|
@echo Entering world for ${TARGET_ARCH}:${TARGET} |
592 |
|
@cd ${.CURDIR} && env ${WMAKEENV} sh || true |
596 |
|
kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries} |
597 |
|
|
598 |
|
# |
599 |
< |
# Use this to add checks to installworld/installkernel targets. |
599 |
> |
# installcheck |
600 |
|
# |
601 |
< |
SPECIAL_INSTALLCHECKS= |
601 |
> |
# Checks to be sure system is ready for installworld/installkernel. |
602 |
> |
# |
603 |
> |
installcheck: |
604 |
> |
installcheck_UGID: |
605 |
|
|
606 |
|
# |
607 |
< |
# Require DESTDIR to be set if installing for a different architecture. |
607 |
> |
# Require DESTDIR to be set if installing for a different architecture or |
608 |
> |
# using the user/group database in the source tree. |
609 |
|
# |
610 |
< |
.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE} |
610 |
> |
.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE} || \ |
611 |
> |
defined(DB_FROM_SRC) |
612 |
|
.if !make(distributeworld) |
613 |
< |
SPECIAL_INSTALLCHECKS+= installcheck_DESTDIR |
613 |
> |
installcheck: installcheck_DESTDIR |
614 |
|
installcheck_DESTDIR: |
615 |
|
.if !defined(DESTDIR) || empty(DESTDIR) |
616 |
|
@echo "ERROR: Please set DESTDIR!"; \ |
619 |
|
.endif |
620 |
|
.endif |
621 |
|
|
622 |
+ |
.if !defined(DB_FROM_SRC) |
623 |
|
# |
624 |
< |
# installcheck |
624 |
> |
# Check for missing UIDs/GIDs. |
625 |
|
# |
626 |
< |
# Checks to be sure system is ready for installworld |
627 |
< |
# |
628 |
< |
CHECK_UIDS= |
504 |
< |
CHECK_GIDS= |
505 |
< |
.if !defined(NO_SENDMAIL) |
626 |
> |
CHECK_UIDS= auditdistd |
627 |
> |
CHECK_GIDS= audit |
628 |
> |
.if ${MK_SENDMAIL} != "no" |
629 |
|
CHECK_UIDS+= smmsp |
630 |
|
CHECK_GIDS+= smmsp |
631 |
|
.endif |
632 |
< |
.if !defined(NO_PF) |
632 |
> |
.if ${MK_PF} != "no" |
633 |
|
CHECK_UIDS+= proxy |
634 |
|
CHECK_GIDS+= proxy authpf |
635 |
|
.endif |
636 |
< |
installcheck: ${SPECIAL_INSTALLCHECKS} |
636 |
> |
installcheck_UGID: |
637 |
|
.for uid in ${CHECK_UIDS} |
638 |
|
@if ! `id -u ${uid} >/dev/null 2>&1`; then \ |
639 |
|
echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \ |
646 |
|
false; \ |
647 |
|
fi |
648 |
|
.endfor |
649 |
+ |
.endif |
650 |
|
|
651 |
|
# |
652 |
+ |
# Required install tools to be saved in a scratch dir for safety. |
653 |
+ |
# |
654 |
+ |
.if ${MK_INFO} != "no" |
655 |
+ |
_install-info= install-info |
656 |
+ |
.endif |
657 |
+ |
.if ${MK_ZONEINFO} != "no" |
658 |
+ |
_zoneinfo= zic tzsetup |
659 |
+ |
.endif |
660 |
+ |
|
661 |
+ |
.if exists(/usr/sbin/nmtree) |
662 |
+ |
_nmtree_itools= nmtree |
663 |
+ |
.endif |
664 |
+ |
|
665 |
+ |
ITOOLS= [ awk cap_mkdb cat chflags chmod chown \ |
666 |
+ |
date echo egrep find grep id install ${_install-info} \ |
667 |
+ |
ln lockf make mkdir mtree ${_nmtree_itools} mv pwd_mkdb \ |
668 |
+ |
rm sed sh sysctl test true uname wc ${_zoneinfo} |
669 |
+ |
|
670 |
+ |
# |
671 |
|
# distributeworld |
672 |
|
# |
673 |
|
# Distributes everything compiled by a `buildworld'. |
676 |
|
# |
677 |
|
# Installs everything compiled by a 'buildworld'. |
678 |
|
# |
679 |
< |
distributeworld installworld: installcheck |
679 |
> |
|
680 |
> |
# Non-base distributions produced by the base system |
681 |
> |
EXTRA_DISTRIBUTIONS= doc |
682 |
> |
.if ${MK_GAMES} != "no" |
683 |
> |
EXTRA_DISTRIBUTIONS+= games |
684 |
> |
.endif |
685 |
> |
.if defined(LIB32TMP) && ${MK_LIB32} != "no" |
686 |
> |
EXTRA_DISTRIBUTIONS+= lib32 |
687 |
> |
.endif |
688 |
> |
|
689 |
> |
MTREE_MAGIC?= mtree 2.0 |
690 |
> |
|
691 |
> |
distributeworld installworld: installcheck installcheck_UGID |
692 |
|
mkdir -p ${INSTALLTMP} |
693 |
< |
for prog in [ awk cap_mkdb cat chflags chmod chown \ |
694 |
< |
date echo egrep find grep install-info \ |
695 |
< |
ln make mkdir mtree mv pwd_mkdb rm sed sh sysctl \ |
696 |
< |
test true uname wc zic; do \ |
697 |
< |
cp `which $$prog` ${INSTALLTMP}; \ |
698 |
< |
done |
699 |
< |
${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//} |
700 |
< |
rm -rf ${INSTALLTMP} |
693 |
> |
progs=$$(for prog in ${ITOOLS}; do \ |
694 |
> |
if progpath=`which $$prog`; then \ |
695 |
> |
echo $$progpath; \ |
696 |
> |
else \ |
697 |
> |
echo "Required tool $$prog not found in PATH." >&2; \ |
698 |
> |
exit 1; \ |
699 |
> |
fi; \ |
700 |
> |
done); \ |
701 |
> |
libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \ |
702 |
> |
while read line; do \ |
703 |
> |
set -- $$line; \ |
704 |
> |
if [ "$$2 $$3" != "not found" ]; then \ |
705 |
> |
echo $$2; \ |
706 |
> |
else \ |
707 |
> |
echo "Required library $$1 not found." >&2; \ |
708 |
> |
exit 1; \ |
709 |
> |
fi; \ |
710 |
> |
done); \ |
711 |
> |
cp $$libs $$progs ${INSTALLTMP} |
712 |
> |
cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale |
713 |
> |
.if defined(NO_ROOT) |
714 |
> |
echo "#${MTREE_MAGIC}" > ${METALOG} |
715 |
> |
.endif |
716 |
> |
.if make(distributeworld) |
717 |
> |
.for dist in ${EXTRA_DISTRIBUTIONS} |
718 |
> |
-mkdir ${DESTDIR}/${DISTDIR}/${dist} |
719 |
> |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \ |
720 |
> |
-p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null |
721 |
> |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ |
722 |
> |
-p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null |
723 |
> |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ |
724 |
> |
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null |
725 |
> |
.if defined(NO_ROOT) |
726 |
> |
${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ |
727 |
> |
sed -e 's#^\./#./${dist}/#' >> ${METALOG} |
728 |
> |
${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \ |
729 |
> |
sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG} |
730 |
> |
${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \ |
731 |
> |
sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG} |
732 |
> |
.endif |
733 |
> |
.endfor |
734 |
> |
-mkdir ${DESTDIR}/${DISTDIR}/base |
735 |
> |
cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ |
736 |
> |
METALOG=${METALOG} ${IMAKE_INSTALL} ${IMAKE_MTREE} \ |
737 |
> |
DISTBASE=/base DESTDIR=${DESTDIR}/${DISTDIR}/base \ |
738 |
> |
LOCAL_MTREE=${LOCAL_MTREE} distrib-dirs |
739 |
> |
.endif |
740 |
> |
${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \ |
741 |
> |
${IMAKEENV} rm -rf ${INSTALLTMP} |
742 |
> |
.if make(distributeworld) |
743 |
> |
.for dist in ${EXTRA_DISTRIBUTIONS} |
744 |
> |
find ${DESTDIR}/${DISTDIR}/${dist} -empty -delete |
745 |
> |
.endfor |
746 |
> |
.if defined(NO_ROOT) |
747 |
> |
.for dist in base ${EXTRA_DISTRIBUTIONS} |
748 |
> |
@# For each file that exists in this dist, print the corresponding |
749 |
> |
@# line from the METALOG. This relies on the fact that |
750 |
> |
@# a line containing only the filename will sort immediatly before |
751 |
> |
@# the relevant mtree line. |
752 |
> |
cd ${DESTDIR}/${DISTDIR}; \ |
753 |
> |
find ./${dist} | sort -u ${METALOG} - | \ |
754 |
> |
awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \ |
755 |
> |
${DESTDIR}/${DISTDIR}/${dist}.meta |
756 |
> |
.endfor |
757 |
> |
.endif |
758 |
> |
.endif |
759 |
|
|
760 |
+ |
packageworld: |
761 |
+ |
.for dist in base ${EXTRA_DISTRIBUTIONS} |
762 |
+ |
.if defined(NO_ROOT) |
763 |
+ |
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ |
764 |
+ |
tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \ |
765 |
+ |
@${DESTDIR}/${DISTDIR}/${dist}.meta |
766 |
+ |
.else |
767 |
+ |
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ |
768 |
+ |
tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz . |
769 |
+ |
.endif |
770 |
+ |
.endfor |
771 |
+ |
|
772 |
|
# |
773 |
|
# reinstall |
774 |
|
# |
776 |
|
# and do a 'make reinstall' on the *client* to install new binaries from the |
777 |
|
# most recent server build. |
778 |
|
# |
779 |
< |
reinstall: ${SPECIAL_INSTALLCHECKS} |
779 |
> |
reinstall: |
780 |
|
@echo "--------------------------------------------------------------" |
781 |
|
@echo ">>> Making hierarchy" |
782 |
|
@echo "--------------------------------------------------------------" |
783 |
< |
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy |
783 |
> |
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \ |
784 |
> |
LOCAL_MTREE=${LOCAL_MTREE} hierarchy |
785 |
|
@echo |
786 |
|
@echo "--------------------------------------------------------------" |
787 |
|
@echo ">>> Installing everything" |
788 |
|
@echo "--------------------------------------------------------------" |
789 |
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install |
790 |
< |
.if ${TARGET_ARCH} == "amd64" && !defined(NO_LIB32) |
790 |
> |
.if defined(LIB32TMP) && ${MK_LIB32} != "no" |
791 |
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32 |
792 |
|
.endif |
793 |
|
|
796 |
|
@echo ">>> Distributing everything" |
797 |
|
@echo "--------------------------------------------------------------" |
798 |
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute |
799 |
< |
.if ${TARGET_ARCH} == "amd64" && !defined(NO_LIB32) |
800 |
< |
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 DISTRIBUTION=lib32 |
799 |
> |
.if defined(LIB32TMP) && ${MK_LIB32} != "no" |
800 |
> |
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 \ |
801 |
> |
DISTRIBUTION=lib32 |
802 |
|
.endif |
803 |
|
|
804 |
|
distrib-dirs distribution: |
805 |
< |
cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} ${.TARGET} |
805 |
> |
cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ |
806 |
> |
${IMAKE_INSTALL} ${IMAKE_MTREE} METALOG=${METALOG} ${.TARGET} |
807 |
|
|
808 |
|
# |
809 |
|
# buildkernel and installkernel |
819 |
|
# be set to cross-build, we have to make sure TARGET is set |
820 |
|
# properly. |
821 |
|
|
822 |
+ |
.if defined(KERNFAST) |
823 |
+ |
NO_KERNELCLEAN= t |
824 |
+ |
NO_KERNELCONFIG= t |
825 |
+ |
NO_KERNELDEPEND= t |
826 |
+ |
NO_KERNELOBJ= t |
827 |
+ |
# Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah |
828 |
+ |
.if !defined(KERNCONF) && ${KERNFAST} != "1" |
829 |
+ |
KERNCONF=${KERNFAST} |
830 |
+ |
.endif |
831 |
+ |
.endif |
832 |
|
.if !defined(KERNCONF) && defined(KERNEL) |
833 |
|
KERNCONF= ${KERNEL} |
834 |
|
KERNWARN= |
891 |
|
@echo "--------------------------------------------------------------" |
892 |
|
@echo ">>> stage 2.1: cleaning up the object tree" |
893 |
|
@echo "--------------------------------------------------------------" |
894 |
< |
cd ${KRNLOBJDIR}/${_kernel}; \ |
657 |
< |
${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} ${CLEANDIR} |
894 |
> |
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR} |
895 |
|
.endif |
896 |
+ |
.if !defined(NO_KERNELOBJ) |
897 |
|
@echo |
898 |
|
@echo "--------------------------------------------------------------" |
899 |
|
@echo ">>> stage 2.2: rebuilding the object tree" |
900 |
|
@echo "--------------------------------------------------------------" |
901 |
< |
cd ${KRNLOBJDIR}/${_kernel}; \ |
902 |
< |
${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} obj |
901 |
> |
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj |
902 |
> |
.endif |
903 |
|
@echo |
904 |
|
@echo "--------------------------------------------------------------" |
905 |
|
@echo ">>> stage 2.3: build tools" |
906 |
|
@echo "--------------------------------------------------------------" |
907 |
|
cd ${KRNLOBJDIR}/${_kernel}; \ |
908 |
+ |
PATH=${BPATH}:${PATH} \ |
909 |
|
MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ |
910 |
< |
${MAKE} -DNO_CPU_CFLAGS -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile |
910 |
> |
${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF -DEARLY_BUILD \ |
911 |
> |
-f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile |
912 |
|
# XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. |
913 |
|
.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) |
914 |
|
.for target in obj depend all |
915 |
|
cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \ |
916 |
+ |
PATH=${BPATH}:${PATH} \ |
917 |
|
MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ |
918 |
< |
${MAKE} -DNO_CPU_CFLAGS ${target} |
918 |
> |
${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF -DEARLY_BUILD ${target} |
919 |
|
.endfor |
920 |
|
.endif |
921 |
|
.if !defined(NO_KERNELDEPEND) |
923 |
|
@echo "--------------------------------------------------------------" |
924 |
|
@echo ">>> stage 3.1: making dependencies" |
925 |
|
@echo "--------------------------------------------------------------" |
926 |
< |
cd ${KRNLOBJDIR}/${_kernel}; \ |
686 |
< |
${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend -DNO_MODULES_OBJ |
926 |
> |
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ |
927 |
|
.endif |
928 |
|
@echo |
929 |
|
@echo "--------------------------------------------------------------" |
930 |
|
@echo ">>> stage 3.2: building everything" |
931 |
|
@echo "--------------------------------------------------------------" |
932 |
< |
cd ${KRNLOBJDIR}/${_kernel}; \ |
693 |
< |
${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all -DNO_MODULES_OBJ |
932 |
> |
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ |
933 |
|
@echo "--------------------------------------------------------------" |
934 |
|
@echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`" |
935 |
|
@echo "--------------------------------------------------------------" |
941 |
|
# Install the kernel defined by INSTALLKERNEL |
942 |
|
# |
943 |
|
installkernel installkernel.debug \ |
944 |
< |
reinstallkernel reinstallkernel.debug: ${SPECIAL_INSTALLCHECKS} |
944 |
> |
reinstallkernel reinstallkernel.debug: installcheck |
945 |
|
.if empty(INSTALLKERNEL) |
946 |
|
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \ |
947 |
|
false |
948 |
|
.endif |
949 |
|
@echo "--------------------------------------------------------------" |
950 |
< |
@echo ">>> Installing kernel" |
950 |
> |
@echo ">>> Installing kernel ${INSTALLKERNEL}" |
951 |
|
@echo "--------------------------------------------------------------" |
952 |
|
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ |
953 |
|
${CROSSENV} PATH=${TMPPATH} \ |
954 |
< |
${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} |
954 |
> |
${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} |
955 |
|
|
956 |
+ |
distributekernel distributekernel.debug: |
957 |
+ |
.if empty(INSTALLKERNEL) |
958 |
+ |
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \ |
959 |
+ |
false |
960 |
+ |
.endif |
961 |
+ |
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ |
962 |
+ |
${CROSSENV} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \ |
963 |
+ |
DESTDIR=${DESTDIR}/${DISTDIR}/kernel \ |
964 |
+ |
${.TARGET:S/distributekernel/install/} |
965 |
+ |
.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} |
966 |
+ |
cd ${KRNLOBJDIR}/${_kernel}; \ |
967 |
+ |
${CROSSENV} PATH=${TMPPATH} ${MAKE} \ |
968 |
+ |
KERNEL=${INSTKERNNAME}.${_kernel} \ |
969 |
+ |
DESTDIR=${DESTDIR}/${DISTDIR}/kernel.${_kernel} \ |
970 |
+ |
${.TARGET:S/distributekernel/install/} |
971 |
+ |
.endfor |
972 |
+ |
|
973 |
+ |
packagekernel: |
974 |
+ |
cd ${DESTDIR}/${DISTDIR}/kernel; \ |
975 |
+ |
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz . |
976 |
+ |
.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} |
977 |
+ |
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ |
978 |
+ |
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz . |
979 |
+ |
.endfor |
980 |
+ |
|
981 |
|
# |
982 |
+ |
# doxygen |
983 |
+ |
# |
984 |
+ |
# Build the API documentation with doxygen |
985 |
+ |
# |
986 |
+ |
doxygen: |
987 |
+ |
@if [ ! -x `/usr/bin/which doxygen` ]; then \ |
988 |
+ |
echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \ |
989 |
+ |
exit 1; \ |
990 |
+ |
fi |
991 |
+ |
cd ${.CURDIR}/tools/kerneldoc/subsys && ${MAKE} obj all |
992 |
+ |
|
993 |
+ |
# |
994 |
|
# update |
995 |
|
# |
996 |
< |
# Update the source tree, by running cvsup and/or running cvs to update to the |
996 |
> |
# Update the source tree(s), by running cvsup/cvs/svn to update to the |
997 |
|
# latest copy. |
998 |
|
# |
999 |
|
update: |
1018 |
|
.endif |
1019 |
|
.endif |
1020 |
|
.if defined(CVS_UPDATE) |
1021 |
< |
@echo "--------------------------------------------------------------" |
1022 |
< |
@echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT} |
1023 |
< |
@echo "--------------------------------------------------------------" |
1024 |
< |
cd ${.CURDIR}; ${CVS} -R -q update ${CVSFLAGS} |
1021 |
> |
@cd ${.CURDIR} ; \ |
1022 |
> |
if [ -d CVS ] ; then \ |
1023 |
> |
echo "--------------------------------------------------------------" ; \ |
1024 |
> |
echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT} ; \ |
1025 |
> |
echo "--------------------------------------------------------------" ; \ |
1026 |
> |
echo ${CVS} -R -q update ${CVSFLAGS} ; \ |
1027 |
> |
${CVS} -R -q update ${CVSFLAGS} ; \ |
1028 |
> |
fi |
1029 |
|
.endif |
1030 |
+ |
.if defined(SVN_UPDATE) |
1031 |
+ |
@cd ${.CURDIR} ; \ |
1032 |
+ |
if [ -d .svn ] ; then \ |
1033 |
+ |
echo "--------------------------------------------------------------" ; \ |
1034 |
+ |
echo ">>> Updating ${.CURDIR} using Subversion" ; \ |
1035 |
+ |
echo "--------------------------------------------------------------" ; \ |
1036 |
+ |
echo ${SVN} update ${SVNFLAGS} ; \ |
1037 |
+ |
${SVN} update ${SVNFLAGS} ; \ |
1038 |
+ |
fi |
1039 |
+ |
.endif |
1040 |
|
|
1041 |
|
# |
1042 |
|
# ------------------------------------------------------------------------ |
1053 |
|
# legacy: Build compatibility shims for the next three targets |
1054 |
|
# |
1055 |
|
legacy: |
1056 |
< |
.if ${BOOTSTRAPPING} < 503000 |
1057 |
< |
@echo "ERROR: Source upgrades from versions prior to 5.3 not supported."; \ |
1056 |
> |
.if ${BOOTSTRAPPING} < 7000 && ${BOOTSTRAPPING} != 0 |
1057 |
> |
@echo "ERROR: Source upgrades from versions prior to 0.7 not supported."; \ |
1058 |
|
false |
1059 |
|
.endif |
1060 |
+ |
mkdir -p ${MAKEOBJDIRPREFIX}/legacy/usr/bin |
1061 |
|
.for _tool in tools/build |
1062 |
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \ |
1063 |
< |
cd ${.CURDIR}/${_tool}; \ |
1064 |
< |
${MAKE} DIRPRFX=${_tool}/ obj; \ |
1065 |
< |
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \ |
1066 |
< |
${MAKE} DIRPRFX=${_tool}/ depend; \ |
1067 |
< |
${MAKE} DIRPRFX=${_tool}/ all; \ |
1063 |
> |
cd ${.CURDIR}/${_tool} && \ |
1064 |
> |
${MAKE} DIRPRFX=${_tool}/ obj && \ |
1065 |
> |
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes && \ |
1066 |
> |
${MAKE} DIRPRFX=${_tool}/ depend && \ |
1067 |
> |
${MAKE} DIRPRFX=${_tool}/ all && \ |
1068 |
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install |
1069 |
|
.endfor |
1070 |
|
|
1071 |
|
# |
1072 |
|
# bootstrap-tools: Build tools needed for compatibility |
1073 |
|
# |
1074 |
< |
.if !defined(NO_GAMES) |
1074 |
> |
.if ${MK_GAMES} != "no" |
1075 |
|
_strfile= games/fortune/strfile |
1076 |
|
.endif |
1077 |
|
|
1078 |
< |
.if !defined(NO_CXX) |
1078 |
> |
.if ${MK_CXX} != "no" |
1079 |
|
_gperf= gnu/usr.bin/gperf |
1080 |
< |
.if ${BOOTSTRAPPING} < 600101 |
1080 |
> |
.endif |
1081 |
> |
|
1082 |
> |
.if ${MK_GROFF} != "no" |
1083 |
|
_groff= gnu/usr.bin/groff |
791 |
– |
.else |
792 |
– |
_groff= gnu/usr.bin/groff/tmac |
1084 |
|
.endif |
1085 |
+ |
|
1086 |
+ |
.if ${BOOTSTRAPPING} >= 4000 && ${BOOTSTRAPPING} < 4015 |
1087 |
+ |
_ar= usr.bin/ar |
1088 |
|
.endif |
1089 |
|
|
1090 |
< |
.if ${BOOTSTRAPPING} < 600029 |
1091 |
< |
_texinfo= gnu/usr.bin/texinfo |
1090 |
> |
.if ${BOOTSTRAPPING} < 4015 |
1091 |
> |
_mklocale= usr.bin/mklocale |
1092 |
|
.endif |
1093 |
|
|
1094 |
< |
.if ${BOOTSTRAPPING} < 600015 |
1095 |
< |
_cap_mkdb= usr.bin/cap_mkdb |
1094 |
> |
.if ${BOOTSTRAPPING} < 4015 |
1095 |
> |
_sed= usr.bin/sed |
1096 |
|
.endif |
1097 |
|
|
1098 |
< |
.if ${BOOTSTRAPPING} < 600018 |
1099 |
< |
_colldef= usr.bin/colldef |
1098 |
> |
.if ${BOOTSTRAPPING} < 7003 |
1099 |
> |
_m4= usr.bin/m4 |
1100 |
|
.endif |
1101 |
|
|
1102 |
< |
.if ${BOOTSTRAPPING} < 600017 |
1103 |
< |
_gencat= usr.bin/gencat |
1102 |
> |
.if ${BOOTSTRAPPING} < 7003 |
1103 |
> |
_lex= usr.bin/lex |
1104 |
|
.endif |
1105 |
|
|
1106 |
< |
.if ${BOOTSTRAPPING} < 600016 |
1107 |
< |
_mklocale= usr.bin/mklocale |
1106 |
> |
.if ${BOOTSTRAPPING} < 7003 |
1107 |
> |
_yacc= lib/liby \ |
1108 |
> |
usr.bin/yacc |
1109 |
|
.endif |
1110 |
|
|
1111 |
< |
.if !defined(NO_RESCUE) && \ |
1112 |
< |
${BOOTSTRAPPING} < 600008 |
1111 |
> |
.if ${BOOTSTRAPPING} < 9002 |
1112 |
> |
_nmtree= lib/libnetbsd \ |
1113 |
> |
usr.sbin/nmtree |
1114 |
> |
.endif |
1115 |
> |
|
1116 |
> |
|
1117 |
> |
.if ${MK_BSNMP} != "no" && \ |
1118 |
> |
(${BOOTSTRAPPING} < 4015 || !exists(/usr/sbin/gensnmptree)) |
1119 |
> |
_gensnmptree= usr.sbin/bsnmpd/gensnmptree |
1120 |
> |
.endif |
1121 |
> |
|
1122 |
> |
.if ${MK_RESCUE} != "no" && \ |
1123 |
> |
${BOOTSTRAPPING} < 4015 |
1124 |
|
_crunchgen= usr.sbin/crunch/crunchgen |
1125 |
|
.endif |
1126 |
|
|
1127 |
< |
.if ${BOOTSTRAPPING} < 600020 |
1128 |
< |
_pwd_mkdb= usr.sbin/pwd_mkdb |
1127 |
> |
.if ${MK_CLANG} != "no" |
1128 |
> |
_clang_tblgen= \ |
1129 |
> |
lib/clang/libllvmsupport \ |
1130 |
> |
lib/clang/libllvmtablegen \ |
1131 |
> |
usr.bin/clang/tblgen \ |
1132 |
> |
usr.bin/clang/clang-tblgen |
1133 |
|
.endif |
1134 |
|
|
1135 |
+ |
.if ${MK_CDDL} != "no" && \ |
1136 |
+ |
${BOOTSTRAPPING} < 4015 && \ |
1137 |
+ |
!(${BOOTSTRAPPING} >= 4000 && ${BOOTSTRAPPING} < 4015) |
1138 |
+ |
_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ |
1139 |
+ |
lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge |
1140 |
+ |
.endif |
1141 |
+ |
|
1142 |
+ |
.if ${MK_FDT} != "no" |
1143 |
+ |
_dtc= gnu/usr.bin/dtc |
1144 |
+ |
.endif |
1145 |
+ |
|
1146 |
+ |
# Please document (add comment) why something is in 'bootstrap-tools'. |
1147 |
+ |
# Try to bound the building of the bootstrap-tool to just the |
1148 |
+ |
# MidnightBSD versions that need the tool built at this stage of the build. |
1149 |
|
bootstrap-tools: |
1150 |
|
.for _tool in \ |
1151 |
+ |
${_clang_tblgen} \ |
1152 |
+ |
${_kerberos5_bootstrap_tools} \ |
1153 |
+ |
${_dtrace_tools} \ |
1154 |
|
${_strfile} \ |
1155 |
|
${_gperf} \ |
1156 |
|
${_groff} \ |
1157 |
< |
${_texinfo} \ |
1158 |
< |
${_cap_mkdb} \ |
1159 |
< |
${_colldef} \ |
1160 |
< |
${_gencat} \ |
1157 |
> |
${_ar} \ |
1158 |
> |
${_dtc} \ |
1159 |
> |
${_awk} \ |
1160 |
> |
${_cat} \ |
1161 |
|
usr.bin/lorder \ |
1162 |
|
usr.bin/makewhatis \ |
1163 |
|
${_mklocale} \ |
1164 |
|
usr.bin/rpcgen \ |
1165 |
+ |
${_sed} \ |
1166 |
+ |
${_yacc} \ |
1167 |
+ |
${_m4} \ |
1168 |
+ |
${_lex} \ |
1169 |
+ |
lib/libmd \ |
1170 |
|
usr.bin/xinstall \ |
1171 |
+ |
${_gensnmptree} \ |
1172 |
|
usr.sbin/config \ |
1173 |
|
${_crunchgen} \ |
1174 |
< |
${_pwd_mkdb} |
1174 |
> |
${_nmtree} |
1175 |
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ |
1176 |
|
cd ${.CURDIR}/${_tool}; \ |
1177 |
|
${MAKE} DIRPRFX=${_tool}/ obj; \ |
1191 |
|
_share= share/syscons/scrnmaps |
1192 |
|
.endif |
1193 |
|
|
1194 |
< |
.if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL) |
1195 |
< |
_kerberos5_tools= kerberos5/tools |
1194 |
> |
.if ${MK_GCC} != "no" && (${MK_CLANG_IS_CC} == "no" || ${TARGET} == "pc98") |
1195 |
> |
_gcc_tools= gnu/usr.bin/cc/cc_tools |
1196 |
|
.endif |
1197 |
|
|
1198 |
< |
.if !defined(NO_RESCUE) |
1198 |
> |
.if ${MK_KERBEROS} != "no" |
1199 |
> |
_kerberos5_bootstrap_tools= \ |
1200 |
> |
kerberos5/tools/make-roken \ |
1201 |
> |
kerberos5/lib/libroken \ |
1202 |
> |
kerberos5/lib/libvers \ |
1203 |
> |
kerberos5/tools/asn1_compile \ |
1204 |
> |
kerberos5/tools/slc \ |
1205 |
> |
usr.bin/compile_et |
1206 |
> |
|
1207 |
> |
.ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g} |
1208 |
> |
.endif |
1209 |
> |
|
1210 |
> |
.if ${MK_RESCUE} != "no" |
1211 |
|
_rescue= rescue/rescue |
1212 |
|
.endif |
1213 |
|
|
1216 |
|
bin/csh \ |
1217 |
|
bin/sh \ |
1218 |
|
${_rescue} \ |
1219 |
< |
lib/libncurses \ |
1219 |
> |
lib/ncurses/ncurses \ |
1220 |
> |
lib/ncurses/ncursesw \ |
1221 |
|
${_share} \ |
1222 |
|
${_aicasm} \ |
1223 |
|
usr.bin/awk \ |
1224 |
|
lib/libmagic \ |
1225 |
< |
usr.sbin/sysinstall |
1225 |
> |
usr.sbin/sysinstall \ |
1226 |
> |
usr.bin/mkesdb_static \ |
1227 |
> |
usr.bin/mkcsmapper_static |
1228 |
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \ |
1229 |
|
cd ${.CURDIR}/${_tool}; \ |
1230 |
|
${MAKE} DIRPRFX=${_tool}/ obj; \ |
1231 |
|
${MAKE} DIRPRFX=${_tool}/ build-tools |
1232 |
|
.endfor |
1233 |
|
.for _tool in \ |
1234 |
< |
gnu/usr.bin/cc/cc_tools \ |
1235 |
< |
${_kerberos5_tools} |
1236 |
< |
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \ |
1237 |
< |
cd ${.CURDIR}/${_tool}; \ |
1238 |
< |
${MAKE} DIRPRFX=${_tool}/ obj; \ |
1239 |
< |
${MAKE} DIRPRFX=${_tool}/ depend; \ |
1240 |
< |
${MAKE} DIRPRFX=${_tool}/ all |
1234 |
> |
${_gcc_tools} \ |
1235 |
> |
${_kerberos5_bootstrap_tools} |
1236 |
> |
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ |
1237 |
> |
cd ${.CURDIR}/${_tool} && \ |
1238 |
> |
${MAKE} DIRPRFX=${_tool}/ obj && \ |
1239 |
> |
${MAKE} DIRPRFX=${_tool}/ depend && \ |
1240 |
> |
${MAKE} DIRPRFX=${_tool}/ all && \ |
1241 |
> |
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP}/legacy install |
1242 |
|
.endfor |
1243 |
|
|
1244 |
|
# |
1245 |
|
# cross-tools: Build cross-building tools |
1246 |
|
# |
1247 |
< |
.if (${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386") && \ |
1248 |
< |
${TARGET_ARCH} != ${MACHINE_ARCH} |
1247 |
> |
.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 4016 |
1248 |
> |
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" |
1249 |
|
_btxld= usr.sbin/btxld |
1250 |
|
.endif |
1251 |
< |
|
1252 |
< |
.if (!defined(NO_RESCUE) || defined(RELEASEDIR)) && \ |
1253 |
< |
${TARGET_ARCH} != ${MACHINE_ARCH} |
1251 |
> |
.endif |
1252 |
> |
.if ${TARGET_ARCH} != ${MACHINE_ARCH} |
1253 |
> |
.if ${MK_RESCUE} != "no" || defined(RELEASEDIR) |
1254 |
|
_crunchide= usr.sbin/crunch/crunchide |
1255 |
|
.endif |
1256 |
+ |
.if ${TARGET_ARCH} == "i386" && defined(RELEASEDIR) |
1257 |
+ |
_kgzip= usr.sbin/kgzip |
1258 |
+ |
.endif |
1259 |
+ |
.endif |
1260 |
|
|
1261 |
< |
.if ${TARGET_ARCH} == "alpha" && ${TARGET_ARCH} != ${MACHINE_ARCH} |
1262 |
< |
_elf2exe= usr.sbin/elf2exe |
1261 |
> |
.if ${MK_BINUTILS} != "no" |
1262 |
> |
_binutils= gnu/usr.bin/binutils |
1263 |
|
.endif |
1264 |
|
|
1265 |
< |
.if ${TARGET_ARCH} == "i386" && ${TARGET_ARCH} != ${MACHINE_ARCH} && \ |
1266 |
< |
defined(RELEASEDIR) |
1267 |
< |
_kgzip= usr.sbin/kgzip |
1265 |
> |
.if ${MK_CLANG} != "no" && (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") |
1266 |
> |
_clang= usr.bin/clang |
1267 |
> |
_clang_libs= lib/clang |
1268 |
|
.endif |
1269 |
|
|
1270 |
+ |
.if ${MK_GCC} != "no" && (${MK_CLANG_IS_CC} == "no" || ${TARGET} == "pc98") |
1271 |
+ |
_cc= gnu/usr.bin/cc |
1272 |
+ |
.endif |
1273 |
+ |
|
1274 |
|
cross-tools: |
1275 |
|
.for _tool in \ |
1276 |
< |
gnu/usr.bin/binutils \ |
1277 |
< |
gnu/usr.bin/cc \ |
1276 |
> |
${_clang_libs} \ |
1277 |
> |
${_clang} \ |
1278 |
> |
${_binutils} \ |
1279 |
> |
${_cc} \ |
1280 |
|
usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ |
1281 |
|
${_btxld} \ |
1282 |
|
${_crunchide} \ |
924 |
– |
${_elf2exe} \ |
1283 |
|
${_kgzip} |
1284 |
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ |
1285 |
|
cd ${.CURDIR}/${_tool}; \ |
1293 |
|
# hierarchy - ensure that all the needed directories are present |
1294 |
|
# |
1295 |
|
hierarchy: |
1296 |
< |
cd ${.CURDIR}/etc; ${MAKE} distrib-dirs |
1296 |
> |
.if defined(NO_ROOT) |
1297 |
> |
cd ${.CURDIR}/etc; ${MAKE} LOCAL_MTREE=${LOCAL_MTREE} \ |
1298 |
> |
-DNO_ROOT METALOG=${METALOG} distrib-dirs |
1299 |
> |
.else |
1300 |
> |
cd ${.CURDIR}/etc; ${MAKE} LOCAL_MTREE=${LOCAL_MTREE} distrib-dirs |
1301 |
> |
.endif |
1302 |
|
|
1303 |
|
# |
1304 |
|
# libraries - build all libraries, and install them under ${DESTDIR}. |
1309 |
|
# |
1310 |
|
libraries: |
1311 |
|
cd ${.CURDIR}; \ |
1312 |
+ |
${MAKE} -f Makefile.inc1 _prereq_libs; \ |
1313 |
|
${MAKE} -f Makefile.inc1 _startup_libs; \ |
1314 |
|
${MAKE} -f Makefile.inc1 _prebuild_libs; \ |
1315 |
|
${MAKE} -f Makefile.inc1 _generic_libs; |
1316 |
|
|
1317 |
+ |
# |
1318 |
+ |
# static libgcc.a prerequisite for shared libc |
1319 |
+ |
# |
1320 |
+ |
_prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc lib/libcompiler_rt |
1321 |
+ |
|
1322 |
|
# These dependencies are not automatically generated: |
1323 |
|
# |
1324 |
< |
# gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all |
1325 |
< |
# shared libraries for ELF. |
1324 |
> |
# gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before |
1325 |
> |
# all shared libraries for ELF. |
1326 |
|
# |
1327 |
< |
_startup_libs= gnu/lib/csu gnu/lib/libgcc |
1327 |
> |
_startup_libs= gnu/lib/csu |
1328 |
|
.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf) |
1329 |
|
_startup_libs+= lib/csu/${MACHINE_ARCH}-elf |
1330 |
< |
.else |
1330 |
> |
.elif exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}) |
1331 |
|
_startup_libs+= lib/csu/${MACHINE_ARCH} |
1332 |
+ |
.else |
1333 |
+ |
_startup_libs+= lib/csu/${MACHINE_CPUARCH} |
1334 |
|
.endif |
1335 |
+ |
_startup_libs+= gnu/lib/libgcc |
1336 |
+ |
_startup_libs+= lib/libcompiler_rt |
1337 |
+ |
_startup_libs+= lib/libc |
1338 |
+ |
_startup_libs+= lib/libc_nonshared |
1339 |
+ |
.if ${MK_LIBCPLUSPLUS} != "no" |
1340 |
+ |
_startup_libs+= lib/libcxxrt |
1341 |
+ |
.endif |
1342 |
|
|
1343 |
< |
_prebuild_libs= |
1343 |
> |
gnu/lib/libgcc__L: lib/libc__L |
1344 |
> |
gnu/lib/libgcc__L: lib/libc_nonshared__L |
1345 |
> |
.if ${MK_LIBCPLUSPLUS} != "no" |
1346 |
> |
lib/libcxxrt__L: gnu/lib/libgcc__L |
1347 |
> |
.endif |
1348 |
|
|
1349 |
< |
_generic_libs= gnu/lib |
1349 |
> |
_prebuild_libs= ${_kerberos5_lib_libasn1} \ |
1350 |
> |
${_kerberos5_lib_libhdb} \ |
1351 |
> |
${_kerberos5_lib_libheimbase} \ |
1352 |
> |
${_kerberos5_lib_libheimntlm} \ |
1353 |
> |
${_kerberos5_lib_libheimsqlite} \ |
1354 |
> |
${_kerberos5_lib_libheimipcc} \ |
1355 |
> |
${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \ |
1356 |
> |
${_kerberos5_lib_libroken} \ |
1357 |
> |
${_kerberos5_lib_libwind} \ |
1358 |
> |
lib/libbz2 lib/libcom_err lib/libcrypt \ |
1359 |
> |
lib/libelf lib/libexpat \ |
1360 |
> |
${_lib_libgssapi} ${_lib_libipx} \ |
1361 |
> |
lib/libkiconv lib/libkvm lib/liblzma lib/libmd \ |
1362 |
> |
lib/ncurses/ncurses lib/ncurses/ncursesw \ |
1363 |
> |
lib/libopie lib/libpam ${_lib_libthr} \ |
1364 |
> |
lib/libradius lib/libsbuf lib/libtacplus \ |
1365 |
> |
${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ |
1366 |
> |
${_cddl_lib_libzfs_core} \ |
1367 |
> |
lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ |
1368 |
> |
${_secure_lib_libcrypto} ${_secure_lib_libssh} \ |
1369 |
> |
${_secure_lib_libssl} lib/libsqlite3 \ |
1370 |
> |
lib/libarchive lib/libfetch lib/libmagic \ |
1371 |
> |
lib/libblocksruntime |
1372 |
> |
.if ${MK_LIBTHR} != "no" |
1373 |
> |
_lib_libthr= lib/libthr |
1374 |
> |
.endif |
1375 |
|
|
1376 |
< |
.if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL) |
1377 |
< |
_prebuild_libs+= kerberos5/lib/libasn1 |
971 |
< |
_prebuild_libs+= kerberos5/lib/libgssapi |
972 |
< |
_prebuild_libs+= kerberos5/lib/libkrb5 |
973 |
< |
_prebuild_libs+= kerberos5/lib/libroken |
974 |
< |
_generic_libs+= kerberos5/lib |
1376 |
> |
.if ${MK_OFED} != "no" |
1377 |
> |
_ofed_lib= contrib/ofed/usr.lib/ |
1378 |
|
.endif |
1379 |
|
|
1380 |
< |
_prebuild_libs+= lib/libcom_err lib/libcrypt lib/libexpat \ |
978 |
< |
lib/libkvm lib/libmd \ |
979 |
< |
lib/libncurses lib/libnetgraph lib/libopie lib/libpam \ |
980 |
< |
lib/libradius \ |
981 |
< |
lib/libsbuf lib/libtacplus lib/libutil \ |
982 |
< |
lib/libz lib/msun |
1380 |
> |
_generic_libs= ${_apache_lib} ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib} |
1381 |
|
|
1382 |
|
lib/libopie__L lib/libtacplus__L: lib/libmd__L |
1383 |
|
|
1384 |
< |
_generic_libs+= lib |
1384 |
> |
.if ${MK_APACHE} != "no" |
1385 |
> |
_apache_lib= apache/lib |
1386 |
> |
.endif |
1387 |
|
|
1388 |
< |
.if !defined(NO_CRYPT) |
1389 |
< |
.if !defined(NO_OPENSSL) |
1390 |
< |
_prebuild_libs+= secure/lib/libcrypto secure/lib/libssl |
1391 |
< |
lib/libradius__L: secure/lib/libssl__L |
1392 |
< |
secure/lib/libssl__L: secure/lib/libcrypto__L |
1393 |
< |
.if !defined(NO_OPENSSH) |
1394 |
< |
_prebuild_libs+= secure/lib/libssh |
1388 |
> |
.if ${MK_CDDL} != "no" |
1389 |
> |
_cddl_lib_libumem= cddl/lib/libumem |
1390 |
> |
_cddl_lib_libnvpair= cddl/lib/libnvpair |
1391 |
> |
_cddl_lib_libzfs_core= cddl/lib/libzfs_core |
1392 |
> |
_cddl_lib= cddl/lib |
1393 |
> |
cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L |
1394 |
> |
.endif |
1395 |
> |
|
1396 |
> |
.if ${MK_CRYPT} != "no" |
1397 |
> |
.if ${MK_OPENSSL} != "no" |
1398 |
> |
_secure_lib_libcrypto= secure/lib/libcrypto |
1399 |
> |
_secure_lib_libssl= secure/lib/libssl |
1400 |
> |
lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L |
1401 |
> |
.if ${MK_OPENSSH} != "no" |
1402 |
> |
_secure_lib_libssh= secure/lib/libssh |
1403 |
|
secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L |
1404 |
< |
.if !defined(NO_KERBEROS) |
1405 |
< |
secure/lib/libssh__L: kerberos5/lib/libgssapi__L kerberos5/lib/libkrb5__L \ |
1406 |
< |
kerberos5/lib/libasn1__L lib/libcom_err__L lib/libmd__L \ |
1407 |
< |
kerberos5/lib/libroken__L |
1404 |
> |
.if ${MK_KERBEROS_SUPPORT} != "no" |
1405 |
> |
secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \ |
1406 |
> |
kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \ |
1407 |
> |
lib/libmd__L kerberos5/lib/libroken__L |
1408 |
|
.endif |
1409 |
|
.endif |
1410 |
|
.endif |
1411 |
< |
_generic_libs+= secure/lib |
1411 |
> |
_secure_lib= secure/lib |
1412 |
|
.endif |
1413 |
|
|
1414 |
< |
.if defined(NO_CRYPT) || defined(NO_OPENSSL) |
1415 |
< |
lib/libradius__L: lib/libmd__L |
1414 |
> |
.if ${MK_KERBEROS} != "no" |
1415 |
> |
kerberos5/lib/libasn1__L: lib/libcom_err__L kerberos5/lib/libroken__L |
1416 |
> |
kerberos5/lib/libhdb__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ |
1417 |
> |
kerberos5/lib/libkrb5__L kerberos5/lib/libroken__L \ |
1418 |
> |
kerberos5/lib/libwind__L kerberos5/lib/libheimsqlite__L |
1419 |
> |
kerberos5/lib/libheimntlm__L: secure/lib/libcrypto__L kerberos5/lib/libkrb5__L \ |
1420 |
> |
kerberos5/lib/libroken__L lib/libcom_err__L |
1421 |
> |
kerberos5/lib/libhx509__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ |
1422 |
> |
secure/lib/libcrypto__L kerberos5/lib/libroken__L kerberos5/lib/libwind__L |
1423 |
> |
kerberos5/lib/libkrb5__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ |
1424 |
> |
lib/libcrypt__L secure/lib/libcrypto__L kerberos5/lib/libhx509__L \ |
1425 |
> |
kerberos5/lib/libroken__L kerberos5/lib/libwind__L \ |
1426 |
> |
kerberos5/lib/libheimbase__L kerberos5/lib/libheimipcc__L |
1427 |
> |
kerberos5/lib/libroken__L: lib/libcrypt__L |
1428 |
> |
kerberos5/lib/libwind__L: kerberos5/lib/libroken__L lib/libcom_err__L |
1429 |
> |
kerberos5/lib/libheimbase__L: lib/libthr__L |
1430 |
> |
kerberos5/lib/libheimipcc__L: kerberos5/lib/libroken__L kerberos5/lib/libheimbase__L lib/libthr__L |
1431 |
> |
kerberos5/lib/libheimsqlite__L: lib/libthr__L |
1432 |
|
.endif |
1433 |
|
|
1434 |
< |
.if !defined(NO_NIS) |
1435 |
< |
_prebuild_libs+= lib/libypclnt |
1434 |
> |
.if ${MK_GSSAPI} != "no" |
1435 |
> |
_lib_libgssapi= lib/libgssapi |
1436 |
|
.endif |
1437 |
|
|
1438 |
< |
_generic_libs+= usr.bin/lex/lib |
1438 |
> |
.if ${MK_IPX} != "no" |
1439 |
> |
_lib_libipx= lib/libipx |
1440 |
> |
.endif |
1441 |
|
|
1442 |
< |
.if ${MACHINE_ARCH} == "i386" |
1443 |
< |
_generic_libs+= usr.sbin/pcvt/keycap |
1442 |
> |
.if ${MK_KERBEROS} != "no" |
1443 |
> |
_kerberos5_lib= kerberos5/lib |
1444 |
> |
_kerberos5_lib_libasn1= kerberos5/lib/libasn1 |
1445 |
> |
_kerberos5_lib_libhdb= kerberos5/lib/libhdb |
1446 |
> |
_kerberos5_lib_libheimbase= kerberos5/lib/libheimbase |
1447 |
> |
_kerberos5_lib_libkrb5= kerberos5/lib/libkrb5 |
1448 |
> |
_kerberos5_lib_libhx509= kerberos5/lib/libhx509 |
1449 |
> |
_kerberos5_lib_libroken= kerberos5/lib/libroken |
1450 |
> |
_kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm |
1451 |
> |
_kerberos5_lib_libheimsqlite= kerberos5/lib/libheimsqlite |
1452 |
> |
_kerberos5_lib_libheimipcc= kerberos5/lib/libheimipcc |
1453 |
> |
_kerberos5_lib_libwind= kerberos5/lib/libwind |
1454 |
> |
_libcom_err= lib/libcom_err |
1455 |
|
.endif |
1456 |
|
|
1457 |
+ |
.if ${MK_NIS} != "no" |
1458 |
+ |
_lib_libypclnt= lib/libypclnt |
1459 |
+ |
.endif |
1460 |
+ |
|
1461 |
+ |
.if ${MK_OPENSSL} == "no" |
1462 |
+ |
lib/libradius__L: lib/libmd__L |
1463 |
+ |
.endif |
1464 |
+ |
|
1465 |
+ |
.for _lib in ${_prereq_libs} |
1466 |
+ |
${_lib}__PL: .PHONY .MAKE |
1467 |
+ |
.if exists(${.CURDIR}/${_lib}) |
1468 |
+ |
${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ |
1469 |
+ |
cd ${.CURDIR}/${_lib} && \ |
1470 |
+ |
${MAKE} DIRPRFX=${_lib}/ obj && \ |
1471 |
+ |
${MAKE} DIRPRFX=${_lib}/ depend && \ |
1472 |
+ |
${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all && \ |
1473 |
+ |
${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install |
1474 |
+ |
.endif |
1475 |
+ |
.endfor |
1476 |
+ |
|
1477 |
|
.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs} |
1478 |
|
${_lib}__L: .PHONY |
1479 |
|
.if exists(${.CURDIR}/${_lib}) |
1480 |
< |
${_+_}@${ECHODIR} "===> ${_lib} (depend,all,install)"; \ |
1481 |
< |
cd ${.CURDIR}/${_lib}; \ |
1482 |
< |
${MAKE} DIRPRFX=${_lib}/ depend; \ |
1483 |
< |
${MAKE} DIRPRFX=${_lib}/ all; \ |
1480 |
> |
${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ |
1481 |
> |
cd ${.CURDIR}/${_lib} && \ |
1482 |
> |
${MAKE} DIRPRFX=${_lib}/ obj && \ |
1483 |
> |
${MAKE} DIRPRFX=${_lib}/ depend && \ |
1484 |
> |
${MAKE} DIRPRFX=${_lib}/ all && \ |
1485 |
|
${MAKE} DIRPRFX=${_lib}/ install |
1486 |
|
.endif |
1487 |
|
.endfor |
1490 |
|
# static PAM library, and dynamic PAM library before dynamic PAM |
1491 |
|
# modules. |
1492 |
|
lib/libpam__L: .PHONY |
1493 |
< |
${_+_}@${ECHODIR} "===> lib/libpam (depend,all,install)"; \ |
1493 |
> |
${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ |
1494 |
|
cd ${.CURDIR}/lib/libpam; \ |
1495 |
+ |
${MAKE} DIRPRFX=lib/libpam/ obj; \ |
1496 |
|
${MAKE} DIRPRFX=lib/libpam/ depend; \ |
1497 |
|
${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \ |
1498 |
|
${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install |
1499 |
|
|
1500 |
+ |
_prereq_libs: ${_prereq_libs:S/$/__PL/} |
1501 |
|
_startup_libs: ${_startup_libs:S/$/__L/} |
1502 |
|
_prebuild_libs: ${_prebuild_libs:S/$/__L/} |
1503 |
|
_generic_libs: ${_generic_libs:S/$/__L/} |
1521 |
|
|
1522 |
|
.include <bsd.subdir.mk> |
1523 |
|
|
1524 |
< |
.if make(delete-old) || make(delete-old-libs) || make(check-old) |
1524 |
> |
.if make(check-old) || make(check-old-dirs) || \ |
1525 |
> |
make(check-old-files) || make(check-old-libs) || \ |
1526 |
> |
make(delete-old) || make(delete-old-dirs) || \ |
1527 |
> |
make(delete-old-files) || make(delete-old-libs) |
1528 |
|
|
1529 |
|
# |
1530 |
|
# check for / delete old files section |
1545 |
|
|
1546 |
|
delete-old-files: |
1547 |
|
@echo ">>> Removing old files (only deletes safe to delete libs)" |
1085 |
– |
.for file in ${OLD_FILES} |
1548 |
|
# Ask for every old file if the user really wants to remove it. |
1549 |
|
# It's annoying, but better safe than sorry. |
1550 |
< |
@[ ! -f "${DESTDIR}/${file}" ] || (rm ${RM_I} "${DESTDIR}/${file}" \ |
1551 |
< |
|| ([ -f "${DESTDIR}/${file}" ] \ |
1552 |
< |
&& echo "Removing schg flag on ${DESTDIR}/${file}" \ |
1553 |
< |
&& chflags noschg "${DESTDIR}/${file}" \ |
1554 |
< |
&& rm ${RM_I} "${DESTDIR}/${file}")) |
1555 |
< |
.endfor |
1550 |
> |
# NB: We cannot pass the list of OLD_FILES as a parameter because the |
1551 |
> |
# argument list will get too long. Using .for/.endfor make "loops" will make |
1552 |
> |
# the Makefile parser segfault. |
1553 |
> |
@exec 3<&0; \ |
1554 |
> |
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1555 |
> |
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \ |
1556 |
> |
while read file; do \ |
1557 |
> |
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ |
1558 |
> |
chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ |
1559 |
> |
rm ${RM_I} "${DESTDIR}/$${file}" <&3; \ |
1560 |
> |
fi; \ |
1561 |
> |
done |
1562 |
|
# Remove catpages without corresponding manpages. |
1563 |
< |
@3<&0; \ |
1563 |
> |
@exec 3<&0; \ |
1564 |
|
find ${DESTDIR}/usr/share/man/cat* ! -type d | \ |
1565 |
|
sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ |
1566 |
|
while read catpage; do \ |
1567 |
|
read manpage; \ |
1568 |
|
if [ ! -e "$${manpage}" ]; then \ |
1569 |
< |
rm ${RM_I} $${catpage} <&3 ; \ |
1569 |
> |
rm ${RM_I} $${catpage} <&3; \ |
1570 |
|
fi; \ |
1571 |
|
done |
1572 |
|
@echo ">>> Old files removed" |
1573 |
|
|
1574 |
|
check-old-files: |
1575 |
|
@echo ">>> Checking for old files" |
1576 |
< |
.for file in ${OLD_FILES} |
1577 |
< |
@[ ! -f "${DESTDIR}/${file}" ] || echo "${DESTDIR}/${file}" |
1578 |
< |
.endfor |
1576 |
> |
@${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1577 |
> |
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \ |
1578 |
> |
while read file; do \ |
1579 |
> |
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ |
1580 |
> |
echo "${DESTDIR}/$${file}"; \ |
1581 |
> |
fi; \ |
1582 |
> |
done |
1583 |
|
# Check for catpages without corresponding manpages. |
1584 |
|
@find ${DESTDIR}/usr/share/man/cat* ! -type d | \ |
1585 |
|
sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ |
1586 |
|
while read catpage; do \ |
1587 |
|
read manpage; \ |
1588 |
|
if [ ! -e "$${manpage}" ]; then \ |
1589 |
< |
echo $${catpage} ; \ |
1589 |
> |
echo $${catpage}; \ |
1590 |
|
fi; \ |
1591 |
|
done |
1592 |
|
|
1593 |
|
delete-old-libs: |
1594 |
|
@echo ">>> Removing old libraries" |
1595 |
|
@echo "${OLD_LIBS_MESSAGE}" | fmt |
1596 |
< |
.for file in ${OLD_LIBS} |
1597 |
< |
@[ ! -f "${DESTDIR}/${file}" ] || (rm ${RM_I} "${DESTDIR}/${file}" \ |
1598 |
< |
|| ([ -f "${DESTDIR}/${file}" ] \ |
1599 |
< |
&& echo "Removing schg flag on ${DESTDIR}/${file}" \ |
1600 |
< |
&& chflags noschg "${DESTDIR}/${file}" \ |
1601 |
< |
&& rm ${RM_I} "${DESTDIR}/${file}")) |
1602 |
< |
.endfor |
1596 |
> |
@exec 3<&0; \ |
1597 |
> |
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1598 |
> |
-V OLD_LIBS | xargs -n1 | \ |
1599 |
> |
while read file; do \ |
1600 |
> |
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ |
1601 |
> |
chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ |
1602 |
> |
rm ${RM_I} "${DESTDIR}/$${file}" <&3; \ |
1603 |
> |
fi; \ |
1604 |
> |
done |
1605 |
|
@echo ">>> Old libraries removed" |
1606 |
|
|
1607 |
|
check-old-libs: |
1608 |
|
@echo ">>> Checking for old libraries" |
1609 |
< |
.for file in ${OLD_LIBS} |
1610 |
< |
@[ ! -f "${DESTDIR}/${file}" ] || echo "${DESTDIR}/${file}" |
1611 |
< |
.endfor |
1609 |
> |
@${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1610 |
> |
-V OLD_LIBS | xargs -n1 | \ |
1611 |
> |
while read file; do \ |
1612 |
> |
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ |
1613 |
> |
echo "${DESTDIR}/$${file}"; \ |
1614 |
> |
fi; \ |
1615 |
> |
done |
1616 |
|
|
1617 |
|
delete-old-dirs: |
1618 |
|
@echo ">>> Removing old directories" |
1619 |
< |
.for dir in ${OLD_DIRS} |
1620 |
< |
# Don't fail if an old directory isn't empty. |
1621 |
< |
@[ ! -d "${DESTDIR}/${dir}" ] || (rmdir -v "${DESTDIR}/${dir}" || true) |
1622 |
< |
.endfor |
1619 |
> |
@${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1620 |
> |
-V OLD_DIRS | xargs -n1 | \ |
1621 |
> |
while read dir; do \ |
1622 |
> |
if [ -d "${DESTDIR}/$${dir}" ]; then \ |
1623 |
> |
rmdir -v "${DESTDIR}/$${dir}" || true; \ |
1624 |
> |
elif [ -L "${DESTDIR}/$${dir}" ]; then \ |
1625 |
> |
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ |
1626 |
> |
fi; \ |
1627 |
> |
done |
1628 |
|
@echo ">>> Old directories removed" |
1629 |
|
|
1630 |
|
check-old-dirs: |
1631 |
|
@echo ">>> Checking for old directories" |
1632 |
< |
.for dir in ${OLD_DIRS} |
1633 |
< |
@[ ! -d "${DESTDIR}/${dir}" ] || echo "${DESTDIR}/${dir}" |
1634 |
< |
.endfor |
1632 |
> |
@${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1633 |
> |
-V OLD_DIRS | xargs -n1 | \ |
1634 |
> |
while read dir; do \ |
1635 |
> |
if [ -d "${DESTDIR}/$${dir}" ]; then \ |
1636 |
> |
echo "${DESTDIR}/$${dir}"; \ |
1637 |
> |
elif [ -L "${DESTDIR}/$${dir}" ]; then \ |
1638 |
> |
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ |
1639 |
> |
fi; \ |
1640 |
> |
done |
1641 |
|
|
1642 |
|
delete-old: delete-old-files delete-old-dirs |
1643 |
|
@echo "To remove old libraries run '${MAKE} delete-old-libs'." |
1648 |
|
|
1649 |
|
.endif |
1650 |
|
|
1651 |
+ |
# |
1652 |
+ |
# showconfig - show build configuration. |
1653 |
+ |
# |
1654 |
+ |
showconfig: |
1655 |
+ |
@${MAKE} -n -f bsd.own.mk -V dummy -dg1 | grep ^MK_ | sort |
1656 |
+ |
|
1657 |
+ |
.if !empty(KRNLOBJDIR) && !empty(KERNCONF) |
1658 |
+ |
DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/ |
1659 |
+ |
|
1660 |
+ |
.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE) |
1661 |
+ |
.if exists(${KERNCONFDIR}/${KERNCONF}) |
1662 |
+ |
FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \ |
1663 |
+ |
${KERNCONFDIR}/${KERNCONF} ; echo |
1664 |
+ |
.endif |
1665 |
+ |
.endif |
1666 |
+ |
|
1667 |
+ |
.endif |
1668 |
+ |
|
1669 |
+ |
.if !defined(DTBOUTPUTPATH) || !exists(${DTBOUTPUTPATH}) |
1670 |
+ |
DTBOUTPUTPATH= ${.CURDIR} |
1671 |
+ |
.endif |
1672 |
+ |
|
1673 |
+ |
# |
1674 |
+ |
# Build 'standalone' Device Tree Blob |
1675 |
+ |
# |
1676 |
+ |
builddtb: |
1677 |
+ |
@if [ "${FDT_DTS_FILE}" = "" ]; then \ |
1678 |
+ |
echo "ERROR: FDT_DTS_FILE must be specified!"; \ |
1679 |
+ |
exit 1; \ |
1680 |
+ |
fi; \ |
1681 |
+ |
if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} ]; then \ |
1682 |
+ |
echo "ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \ |
1683 |
+ |
exist!"; \ |
1684 |
+ |
exit 1; \ |
1685 |
+ |
fi; \ |
1686 |
+ |
if [ "${DTBOUTPUTPATH}" = "${.CURDIR}" ]; then \ |
1687 |
+ |
echo "WARNING: DTB will be placed in the current working \ |
1688 |
+ |
directory"; \ |
1689 |
+ |
fi |
1690 |
+ |
@PATH=${TMPPATH} \ |
1691 |
+ |
dtc -O dtb -o \ |
1692 |
+ |
${DTBOUTPUTPATH}/`echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 \ |
1693 |
+ |
-p 1024 ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} |
1694 |
+ |
|
1695 |
+ |
############### |
1696 |
+ |
|
1697 |
+ |
.if defined(XDEV) && defined(XDEV_ARCH) |
1698 |
+ |
|
1699 |
+ |
.if ${XDEV} == ${MACHINE} && ${XDEV_ARCH} == ${MACHINE_ARCH} |
1700 |
+ |
XDEV_CPUTYPE?=${CPUTYPE} |
1701 |
+ |
.else |
1702 |
+ |
XDEV_CPUTYPE?=${TARGET_CPUTYPE} |
1703 |
+ |
.endif |
1704 |
+ |
|
1705 |
+ |
NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \ |
1706 |
+ |
-DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE \ |
1707 |
+ |
-DWITHOUT_KERBEROS -DWITHOUT_RESCUE -DNO_WARNS \ |
1708 |
+ |
TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ |
1709 |
+ |
CPUTYPE=${XDEV_CPUTYPE} |
1710 |
+ |
|
1711 |
+ |
XDDIR=${XDEV_ARCH}-midnightbsd |
1712 |
+ |
XDTP=/usr/${XDDIR} |
1713 |
+ |
CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \ |
1714 |
+ |
INSTALL="sh ${.CURDIR}/tools/install.sh" |
1715 |
+ |
CDENV= ${CDBENV} \ |
1716 |
+ |
_SHLIBDIRPREFIX=${XDTP} \ |
1717 |
+ |
TOOLS_PREFIX=${XDTP} |
1718 |
+ |
CD2ENV=${CDENV} \ |
1719 |
+ |
MACHINE=${XDEV} MACHINE_ARCH=${XDEV_ARCH} |
1720 |
+ |
|
1721 |
+ |
CDTMP= ${MAKEOBJDIRPREFIX}/${XDEV}/${.CURDIR}/tmp |
1722 |
+ |
CDMAKE=${CDENV} ${MAKE} ${NOFUN} |
1723 |
+ |
CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDTP}/usr/bin:${PATH} ${MAKE} ${NOFUN} |
1724 |
+ |
XDDESTDIR=${DESTDIR}${XDTP} |
1725 |
+ |
.if !defined(OSREL) |
1726 |
+ |
OSREL!= uname -r | sed -e 's/[-(].*//' |
1727 |
+ |
.endif |
1728 |
+ |
|
1729 |
+ |
.ORDER: xdev-build xdev-install |
1730 |
+ |
xdev: xdev-build xdev-install |
1731 |
+ |
|
1732 |
+ |
.ORDER: _xb-build-tools _xb-cross-tools |
1733 |
+ |
xdev-build: _xb-build-tools _xb-cross-tools |
1734 |
+ |
|
1735 |
+ |
_xb-build-tools: |
1736 |
+ |
${_+_}@cd ${.CURDIR}; \ |
1737 |
+ |
${CDBENV} ${MAKE} -f Makefile.inc1 ${NOFUN} build-tools |
1738 |
+ |
|
1739 |
+ |
_xb-cross-tools: |
1740 |
+ |
.for _tool in \ |
1741 |
+ |
gnu/usr.bin/binutils \ |
1742 |
+ |
gnu/usr.bin/cc \ |
1743 |
+ |
usr.bin/ar |
1744 |
+ |
${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ |
1745 |
+ |
cd ${.CURDIR}/${_tool}; \ |
1746 |
+ |
${CDMAKE} DIRPRFX=${_tool}/ obj; \ |
1747 |
+ |
${CDMAKE} DIRPRFX=${_tool}/ depend; \ |
1748 |
+ |
${CDMAKE} DIRPRFX=${_tool}/ all |
1749 |
+ |
.endfor |
1750 |
+ |
|
1751 |
+ |
_xi-mtree: |
1752 |
+ |
${_+_}@${ECHODIR} "mtree populating ${XDDESTDIR}" |
1753 |
+ |
mkdir -p ${XDDESTDIR} |
1754 |
+ |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \ |
1755 |
+ |
-p ${XDDESTDIR} >/dev/null |
1756 |
+ |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ |
1757 |
+ |
-p ${XDDESTDIR}/usr >/dev/null |
1758 |
+ |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ |
1759 |
+ |
-p ${XDDESTDIR}/usr/include >/dev/null |
1760 |
+ |
|
1761 |
+ |
.ORDER: _xi-mtree _xi-cross-tools _xi-includes _xi-libraries _xi-links |
1762 |
+ |
xdev-install: _xi-mtree _xi-cross-tools _xi-includes _xi-libraries _xi-links |
1763 |
+ |
|
1764 |
+ |
_xi-cross-tools: |
1765 |
+ |
@echo "_xi-cross-tools" |
1766 |
+ |
.for _tool in \ |
1767 |
+ |
gnu/usr.bin/binutils \ |
1768 |
+ |
gnu/usr.bin/cc \ |
1769 |
+ |
usr.bin/ar |
1770 |
+ |
${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \ |
1771 |
+ |
cd ${.CURDIR}/${_tool}; \ |
1772 |
+ |
${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR} |
1773 |
+ |
.endfor |
1774 |
+ |
|
1775 |
+ |
_xi-includes: |
1776 |
+ |
${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 par-includes \ |
1777 |
+ |
DESTDIR=${XDDESTDIR} |
1778 |
+ |
|
1779 |
+ |
_xi-libraries: |
1780 |
+ |
${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 libraries \ |
1781 |
+ |
DESTDIR=${XDDESTDIR} |
1782 |
+ |
|
1783 |
+ |
_xi-links: |
1784 |
+ |
${_+_}cd ${XDDESTDIR}/usr/bin; \ |
1785 |
+ |
for i in *; do \ |
1786 |
+ |
ln -sf ../../${XDTP}/usr/bin/$$i \ |
1787 |
+ |
../../../../usr/bin/${XDDIR}-$$i; \ |
1788 |
+ |
ln -sf ../../${XDTP}/usr/bin/$$i \ |
1789 |
+ |
../../../../usr/bin/${XDDIR}${OSREL}-$$i; \ |
1790 |
+ |
done |
1791 |
+ |
.endif |