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