1 |
laffer1 |
2 |
# |
2 |
laffer1 |
6517 |
# $MidnightBSD$ |
3 |
laffer1 |
2 |
# |
4 |
|
|
# Make command line options: |
5 |
|
|
# -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir |
6 |
|
|
# -DNO_CLEAN do not clean at all |
7 |
|
|
# -DNO_SHARE do not go into share subdir |
8 |
laffer1 |
5123 |
# -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ} |
9 |
laffer1 |
2 |
# -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 |
laffer1 |
5123 |
# -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel |
13 |
laffer1 |
2 |
# -DNO_PORTSUPDATE do not update ports in ${MAKE} update |
14 |
|
|
# -DNO_DOCUPDATE do not update doc in ${MAKE} update |
15 |
laffer1 |
5123 |
# -DNO_CTF do not run the DTrace CTF conversion tools on built objects |
16 |
laffer1 |
2 |
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list |
17 |
laffer1 |
1926 |
# TARGET="machine" to crossbuild world for a different machine type |
18 |
laffer1 |
5123 |
# TARGET_ARCH= may be required when a TARGET supports multiple endians |
19 |
laffer1 |
2 |
|
20 |
|
|
# |
21 |
|
|
# The intended user-driven targets are: |
22 |
|
|
# buildworld - rebuild *everything*, including glue to help do upgrades |
23 |
|
|
# installworld- install everything built by "buildworld" |
24 |
laffer1 |
1926 |
# doxygen - build API documentation of the kernel |
25 |
laffer1 |
2 |
# update - convenient way to update your source tree (eg: cvsup/cvs) |
26 |
|
|
# |
27 |
|
|
# Standard targets (not defined here) are documented in the makefiles in |
28 |
|
|
# /usr/share/mk. These include: |
29 |
|
|
# obj depend all install clean cleandepend cleanobj |
30 |
|
|
|
31 |
laffer1 |
4290 |
# You are supposed to define both of these when calling Makefile.inc1 |
32 |
|
|
# directly. However, some old scripts don't. Cope for the moment, but |
33 |
|
|
# issue a new warning for a transition period. |
34 |
|
|
.if defined(TARGET) && !defined(TARGET_ARCH) |
35 |
|
|
.warning "You must pass both TARGET and TARGET_ARCH to Makefile.inc1. Setting TARGET_ARCH=${TARGET}." |
36 |
|
|
TARGET_ARCH=${TARGET} |
37 |
|
|
.endif |
38 |
|
|
.if !defined(TARGET) || !defined(TARGET_ARCH) |
39 |
|
|
.error "Both TARGET and TARGET_ARCH must be defined." |
40 |
|
|
.endif |
41 |
|
|
|
42 |
laffer1 |
1926 |
.include <bsd.own.mk> |
43 |
laffer1 |
4694 |
.include <bsd.arch.inc.mk> |
44 |
laffer1 |
7055 |
.include <bsd.compiler.mk> |
45 |
laffer1 |
1926 |
|
46 |
laffer1 |
2 |
# We must do share/info early so that installation of info `dir' |
47 |
|
|
# entries works correctly. Do it first since it is less likely to |
48 |
|
|
# grow dependencies on include and lib than vice versa. |
49 |
|
|
# |
50 |
laffer1 |
1926 |
# We must do lib/ and libexec/ before bin/, because if installworld |
51 |
laffer1 |
2 |
# installs a new /bin/sh, the 'make' command will *immediately* |
52 |
|
|
# use that new version. And the new (dynamically-linked) /bin/sh |
53 |
|
|
# will expect to find appropriate libraries in /lib and /libexec. |
54 |
|
|
# |
55 |
laffer1 |
1926 |
SUBDIR= share/info lib libexec |
56 |
|
|
SUBDIR+=bin |
57 |
laffer1 |
3446 |
.if ${MK_APACHE} != "no" |
58 |
|
|
SUBDIR+=apache |
59 |
|
|
.endif |
60 |
laffer1 |
1926 |
.if ${MK_GAMES} != "no" |
61 |
laffer1 |
2 |
SUBDIR+=games |
62 |
|
|
.endif |
63 |
laffer1 |
1926 |
.if ${MK_CDDL} != "no" |
64 |
|
|
SUBDIR+=cddl |
65 |
laffer1 |
5123 |
.else |
66 |
|
|
NO_CTF=1 |
67 |
laffer1 |
1926 |
.endif |
68 |
|
|
SUBDIR+=gnu include |
69 |
|
|
.if ${MK_KERBEROS} != "no" |
70 |
laffer1 |
2 |
SUBDIR+=kerberos5 |
71 |
|
|
.endif |
72 |
laffer1 |
1926 |
.if ${MK_RESCUE} != "no" |
73 |
laffer1 |
2 |
SUBDIR+=rescue |
74 |
|
|
.endif |
75 |
|
|
SUBDIR+=sbin |
76 |
laffer1 |
1926 |
.if ${MK_CRYPT} != "no" |
77 |
laffer1 |
2 |
SUBDIR+=secure |
78 |
|
|
.endif |
79 |
|
|
.if !defined(NO_SHARE) |
80 |
|
|
SUBDIR+=share |
81 |
|
|
.endif |
82 |
laffer1 |
1926 |
SUBDIR+=sys usr.bin usr.sbin |
83 |
laffer1 |
5123 |
.if ${MK_OFED} != "no" |
84 |
|
|
SUBDIR+=contrib/ofed |
85 |
|
|
.endif |
86 |
laffer1 |
1926 |
# |
87 |
|
|
# We must do etc/ last for install/distribute to work. |
88 |
|
|
# |
89 |
|
|
SUBDIR+=etc |
90 |
laffer1 |
2 |
|
91 |
|
|
# These are last, since it is nice to at least get the base system |
92 |
|
|
# rebuilt before you do them. |
93 |
|
|
.for _DIR in ${LOCAL_DIRS} |
94 |
|
|
.if exists(${.CURDIR}/${_DIR}/Makefile) |
95 |
|
|
SUBDIR+= ${_DIR} |
96 |
|
|
.endif |
97 |
|
|
.endfor |
98 |
|
|
|
99 |
|
|
.if defined(SUBDIR_OVERRIDE) |
100 |
|
|
SUBDIR= ${SUBDIR_OVERRIDE} |
101 |
|
|
.endif |
102 |
|
|
|
103 |
|
|
.if defined(NOCLEAN) |
104 |
|
|
NO_CLEAN= ${NOCLEAN} |
105 |
|
|
.endif |
106 |
|
|
.if defined(NO_CLEANDIR) |
107 |
|
|
CLEANDIR= clean cleandepend |
108 |
|
|
.else |
109 |
|
|
CLEANDIR= cleandir |
110 |
|
|
.endif |
111 |
|
|
|
112 |
laffer1 |
7138 |
SVN?= /usr/local/bin/svn |
113 |
|
|
SVNFLAGS?= -r HEAD |
114 |
laffer1 |
2 |
|
115 |
|
|
MAKEOBJDIRPREFIX?= /usr/obj |
116 |
|
|
.if !defined(OSRELDATE) |
117 |
|
|
.if exists(/usr/include/osreldate.h) |
118 |
laffer1 |
2741 |
OSRELDATE!= awk '/^\#define[[:space:]]*__MidnightBSD_version/ { print $$3 }' \ |
119 |
laffer1 |
2 |
/usr/include/osreldate.h |
120 |
|
|
.else |
121 |
|
|
OSRELDATE= 0 |
122 |
|
|
.endif |
123 |
|
|
.endif |
124 |
laffer1 |
1926 |
|
125 |
laffer1 |
4694 |
.if !defined(VERSION) |
126 |
|
|
VERSION!= uname -srp |
127 |
|
|
VERSION+= ${OSRELDATE} |
128 |
laffer1 |
1926 |
.endif |
129 |
|
|
|
130 |
laffer1 |
4694 |
|
131 |
laffer1 |
6468 |
KNOWN_ARCHES?= amd64 i386 |
132 |
laffer1 |
1926 |
.if ${TARGET} == ${TARGET_ARCH} |
133 |
|
|
_t= ${TARGET} |
134 |
|
|
.else |
135 |
|
|
_t= ${TARGET_ARCH}/${TARGET} |
136 |
|
|
.endif |
137 |
|
|
.for _t in ${_t} |
138 |
|
|
.if empty(KNOWN_ARCHES:M${_t}) |
139 |
|
|
.error Unknown target ${TARGET_ARCH}:${TARGET}. |
140 |
|
|
.endif |
141 |
|
|
.endfor |
142 |
|
|
|
143 |
|
|
.if ${TARGET} == ${MACHINE} |
144 |
laffer1 |
2 |
TARGET_CPUTYPE?=${CPUTYPE} |
145 |
|
|
.else |
146 |
|
|
TARGET_CPUTYPE?= |
147 |
|
|
.endif |
148 |
laffer1 |
1926 |
|
149 |
laffer1 |
2 |
.if !empty(TARGET_CPUTYPE) |
150 |
|
|
_TARGET_CPUTYPE=${TARGET_CPUTYPE} |
151 |
|
|
.else |
152 |
|
|
_TARGET_CPUTYPE=dummy |
153 |
|
|
.endif |
154 |
|
|
_CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} \ |
155 |
|
|
-f /dev/null -m ${.CURDIR}/share/mk -V CPUTYPE |
156 |
|
|
.if ${_CPUTYPE} != ${_TARGET_CPUTYPE} |
157 |
|
|
.error CPUTYPE global should be set with ?=. |
158 |
|
|
.endif |
159 |
|
|
.if make(buildworld) |
160 |
laffer1 |
1926 |
BUILD_ARCH!= uname -p |
161 |
laffer1 |
2 |
.if ${MACHINE_ARCH} != ${BUILD_ARCH} |
162 |
|
|
.error To cross-build, set TARGET_ARCH. |
163 |
|
|
.endif |
164 |
|
|
.endif |
165 |
laffer1 |
3495 |
.if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING) |
166 |
laffer1 |
2 |
OBJTREE= ${MAKEOBJDIRPREFIX} |
167 |
|
|
.else |
168 |
laffer1 |
3495 |
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH} |
169 |
laffer1 |
2 |
.endif |
170 |
|
|
WORLDTMP= ${OBJTREE}${.CURDIR}/tmp |
171 |
|
|
# /usr/games added for fortune which depend on strfile |
172 |
|
|
BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games |
173 |
|
|
XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games |
174 |
|
|
STRICTTMPPATH= ${BPATH}:${XPATH} |
175 |
|
|
TMPPATH= ${STRICTTMPPATH}:${PATH} |
176 |
|
|
|
177 |
laffer1 |
4290 |
# |
178 |
|
|
# Avoid running mktemp(1) unless actually needed. |
179 |
|
|
# It may not be functional, e.g., due to new ABI |
180 |
|
|
# when in the middle of installing over this system. |
181 |
|
|
# |
182 |
|
|
.if make(distributeworld) || make(installworld) |
183 |
laffer1 |
2 |
INSTALLTMP!= /usr/bin/mktemp -d -u -t install |
184 |
laffer1 |
4290 |
.endif |
185 |
laffer1 |
2 |
|
186 |
|
|
# |
187 |
|
|
# Building a world goes through the following stages |
188 |
|
|
# |
189 |
|
|
# 1. legacy stage [BMAKE] |
190 |
|
|
# This stage is responsible for creating compatibility |
191 |
|
|
# shims that are needed by the bootstrap-tools, |
192 |
|
|
# build-tools and cross-tools stages. |
193 |
|
|
# 1. bootstrap-tools stage [BMAKE] |
194 |
|
|
# This stage is responsible for creating programs that |
195 |
|
|
# are needed for backward compatibility reasons. They |
196 |
|
|
# are not built as cross-tools. |
197 |
|
|
# 2. build-tools stage [TMAKE] |
198 |
|
|
# This stage is responsible for creating the object |
199 |
|
|
# tree and building any tools that are needed during |
200 |
|
|
# the build process. |
201 |
|
|
# 3. cross-tools stage [XMAKE] |
202 |
|
|
# This stage is responsible for creating any tools that |
203 |
|
|
# are needed for cross-builds. A cross-compiler is one |
204 |
|
|
# of them. |
205 |
|
|
# 4. world stage [WMAKE] |
206 |
|
|
# This stage actually builds the world. |
207 |
|
|
# 5. install stage (optional) [IMAKE] |
208 |
|
|
# This stage installs a previously built world. |
209 |
|
|
# |
210 |
|
|
|
211 |
|
|
BOOTSTRAPPING?= 0 |
212 |
|
|
|
213 |
|
|
# Common environment for world related stages |
214 |
|
|
CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \ |
215 |
laffer1 |
7545 |
MACHINE_INCLUDES="${WORLDTMP}/include" \ |
216 |
laffer1 |
2 |
MACHINE_ARCH=${TARGET_ARCH} \ |
217 |
|
|
MACHINE=${TARGET} \ |
218 |
laffer1 |
5123 |
CPUTYPE=${TARGET_CPUTYPE} |
219 |
|
|
.if ${OSRELDATE} < 4015 |
220 |
|
|
CROSSENV+= AR=gnu-ar RANLIB=gnu-ranlib |
221 |
|
|
.endif |
222 |
|
|
.if ${MK_GROFF} != "no" |
223 |
|
|
CROSSENV+= GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \ |
224 |
laffer1 |
2 |
GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \ |
225 |
|
|
GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac |
226 |
laffer1 |
5123 |
.endif |
227 |
laffer1 |
2 |
|
228 |
|
|
# bootstrap-tools stage |
229 |
|
|
BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ |
230 |
laffer1 |
7545 |
MACHINE_INCLUDES="${WORLDTMP}/include" \ |
231 |
laffer1 |
2 |
PATH=${BPATH}:${PATH} \ |
232 |
|
|
WORLDTMP=${WORLDTMP} \ |
233 |
laffer1 |
4694 |
VERSION="${VERSION}" \ |
234 |
laffer1 |
7055 |
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ |
235 |
|
|
COMPILER_TYPE=${COMPILER_TYPE} |
236 |
laffer1 |
2 |
BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ |
237 |
|
|
${BMAKEENV} ${MAKE} -f Makefile.inc1 \ |
238 |
|
|
DESTDIR= \ |
239 |
|
|
BOOTSTRAPPING=${OSRELDATE} \ |
240 |
laffer1 |
5123 |
SSP_CFLAGS= \ |
241 |
laffer1 |
1926 |
-DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \ |
242 |
laffer1 |
5123 |
-DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \ |
243 |
|
|
-DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD |
244 |
laffer1 |
2 |
|
245 |
|
|
# build-tools stage |
246 |
|
|
TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ |
247 |
|
|
${BMAKEENV} ${MAKE} -f Makefile.inc1 \ |
248 |
laffer1 |
1926 |
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ |
249 |
laffer1 |
2 |
DESTDIR= \ |
250 |
laffer1 |
5123 |
BOOTSTRAPPING=${OSRELDATE} \ |
251 |
|
|
SSP_CFLAGS= \ |
252 |
|
|
-DNO_LINT \ |
253 |
|
|
-DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD |
254 |
laffer1 |
2 |
|
255 |
|
|
# cross-tools stage |
256 |
laffer1 |
1926 |
XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ |
257 |
|
|
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ |
258 |
|
|
-DWITHOUT_GDB |
259 |
laffer1 |
2 |
|
260 |
|
|
# world stage |
261 |
|
|
WMAKEENV= ${CROSSENV} \ |
262 |
|
|
_SHLIBDIRPREFIX=${WORLDTMP} \ |
263 |
laffer1 |
5123 |
_LDSCRIPTROOT= \ |
264 |
laffer1 |
7545 |
MACHINE_INCLUDES="${WORLDTMP}/include" \ |
265 |
laffer1 |
4694 |
VERSION="${VERSION}" \ |
266 |
laffer1 |
2 |
INSTALL="sh ${.CURDIR}/tools/install.sh" \ |
267 |
|
|
PATH=${TMPPATH} |
268 |
laffer1 |
5123 |
.if ${MK_CDDL} == "no" |
269 |
|
|
WMAKEENV+= NO_CTF=1 |
270 |
|
|
.endif |
271 |
laffer1 |
7055 |
.if ${CC:T:Mgcc} == "gcc" |
272 |
|
|
WMAKE_COMPILER_TYPE= gcc |
273 |
|
|
.elif ${CC:T:Mclang} == "clang" |
274 |
|
|
WMAKE_COMPILER_TYPE= clang |
275 |
|
|
.elif ${MK_CLANG_IS_CC} == "no" |
276 |
|
|
WMAKE_COMPILER_TYPE= gcc |
277 |
|
|
.else |
278 |
|
|
WMAKE_COMPILER_TYPE= clang |
279 |
|
|
.endif |
280 |
|
|
WMAKEENV+= COMPILER_TYPE=${WMAKE_COMPILER_TYPE} |
281 |
laffer1 |
2 |
WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP} |
282 |
|
|
|
283 |
|
|
.if ${TARGET_ARCH} == "amd64" |
284 |
|
|
# 32 bit world |
285 |
|
|
LIB32TMP= ${OBJTREE}${.CURDIR}/lib32 |
286 |
|
|
|
287 |
laffer1 |
5123 |
.if ${TARGET_ARCH} == "amd64" |
288 |
laffer1 |
1926 |
.if empty(TARGET_CPUTYPE) |
289 |
laffer1 |
5123 |
LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2 |
290 |
laffer1 |
1926 |
.else |
291 |
laffer1 |
5123 |
LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} |
292 |
laffer1 |
1926 |
.endif |
293 |
laffer1 |
5123 |
LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \ |
294 |
|
|
MACHINE_CPU="i686 mmx sse sse2" \ |
295 |
|
|
LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \ |
296 |
|
|
AS="${AS} --32" |
297 |
|
|
.endif |
298 |
|
|
|
299 |
|
|
|
300 |
|
|
LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -DCOMPAT_32BIT \ |
301 |
|
|
-isystem ${LIB32TMP}/usr/include/ \ |
302 |
laffer1 |
2 |
-L${LIB32TMP}/usr/lib32 \ |
303 |
|
|
-B${LIB32TMP}/usr/lib32 |
304 |
|
|
|
305 |
|
|
# Yes, the flags are redundant. |
306 |
laffer1 |
4694 |
LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \ |
307 |
laffer1 |
2 |
_SHLIBDIRPREFIX=${LIB32TMP} \ |
308 |
laffer1 |
5123 |
_LDSCRIPTROOT=${LIB32TMP} \ |
309 |
|
|
VERSION="${VERSION}" \ |
310 |
laffer1 |
2 |
INSTALL="sh ${.CURDIR}/tools/install.sh" \ |
311 |
|
|
PATH=${TMPPATH} \ |
312 |
laffer1 |
1926 |
CC="${CC} ${LIB32FLAGS}" \ |
313 |
|
|
CXX="${CXX} ${LIB32FLAGS}" \ |
314 |
laffer1 |
2 |
LIBDIR=/usr/lib32 \ |
315 |
laffer1 |
7055 |
SHLIBDIR=/usr/lib32 \ |
316 |
laffer1 |
7545 |
LIBPRIVATEDIR=/usr/lib32/private \ |
317 |
|
|
MACHINE_INCLUDES="${WORLDTMP}/include" \ |
318 |
laffer1 |
7055 |
COMPILER_TYPE=${WMAKE_COMPILER_TYPE} |
319 |
laffer1 |
2 |
|
320 |
laffer1 |
1926 |
LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \ |
321 |
laffer1 |
5123 |
-DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO \ |
322 |
|
|
-DWITHOUT_HTML -DNO_CTF -DNO_LINT -ECC -ECXX -EAS -ELD \ |
323 |
|
|
DESTDIR=${LIB32TMP} |
324 |
|
|
LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS |
325 |
laffer1 |
2 |
.endif |
326 |
|
|
|
327 |
|
|
# install stage |
328 |
laffer1 |
5123 |
IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*} |
329 |
laffer1 |
4290 |
IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 |
330 |
laffer1 |
2 |
.if empty(.MAKEFLAGS:M-n) |
331 |
laffer1 |
4290 |
IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \ |
332 |
|
|
LD_LIBRARY_PATH=${INSTALLTMP} \ |
333 |
|
|
PATH_LOCALE=${INSTALLTMP}/locale |
334 |
|
|
IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh |
335 |
laffer1 |
2 |
.else |
336 |
laffer1 |
4290 |
IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP} |
337 |
laffer1 |
2 |
.endif |
338 |
|
|
|
339 |
|
|
# kernel stage |
340 |
|
|
KMAKEENV= ${WMAKEENV} |
341 |
laffer1 |
1926 |
KMAKE= ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} |
342 |
laffer1 |
2 |
|
343 |
|
|
# |
344 |
|
|
# buildworld |
345 |
|
|
# |
346 |
|
|
# Attempt to rebuild the entire system, with reasonable chance of |
347 |
|
|
# success, regardless of how old your existing system is. |
348 |
|
|
# |
349 |
|
|
_worldtmp: |
350 |
|
|
.if ${.CURDIR:C/[^,]//g} != "" |
351 |
|
|
# The m4 build of sendmail files doesn't like it if ',' is used |
352 |
|
|
# anywhere in the path of it's files. |
353 |
|
|
@echo |
354 |
|
|
@echo "*** Error: path to source tree contains a comma ','" |
355 |
|
|
@echo |
356 |
|
|
false |
357 |
|
|
.endif |
358 |
|
|
@echo |
359 |
|
|
@echo "--------------------------------------------------------------" |
360 |
|
|
@echo ">>> Rebuilding the temporary build tree" |
361 |
|
|
@echo "--------------------------------------------------------------" |
362 |
|
|
.if !defined(NO_CLEAN) |
363 |
|
|
rm -rf ${WORLDTMP} |
364 |
laffer1 |
5123 |
.if defined(LIB32TMP) |
365 |
laffer1 |
2 |
rm -rf ${LIB32TMP} |
366 |
|
|
.endif |
367 |
|
|
.else |
368 |
|
|
rm -rf ${WORLDTMP}/legacy/usr/include |
369 |
laffer1 |
5123 |
# XXX - These three can depend on any header file. |
370 |
laffer1 |
2 |
rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c |
371 |
laffer1 |
4290 |
rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c |
372 |
laffer1 |
2 |
rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c |
373 |
|
|
.endif |
374 |
|
|
.for _dir in \ |
375 |
laffer1 |
7150 |
lib usr legacy/usr legacy/usr/bin legacy/usr/sbin |
376 |
laffer1 |
2 |
mkdir -p ${WORLDTMP}/${_dir} |
377 |
|
|
.endfor |
378 |
laffer1 |
4290 |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ |
379 |
|
|
-p ${WORLDTMP}/legacy/usr >/dev/null |
380 |
laffer1 |
5123 |
.if ${MK_GROFF} != "no" |
381 |
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.groff.dist \ |
382 |
|
|
-p ${WORLDTMP}/legacy/usr >/dev/null |
383 |
|
|
.endif |
384 |
laffer1 |
4290 |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ |
385 |
|
|
-p ${WORLDTMP}/usr >/dev/null |
386 |
laffer1 |
2 |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ |
387 |
|
|
-p ${WORLDTMP}/usr/include >/dev/null |
388 |
|
|
ln -sf ${.CURDIR}/sys ${WORLDTMP} |
389 |
laffer1 |
1926 |
.if ${MK_BIND_LIBS} != "no" |
390 |
laffer1 |
2 |
mtree -deU -f ${.CURDIR}/etc/mtree/BIND.include.dist \ |
391 |
|
|
-p ${WORLDTMP}/usr/include >/dev/null |
392 |
|
|
.endif |
393 |
|
|
_legacy: |
394 |
|
|
@echo |
395 |
|
|
@echo "--------------------------------------------------------------" |
396 |
|
|
@echo ">>> stage 1.1: legacy release compatibility shims" |
397 |
|
|
@echo "--------------------------------------------------------------" |
398 |
|
|
${_+_}cd ${.CURDIR}; ${BMAKE} legacy |
399 |
|
|
_bootstrap-tools: |
400 |
|
|
@echo |
401 |
|
|
@echo "--------------------------------------------------------------" |
402 |
|
|
@echo ">>> stage 1.2: bootstrap tools" |
403 |
|
|
@echo "--------------------------------------------------------------" |
404 |
|
|
${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools |
405 |
|
|
_cleanobj: |
406 |
|
|
.if !defined(NO_CLEAN) |
407 |
|
|
@echo |
408 |
|
|
@echo "--------------------------------------------------------------" |
409 |
|
|
@echo ">>> stage 2.1: cleaning up the object tree" |
410 |
|
|
@echo "--------------------------------------------------------------" |
411 |
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/} |
412 |
laffer1 |
5123 |
.if defined(LIB32TMP) |
413 |
laffer1 |
1926 |
${_+_}cd ${.CURDIR}; ${LIB32WMAKE} -f Makefile.inc1 ${CLEANDIR:S/^/par-/} |
414 |
laffer1 |
2 |
.endif |
415 |
|
|
.endif |
416 |
|
|
_obj: |
417 |
|
|
@echo |
418 |
|
|
@echo "--------------------------------------------------------------" |
419 |
|
|
@echo ">>> stage 2.2: rebuilding the object tree" |
420 |
|
|
@echo "--------------------------------------------------------------" |
421 |
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} par-obj |
422 |
|
|
_build-tools: |
423 |
|
|
@echo |
424 |
|
|
@echo "--------------------------------------------------------------" |
425 |
|
|
@echo ">>> stage 2.3: build tools" |
426 |
|
|
@echo "--------------------------------------------------------------" |
427 |
|
|
${_+_}cd ${.CURDIR}; ${TMAKE} build-tools |
428 |
|
|
_cross-tools: |
429 |
|
|
@echo |
430 |
|
|
@echo "--------------------------------------------------------------" |
431 |
|
|
@echo ">>> stage 3: cross tools" |
432 |
|
|
@echo "--------------------------------------------------------------" |
433 |
|
|
${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools |
434 |
|
|
_includes: |
435 |
|
|
@echo |
436 |
|
|
@echo "--------------------------------------------------------------" |
437 |
|
|
@echo ">>> stage 4.1: building includes" |
438 |
|
|
@echo "--------------------------------------------------------------" |
439 |
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes |
440 |
|
|
_libraries: |
441 |
|
|
@echo |
442 |
|
|
@echo "--------------------------------------------------------------" |
443 |
|
|
@echo ">>> stage 4.2: building libraries" |
444 |
|
|
@echo "--------------------------------------------------------------" |
445 |
|
|
${_+_}cd ${.CURDIR}; \ |
446 |
laffer1 |
1926 |
${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \ |
447 |
laffer1 |
5123 |
-DWITHOUT_MAN -DWITHOUT_PROFILE libraries |
448 |
laffer1 |
2 |
_depend: |
449 |
|
|
@echo |
450 |
|
|
@echo "--------------------------------------------------------------" |
451 |
|
|
@echo ">>> stage 4.3: make dependencies" |
452 |
|
|
@echo "--------------------------------------------------------------" |
453 |
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} par-depend |
454 |
|
|
everything: |
455 |
|
|
@echo |
456 |
|
|
@echo "--------------------------------------------------------------" |
457 |
|
|
@echo ">>> stage 4.4: building everything" |
458 |
|
|
@echo "--------------------------------------------------------------" |
459 |
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} par-all |
460 |
laffer1 |
5123 |
.if defined(LIB32TMP) |
461 |
laffer1 |
2 |
build32: |
462 |
|
|
@echo |
463 |
|
|
@echo "--------------------------------------------------------------" |
464 |
|
|
@echo ">>> stage 5.1: building 32 bit shim libraries" |
465 |
|
|
@echo "--------------------------------------------------------------" |
466 |
laffer1 |
4290 |
mkdir -p ${LIB32TMP}/usr/include |
467 |
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ |
468 |
|
|
-p ${LIB32TMP}/usr >/dev/null |
469 |
laffer1 |
2 |
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ |
470 |
|
|
-p ${LIB32TMP}/usr/include >/dev/null |
471 |
|
|
mkdir -p ${WORLDTMP} |
472 |
|
|
ln -sf ${.CURDIR}/sys ${WORLDTMP} |
473 |
|
|
.for _t in obj includes |
474 |
laffer1 |
4694 |
cd ${.CURDIR}/include; ${LIB32WMAKE} DIRPRFX=include/ ${_t} |
475 |
|
|
cd ${.CURDIR}/lib; ${LIB32WMAKE} DIRPRFX=lib/ ${_t} |
476 |
laffer1 |
3883 |
.if ${MK_APACHE} != "no" |
477 |
|
|
cd ${.CURDIR}/apache/lib; ${LIB32WMAKE} ${_t} |
478 |
|
|
.endif |
479 |
laffer1 |
1926 |
.if ${MK_CDDL} != "no" |
480 |
laffer1 |
4290 |
cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} DIRPRFX=cddl/lib/ ${_t} |
481 |
laffer1 |
2 |
.endif |
482 |
laffer1 |
4290 |
cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} DIRPRFX=gnu/lib/ ${_t} |
483 |
laffer1 |
1926 |
.if ${MK_CRYPT} != "no" |
484 |
laffer1 |
4290 |
cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} DIRPRFX=secure/lib/ ${_t} |
485 |
laffer1 |
2 |
.endif |
486 |
laffer1 |
1926 |
.if ${MK_KERBEROS} != "no" |
487 |
laffer1 |
4290 |
cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} DIRPRFX=kerberos5/lib ${_t} |
488 |
laffer1 |
1926 |
.endif |
489 |
laffer1 |
2 |
.endfor |
490 |
laffer1 |
1551 |
.for _dir in usr.bin/lex/lib |
491 |
laffer1 |
4290 |
cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} DIRPRFX=${_dir}/ obj |
492 |
laffer1 |
2 |
.endfor |
493 |
laffer1 |
1926 |
.for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic |
494 |
laffer1 |
2 |
cd ${.CURDIR}/${_dir}; \ |
495 |
laffer1 |
7150 |
WORLDTMP=${WORLDTMP} \ |
496 |
laffer1 |
4290 |
MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ |
497 |
laffer1 |
5123 |
DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \ |
498 |
|
|
-DEARLY_BUILD build-tools |
499 |
laffer1 |
2 |
.endfor |
500 |
|
|
cd ${.CURDIR}; \ |
501 |
laffer1 |
1926 |
${LIB32WMAKE} -f Makefile.inc1 libraries |
502 |
laffer1 |
2 |
.for _t in obj depend all |
503 |
laffer1 |
4290 |
cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \ |
504 |
|
|
DIRPRFX=libexec/rtld-elf/ ${_t} |
505 |
|
|
cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \ |
506 |
|
|
DIRPRFX=usr.bin/ldd ${_t} |
507 |
laffer1 |
2 |
.endfor |
508 |
|
|
|
509 |
|
|
distribute32 install32: |
510 |
|
|
cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} |
511 |
laffer1 |
4290 |
.if ${MK_CDDL} != "no" |
512 |
|
|
cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} |
513 |
|
|
.endif |
514 |
laffer1 |
2 |
cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} |
515 |
laffer1 |
1926 |
.if ${MK_CRYPT} != "no" |
516 |
laffer1 |
2 |
cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} |
517 |
|
|
.endif |
518 |
laffer1 |
4120 |
.if ${MK_KERBEROS} != "no" |
519 |
|
|
cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} |
520 |
|
|
.endif |
521 |
laffer1 |
4290 |
cd ${.CURDIR}/libexec/rtld-elf; \ |
522 |
|
|
PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//} |
523 |
laffer1 |
4120 |
cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//} |
524 |
laffer1 |
2 |
.endif |
525 |
|
|
|
526 |
|
|
WMAKE_TGTS= |
527 |
|
|
.if !defined(SUBDIR_OVERRIDE) |
528 |
|
|
WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools |
529 |
|
|
.endif |
530 |
|
|
WMAKE_TGTS+= _cleanobj _obj _build-tools |
531 |
|
|
.if !defined(SUBDIR_OVERRIDE) |
532 |
|
|
WMAKE_TGTS+= _cross-tools |
533 |
|
|
.endif |
534 |
|
|
WMAKE_TGTS+= _includes _libraries _depend everything |
535 |
laffer1 |
5123 |
.if defined(LIB32TMP) && ${MK_LIB32} != "no" |
536 |
laffer1 |
2 |
WMAKE_TGTS+= build32 |
537 |
|
|
.endif |
538 |
|
|
|
539 |
laffer1 |
1926 |
buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue |
540 |
|
|
.ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue |
541 |
laffer1 |
2 |
|
542 |
laffer1 |
1926 |
buildworld_prologue: |
543 |
|
|
@echo "--------------------------------------------------------------" |
544 |
|
|
@echo ">>> World build started on `LC_ALL=C date`" |
545 |
|
|
@echo "--------------------------------------------------------------" |
546 |
|
|
|
547 |
|
|
buildworld_epilogue: |
548 |
|
|
@echo |
549 |
|
|
@echo "--------------------------------------------------------------" |
550 |
|
|
@echo ">>> World build completed on `LC_ALL=C date`" |
551 |
|
|
@echo "--------------------------------------------------------------" |
552 |
|
|
|
553 |
|
|
# |
554 |
|
|
# We need to have this as a target because the indirection between Makefile |
555 |
|
|
# and Makefile.inc1 causes the correct PATH to be used, rather than a |
556 |
|
|
# modification of the current environment's PATH. In addition, we need |
557 |
|
|
# to quote multiword values. |
558 |
|
|
# |
559 |
|
|
buildenvvars: |
560 |
|
|
@echo ${WMAKEENV:Q} |
561 |
|
|
|
562 |
laffer1 |
2 |
buildenv: |
563 |
|
|
@echo Entering world for ${TARGET_ARCH}:${TARGET} |
564 |
laffer1 |
5123 |
@cd ${.CURDIR} && env ${WMAKEENV} sh || true |
565 |
laffer1 |
2 |
|
566 |
|
|
TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything:Nbuild32} |
567 |
|
|
toolchain: ${TOOLCHAIN_TGTS} |
568 |
|
|
kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries} |
569 |
|
|
|
570 |
|
|
# |
571 |
laffer1 |
1926 |
# installcheck |
572 |
laffer1 |
2 |
# |
573 |
laffer1 |
1926 |
# Checks to be sure system is ready for installworld/installkernel. |
574 |
|
|
# |
575 |
|
|
installcheck: |
576 |
laffer1 |
2 |
|
577 |
|
|
# |
578 |
|
|
# Require DESTDIR to be set if installing for a different architecture. |
579 |
|
|
# |
580 |
|
|
.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE} |
581 |
|
|
.if !make(distributeworld) |
582 |
laffer1 |
1926 |
installcheck: installcheck_DESTDIR |
583 |
laffer1 |
2 |
installcheck_DESTDIR: |
584 |
|
|
.if !defined(DESTDIR) || empty(DESTDIR) |
585 |
|
|
@echo "ERROR: Please set DESTDIR!"; \ |
586 |
|
|
false |
587 |
|
|
.endif |
588 |
|
|
.endif |
589 |
|
|
.endif |
590 |
|
|
|
591 |
|
|
# |
592 |
laffer1 |
1926 |
# Check for missing UIDs/GIDs. |
593 |
laffer1 |
2 |
# |
594 |
|
|
CHECK_UIDS= |
595 |
laffer1 |
1549 |
CHECK_GIDS= audit |
596 |
laffer1 |
1926 |
.if ${MK_SENDMAIL} != "no" |
597 |
laffer1 |
2 |
CHECK_UIDS+= smmsp |
598 |
|
|
CHECK_GIDS+= smmsp |
599 |
|
|
.endif |
600 |
laffer1 |
1926 |
.if ${MK_PF} != "no" |
601 |
laffer1 |
2 |
CHECK_UIDS+= proxy |
602 |
|
|
CHECK_GIDS+= proxy authpf |
603 |
|
|
.endif |
604 |
laffer1 |
1926 |
installcheck: installcheck_UGID |
605 |
|
|
installcheck_UGID: |
606 |
laffer1 |
2 |
.for uid in ${CHECK_UIDS} |
607 |
|
|
@if ! `id -u ${uid} >/dev/null 2>&1`; then \ |
608 |
|
|
echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \ |
609 |
|
|
false; \ |
610 |
|
|
fi |
611 |
|
|
.endfor |
612 |
|
|
.for gid in ${CHECK_GIDS} |
613 |
|
|
@if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \ |
614 |
|
|
echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \ |
615 |
|
|
false; \ |
616 |
|
|
fi |
617 |
|
|
.endfor |
618 |
|
|
|
619 |
|
|
# |
620 |
laffer1 |
4290 |
# Required install tools to be saved in a scratch dir for safety. |
621 |
|
|
# |
622 |
|
|
.if ${MK_INFO} != "no" |
623 |
|
|
_install-info= install-info |
624 |
|
|
.endif |
625 |
|
|
.if ${MK_ZONEINFO} != "no" |
626 |
|
|
_zoneinfo= zic tzsetup |
627 |
|
|
.endif |
628 |
|
|
|
629 |
|
|
ITOOLS= [ awk cap_mkdb cat chflags chmod chown \ |
630 |
|
|
date echo egrep find grep ${_install-info} \ |
631 |
|
|
ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \ |
632 |
|
|
test true uname wc ${_zoneinfo} |
633 |
|
|
|
634 |
|
|
# |
635 |
laffer1 |
2 |
# distributeworld |
636 |
|
|
# |
637 |
|
|
# Distributes everything compiled by a `buildworld'. |
638 |
|
|
# |
639 |
|
|
# installworld |
640 |
|
|
# |
641 |
|
|
# Installs everything compiled by a 'buildworld'. |
642 |
|
|
# |
643 |
laffer1 |
4290 |
|
644 |
|
|
# Non-base distributions produced by the base system |
645 |
laffer1 |
4404 |
EXTRA_DISTRIBUTIONS= doc games |
646 |
laffer1 |
4290 |
.if defined(LIB32TMP) && ${MK_LIB32} != "no" |
647 |
|
|
EXTRA_DISTRIBUTIONS+= lib32 |
648 |
|
|
.endif |
649 |
|
|
|
650 |
laffer1 |
2 |
distributeworld installworld: installcheck |
651 |
|
|
mkdir -p ${INSTALLTMP} |
652 |
laffer1 |
4290 |
progs=$$(for prog in ${ITOOLS}; do \ |
653 |
|
|
if progpath=`which $$prog`; then \ |
654 |
|
|
echo $$progpath; \ |
655 |
|
|
else \ |
656 |
|
|
echo "Required tool $$prog not found in PATH." >&2; \ |
657 |
|
|
exit 1; \ |
658 |
|
|
fi; \ |
659 |
|
|
done); \ |
660 |
|
|
libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \ |
661 |
|
|
while read line; do \ |
662 |
|
|
set -- $$line; \ |
663 |
|
|
if [ "$$2 $$3" != "not found" ]; then \ |
664 |
|
|
echo $$2; \ |
665 |
|
|
else \ |
666 |
|
|
echo "Required library $$1 not found." >&2; \ |
667 |
|
|
exit 1; \ |
668 |
|
|
fi; \ |
669 |
|
|
done); \ |
670 |
|
|
cp $$libs $$progs ${INSTALLTMP} |
671 |
|
|
cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale |
672 |
|
|
.if make(distributeworld) |
673 |
|
|
.for dist in ${EXTRA_DISTRIBUTIONS} |
674 |
|
|
-mkdir ${DESTDIR}/${DISTDIR}/${dist} |
675 |
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \ |
676 |
|
|
-p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null |
677 |
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ |
678 |
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null |
679 |
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ |
680 |
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null |
681 |
|
|
.endfor |
682 |
|
|
-mkdir ${DESTDIR}/${DISTDIR}/base |
683 |
|
|
${_+_}cd ${.CURDIR}; ${IMAKE} distrib-dirs \ |
684 |
|
|
DESTDIR=${DESTDIR}/${DISTDIR}/base |
685 |
|
|
.endif |
686 |
|
|
${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \ |
687 |
|
|
${IMAKEENV} rm -rf ${INSTALLTMP} |
688 |
|
|
.if make(distributeworld) |
689 |
|
|
.for dist in ${EXTRA_DISTRIBUTIONS} |
690 |
|
|
find ${DESTDIR}/${DISTDIR}/${dist} -empty -delete |
691 |
|
|
.endfor |
692 |
|
|
.endif |
693 |
laffer1 |
2 |
|
694 |
laffer1 |
4290 |
packageworld: |
695 |
|
|
.for dist in base ${EXTRA_DISTRIBUTIONS} |
696 |
|
|
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ |
697 |
|
|
tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz . |
698 |
|
|
.endfor |
699 |
|
|
|
700 |
laffer1 |
2 |
# |
701 |
|
|
# reinstall |
702 |
|
|
# |
703 |
|
|
# If you have a build server, you can NFS mount the source and obj directories |
704 |
|
|
# and do a 'make reinstall' on the *client* to install new binaries from the |
705 |
|
|
# most recent server build. |
706 |
|
|
# |
707 |
laffer1 |
1926 |
reinstall: |
708 |
laffer1 |
2 |
@echo "--------------------------------------------------------------" |
709 |
|
|
@echo ">>> Making hierarchy" |
710 |
|
|
@echo "--------------------------------------------------------------" |
711 |
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy |
712 |
|
|
@echo |
713 |
|
|
@echo "--------------------------------------------------------------" |
714 |
|
|
@echo ">>> Installing everything" |
715 |
|
|
@echo "--------------------------------------------------------------" |
716 |
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install |
717 |
laffer1 |
5123 |
.if defined(LIB32TMP) && ${MK_LIB32} != "no" |
718 |
laffer1 |
2 |
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32 |
719 |
|
|
.endif |
720 |
|
|
|
721 |
|
|
redistribute: |
722 |
|
|
@echo "--------------------------------------------------------------" |
723 |
|
|
@echo ">>> Distributing everything" |
724 |
|
|
@echo "--------------------------------------------------------------" |
725 |
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute |
726 |
laffer1 |
4290 |
.if defined(LIB32TMP) && ${MK_LIB32} != "no" |
727 |
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 \ |
728 |
|
|
DISTRIBUTION=lib32 |
729 |
laffer1 |
2 |
.endif |
730 |
|
|
|
731 |
|
|
distrib-dirs distribution: |
732 |
|
|
cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} ${.TARGET} |
733 |
|
|
|
734 |
|
|
# |
735 |
|
|
# buildkernel and installkernel |
736 |
|
|
# |
737 |
|
|
# Which kernels to build and/or install is specified by setting |
738 |
|
|
# KERNCONF. If not defined a GENERIC kernel is built/installed. |
739 |
|
|
# Only the existing (depending TARGET) config files are used |
740 |
|
|
# for building kernels and only the first of these is designated |
741 |
|
|
# as the one being installed. |
742 |
|
|
# |
743 |
|
|
# Note that we have to use TARGET instead of TARGET_ARCH when |
744 |
|
|
# we're in kernel-land. Since only TARGET_ARCH is (expected) to |
745 |
|
|
# be set to cross-build, we have to make sure TARGET is set |
746 |
|
|
# properly. |
747 |
|
|
|
748 |
laffer1 |
4290 |
.if defined(KERNFAST) |
749 |
|
|
NO_KERNELCLEAN= t |
750 |
|
|
NO_KERNELCONFIG= t |
751 |
|
|
NO_KERNELDEPEND= t |
752 |
|
|
NO_KERNELOBJ= t |
753 |
|
|
# Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah |
754 |
|
|
.if !defined(KERNCONF) && ${KERNFAST} != "1" |
755 |
|
|
KERNCONF=${KERNFAST} |
756 |
|
|
.endif |
757 |
|
|
.endif |
758 |
laffer1 |
2 |
.if !defined(KERNCONF) && defined(KERNEL) |
759 |
|
|
KERNCONF= ${KERNEL} |
760 |
|
|
KERNWARN= |
761 |
|
|
.else |
762 |
|
|
KERNCONF?= GENERIC |
763 |
|
|
.endif |
764 |
|
|
INSTKERNNAME?= kernel |
765 |
|
|
|
766 |
|
|
KERNSRCDIR?= ${.CURDIR}/sys |
767 |
|
|
KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf |
768 |
|
|
KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR} |
769 |
|
|
KERNCONFDIR?= ${KRNLCONFDIR} |
770 |
|
|
|
771 |
|
|
BUILDKERNELS= |
772 |
|
|
INSTALLKERNEL= |
773 |
|
|
.for _kernel in ${KERNCONF} |
774 |
|
|
.if exists(${KERNCONFDIR}/${_kernel}) |
775 |
|
|
BUILDKERNELS+= ${_kernel} |
776 |
|
|
.if empty(INSTALLKERNEL) |
777 |
|
|
INSTALLKERNEL= ${_kernel} |
778 |
|
|
.endif |
779 |
|
|
.endif |
780 |
|
|
.endfor |
781 |
|
|
|
782 |
|
|
# |
783 |
|
|
# buildkernel |
784 |
|
|
# |
785 |
|
|
# Builds all kernels defined by BUILDKERNELS. |
786 |
|
|
# |
787 |
|
|
buildkernel: |
788 |
|
|
.if empty(BUILDKERNELS) |
789 |
|
|
@echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \ |
790 |
|
|
false |
791 |
|
|
.endif |
792 |
|
|
.if defined(KERNWARN) |
793 |
|
|
@echo "--------------------------------------------------------------" |
794 |
|
|
@echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF=" |
795 |
|
|
@echo "--------------------------------------------------------------" |
796 |
|
|
@sleep 3 |
797 |
|
|
.endif |
798 |
|
|
@echo |
799 |
|
|
.for _kernel in ${BUILDKERNELS} |
800 |
|
|
@echo "--------------------------------------------------------------" |
801 |
|
|
@echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`" |
802 |
|
|
@echo "--------------------------------------------------------------" |
803 |
|
|
@echo "===> ${_kernel}" |
804 |
|
|
mkdir -p ${KRNLOBJDIR} |
805 |
|
|
.if !defined(NO_KERNELCONFIG) |
806 |
|
|
@echo |
807 |
|
|
@echo "--------------------------------------------------------------" |
808 |
|
|
@echo ">>> stage 1: configuring the kernel" |
809 |
|
|
@echo "--------------------------------------------------------------" |
810 |
|
|
cd ${KRNLCONFDIR}; \ |
811 |
|
|
PATH=${TMPPATH} \ |
812 |
|
|
config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \ |
813 |
|
|
${KERNCONFDIR}/${_kernel} |
814 |
|
|
.endif |
815 |
|
|
.if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN) |
816 |
|
|
@echo |
817 |
|
|
@echo "--------------------------------------------------------------" |
818 |
|
|
@echo ">>> stage 2.1: cleaning up the object tree" |
819 |
|
|
@echo "--------------------------------------------------------------" |
820 |
laffer1 |
1926 |
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR} |
821 |
laffer1 |
2 |
.endif |
822 |
laffer1 |
4290 |
.if !defined(NO_KERNELOBJ) |
823 |
laffer1 |
2 |
@echo |
824 |
|
|
@echo "--------------------------------------------------------------" |
825 |
|
|
@echo ">>> stage 2.2: rebuilding the object tree" |
826 |
|
|
@echo "--------------------------------------------------------------" |
827 |
laffer1 |
1926 |
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj |
828 |
laffer1 |
4290 |
.endif |
829 |
laffer1 |
2 |
@echo |
830 |
|
|
@echo "--------------------------------------------------------------" |
831 |
|
|
@echo ">>> stage 2.3: build tools" |
832 |
|
|
@echo "--------------------------------------------------------------" |
833 |
|
|
cd ${KRNLOBJDIR}/${_kernel}; \ |
834 |
laffer1 |
4650 |
PATH=${BPATH}:${PATH} \ |
835 |
laffer1 |
2 |
MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ |
836 |
laffer1 |
5123 |
${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF -DEARLY_BUILD \ |
837 |
laffer1 |
4290 |
-f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile |
838 |
laffer1 |
2 |
# XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. |
839 |
|
|
.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) |
840 |
|
|
.for target in obj depend all |
841 |
|
|
cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \ |
842 |
laffer1 |
4650 |
PATH=${BPATH}:${PATH} \ |
843 |
laffer1 |
2 |
MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ |
844 |
laffer1 |
5123 |
${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF -DEARLY_BUILD ${target} |
845 |
laffer1 |
2 |
.endfor |
846 |
|
|
.endif |
847 |
|
|
.if !defined(NO_KERNELDEPEND) |
848 |
|
|
@echo |
849 |
|
|
@echo "--------------------------------------------------------------" |
850 |
|
|
@echo ">>> stage 3.1: making dependencies" |
851 |
|
|
@echo "--------------------------------------------------------------" |
852 |
laffer1 |
1926 |
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ |
853 |
laffer1 |
2 |
.endif |
854 |
|
|
@echo |
855 |
|
|
@echo "--------------------------------------------------------------" |
856 |
|
|
@echo ">>> stage 3.2: building everything" |
857 |
|
|
@echo "--------------------------------------------------------------" |
858 |
laffer1 |
1926 |
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ |
859 |
laffer1 |
2 |
@echo "--------------------------------------------------------------" |
860 |
|
|
@echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`" |
861 |
|
|
@echo "--------------------------------------------------------------" |
862 |
|
|
.endfor |
863 |
|
|
|
864 |
|
|
# |
865 |
|
|
# installkernel, etc. |
866 |
|
|
# |
867 |
|
|
# Install the kernel defined by INSTALLKERNEL |
868 |
|
|
# |
869 |
|
|
installkernel installkernel.debug \ |
870 |
laffer1 |
1926 |
reinstallkernel reinstallkernel.debug: installcheck |
871 |
laffer1 |
2 |
.if empty(INSTALLKERNEL) |
872 |
|
|
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \ |
873 |
|
|
false |
874 |
|
|
.endif |
875 |
|
|
@echo "--------------------------------------------------------------" |
876 |
laffer1 |
4290 |
@echo ">>> Installing kernel ${INSTALLKERNEL}" |
877 |
laffer1 |
2 |
@echo "--------------------------------------------------------------" |
878 |
|
|
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ |
879 |
|
|
${CROSSENV} PATH=${TMPPATH} \ |
880 |
|
|
${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} |
881 |
|
|
|
882 |
laffer1 |
4290 |
distributekernel distributekernel.debug: |
883 |
|
|
.if empty(INSTALLKERNEL) |
884 |
|
|
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \ |
885 |
|
|
false |
886 |
|
|
.endif |
887 |
|
|
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ |
888 |
|
|
${CROSSENV} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \ |
889 |
|
|
DESTDIR=${DESTDIR}/${DISTDIR}/kernel \ |
890 |
|
|
${.TARGET:S/distributekernel/install/} |
891 |
laffer1 |
5123 |
.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} |
892 |
|
|
cd ${KRNLOBJDIR}/${_kernel}; \ |
893 |
|
|
${CROSSENV} PATH=${TMPPATH} ${MAKE} \ |
894 |
|
|
KERNEL=${INSTKERNNAME}.${_kernel} \ |
895 |
|
|
DESTDIR=${DESTDIR}/${DISTDIR}/kernel.${_kernel} \ |
896 |
|
|
${.TARGET:S/distributekernel/install/} |
897 |
|
|
.endfor |
898 |
laffer1 |
4290 |
|
899 |
|
|
packagekernel: |
900 |
laffer1 |
5123 |
cd ${DESTDIR}/${DISTDIR}/kernel; \ |
901 |
laffer1 |
4290 |
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz . |
902 |
laffer1 |
5123 |
.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} |
903 |
|
|
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ |
904 |
|
|
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz . |
905 |
|
|
.endfor |
906 |
laffer1 |
4290 |
|
907 |
laffer1 |
2 |
# |
908 |
laffer1 |
1926 |
# doxygen |
909 |
|
|
# |
910 |
|
|
# Build the API documentation with doxygen |
911 |
|
|
# |
912 |
|
|
doxygen: |
913 |
|
|
@if [ ! -x `/usr/bin/which doxygen` ]; then \ |
914 |
|
|
echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \ |
915 |
|
|
exit 1; \ |
916 |
|
|
fi |
917 |
|
|
cd ${.CURDIR}/tools/kerneldoc/subsys && ${MAKE} obj all |
918 |
|
|
|
919 |
|
|
# |
920 |
laffer1 |
2 |
# update |
921 |
|
|
# |
922 |
laffer1 |
5123 |
# Update the source tree(s), by running cvsup/cvs/svn to update to the |
923 |
laffer1 |
2 |
# latest copy. |
924 |
|
|
# |
925 |
|
|
update: |
926 |
|
|
.if defined(SUP_UPDATE) |
927 |
|
|
@echo "--------------------------------------------------------------" |
928 |
|
|
@echo ">>> Running ${SUP}" |
929 |
|
|
@echo "--------------------------------------------------------------" |
930 |
|
|
.if defined(SUPFILE) |
931 |
|
|
@${SUP} ${SUPFLAGS} ${SUPFILE} |
932 |
|
|
.endif |
933 |
|
|
.if defined(SUPFILE1) |
934 |
|
|
@${SUP} ${SUPFLAGS} ${SUPFILE1} |
935 |
|
|
.endif |
936 |
|
|
.if defined(SUPFILE2) |
937 |
|
|
@${SUP} ${SUPFLAGS} ${SUPFILE2} |
938 |
|
|
.endif |
939 |
|
|
.if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE) |
940 |
|
|
@${SUP} ${SUPFLAGS} ${PORTSSUPFILE} |
941 |
|
|
.endif |
942 |
|
|
.if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE) |
943 |
|
|
@${SUP} ${SUPFLAGS} ${DOCSUPFILE} |
944 |
|
|
.endif |
945 |
|
|
.endif |
946 |
|
|
.if defined(CVS_UPDATE) |
947 |
laffer1 |
5123 |
@cd ${.CURDIR} ; \ |
948 |
|
|
if [ -d CVS ] ; then \ |
949 |
|
|
echo "--------------------------------------------------------------" ; \ |
950 |
|
|
echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT} ; \ |
951 |
|
|
echo "--------------------------------------------------------------" ; \ |
952 |
|
|
echo ${CVS} -R -q update ${CVSFLAGS} ; \ |
953 |
|
|
${CVS} -R -q update ${CVSFLAGS} ; \ |
954 |
|
|
fi |
955 |
laffer1 |
2 |
.endif |
956 |
laffer1 |
5123 |
.if defined(SVN_UPDATE) |
957 |
|
|
@cd ${.CURDIR} ; \ |
958 |
|
|
if [ -d .svn ] ; then \ |
959 |
|
|
echo "--------------------------------------------------------------" ; \ |
960 |
|
|
echo ">>> Updating ${.CURDIR} using Subversion" ; \ |
961 |
|
|
echo "--------------------------------------------------------------" ; \ |
962 |
|
|
echo ${SVN} update ${SVNFLAGS} ; \ |
963 |
|
|
${SVN} update ${SVNFLAGS} ; \ |
964 |
|
|
fi |
965 |
|
|
.endif |
966 |
laffer1 |
2 |
|
967 |
|
|
# |
968 |
|
|
# ------------------------------------------------------------------------ |
969 |
|
|
# |
970 |
|
|
# From here onwards are utility targets used by the 'make world' and |
971 |
|
|
# related targets. If your 'world' breaks, you may like to try to fix |
972 |
|
|
# the problem and manually run the following targets to attempt to |
973 |
|
|
# complete the build. Beware, this is *not* guaranteed to work, you |
974 |
|
|
# need to have a pretty good grip on the current state of the system |
975 |
|
|
# to attempt to manually finish it. If in doubt, 'make world' again. |
976 |
|
|
# |
977 |
|
|
|
978 |
|
|
# |
979 |
|
|
# legacy: Build compatibility shims for the next three targets |
980 |
|
|
# |
981 |
|
|
legacy: |
982 |
laffer1 |
7135 |
.if ${BOOTSTRAPPING} < 4000 && ${BOOTSTRAPPING} != 0 |
983 |
|
|
@echo "ERROR: Source upgrades from versions prior to 0.4 not supported."; \ |
984 |
laffer1 |
5123 |
false |
985 |
|
|
.endif |
986 |
laffer1 |
7150 |
mkdir -p ${MAKEOBJDIRPREFIX}/legacy/usr/bin |
987 |
laffer1 |
2 |
.for _tool in tools/build |
988 |
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \ |
989 |
laffer1 |
7136 |
cd ${.CURDIR}/${_tool} && \ |
990 |
|
|
${MAKE} DIRPRFX=${_tool}/ obj && \ |
991 |
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes && \ |
992 |
|
|
${MAKE} DIRPRFX=${_tool}/ depend && \ |
993 |
|
|
${MAKE} DIRPRFX=${_tool}/ all && \ |
994 |
laffer1 |
2 |
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install |
995 |
|
|
.endfor |
996 |
|
|
|
997 |
|
|
# |
998 |
|
|
# bootstrap-tools: Build tools needed for compatibility |
999 |
|
|
# |
1000 |
laffer1 |
1926 |
.if ${MK_GAMES} != "no" |
1001 |
laffer1 |
2 |
_strfile= games/fortune/strfile |
1002 |
|
|
.endif |
1003 |
|
|
|
1004 |
laffer1 |
1926 |
.if ${MK_CXX} != "no" |
1005 |
laffer1 |
2 |
_gperf= gnu/usr.bin/gperf |
1006 |
laffer1 |
5123 |
.endif |
1007 |
|
|
|
1008 |
|
|
.if ${MK_GROFF} != "no" |
1009 |
laffer1 |
2 |
_groff= gnu/usr.bin/groff |
1010 |
|
|
.endif |
1011 |
laffer1 |
5123 |
|
1012 |
laffer1 |
5736 |
.if ${BOOTSTRAPPING} >= 4000 && ${BOOTSTRAPPING} < 4015 |
1013 |
laffer1 |
5123 |
_ar= usr.bin/ar |
1014 |
laffer1 |
2 |
.endif |
1015 |
|
|
|
1016 |
laffer1 |
5736 |
.if ${BOOTSTRAPPING} < 4015 |
1017 |
laffer1 |
5123 |
_mklocale= usr.bin/mklocale |
1018 |
|
|
.endif |
1019 |
|
|
|
1020 |
laffer1 |
5736 |
.if ${BOOTSTRAPPING} < 4015 |
1021 |
laffer1 |
5123 |
_sed= usr.bin/sed |
1022 |
|
|
.endif |
1023 |
|
|
|
1024 |
laffer1 |
7150 |
.if ${BOOTSTRAPPING} < 7003 |
1025 |
laffer1 |
7136 |
_m4= usr.bin/m4 |
1026 |
|
|
.endif |
1027 |
|
|
|
1028 |
laffer1 |
7150 |
.if ${BOOTSTRAPPING} < 7003 |
1029 |
laffer1 |
5123 |
_lex= usr.bin/lex |
1030 |
|
|
.endif |
1031 |
|
|
|
1032 |
laffer1 |
7150 |
.if ${BOOTSTRAPPING} < 7003 |
1033 |
laffer1 |
7136 |
_yacc= lib/liby \ |
1034 |
|
|
usr.bin/yacc |
1035 |
laffer1 |
5123 |
.endif |
1036 |
|
|
|
1037 |
|
|
.if ${MK_BSNMP} != "no" && \ |
1038 |
|
|
(${BOOTSTRAPPING} < 4015 || !exists(/usr/sbin/gensnmptree)) |
1039 |
laffer1 |
687 |
_gensnmptree= usr.sbin/bsnmpd/gensnmptree |
1040 |
laffer1 |
366 |
.endif |
1041 |
|
|
|
1042 |
laffer1 |
1926 |
.if ${MK_RESCUE} != "no" && \ |
1043 |
laffer1 |
5053 |
${BOOTSTRAPPING} < 4015 |
1044 |
laffer1 |
2 |
_crunchgen= usr.sbin/crunch/crunchgen |
1045 |
|
|
.endif |
1046 |
|
|
|
1047 |
laffer1 |
5123 |
.if ${MK_CLANG} != "no" |
1048 |
|
|
_clang_tblgen= \ |
1049 |
|
|
lib/clang/libllvmsupport \ |
1050 |
|
|
lib/clang/libllvmtablegen \ |
1051 |
|
|
usr.bin/clang/tblgen \ |
1052 |
|
|
usr.bin/clang/clang-tblgen |
1053 |
|
|
.endif |
1054 |
|
|
|
1055 |
|
|
.if ${MK_CDDL} != "no" && \ |
1056 |
laffer1 |
5736 |
${BOOTSTRAPPING} < 4015 && \ |
1057 |
|
|
!(${BOOTSTRAPPING} >= 4000 && ${BOOTSTRAPPING} < 4015) |
1058 |
laffer1 |
5123 |
_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ |
1059 |
|
|
lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge |
1060 |
|
|
.endif |
1061 |
|
|
|
1062 |
|
|
.if ${MK_FDT} != "no" |
1063 |
|
|
_dtc= gnu/usr.bin/dtc |
1064 |
|
|
.endif |
1065 |
|
|
|
1066 |
|
|
# Please document (add comment) why something is in 'bootstrap-tools'. |
1067 |
|
|
# Try to bound the building of the bootstrap-tool to just the |
1068 |
|
|
# MidnightBSD versions that need the tool built at this stage of the build. |
1069 |
laffer1 |
2 |
bootstrap-tools: |
1070 |
|
|
.for _tool in \ |
1071 |
laffer1 |
5123 |
${_clang_tblgen} \ |
1072 |
laffer1 |
7288 |
${_kerberos5_bootstrap_tools} \ |
1073 |
laffer1 |
5123 |
${_dtrace_tools} \ |
1074 |
laffer1 |
2 |
${_strfile} \ |
1075 |
|
|
${_gperf} \ |
1076 |
|
|
${_groff} \ |
1077 |
laffer1 |
5123 |
${_ar} \ |
1078 |
|
|
${_dtc} \ |
1079 |
|
|
${_awk} \ |
1080 |
laffer1 |
2 |
usr.bin/lorder \ |
1081 |
|
|
usr.bin/makewhatis \ |
1082 |
laffer1 |
5123 |
${_mklocale} \ |
1083 |
laffer1 |
2 |
usr.bin/rpcgen \ |
1084 |
laffer1 |
5123 |
${_sed} \ |
1085 |
|
|
${_yacc} \ |
1086 |
laffer1 |
7288 |
${_m4} \ |
1087 |
laffer1 |
5123 |
${_lex} \ |
1088 |
laffer1 |
7288 |
lib/libmd \ |
1089 |
laffer1 |
1926 |
usr.bin/xinstall \ |
1090 |
laffer1 |
366 |
${_gensnmptree} \ |
1091 |
laffer1 |
2 |
usr.sbin/config \ |
1092 |
laffer1 |
2833 |
${_crunchgen} |
1093 |
laffer1 |
2 |
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ |
1094 |
|
|
cd ${.CURDIR}/${_tool}; \ |
1095 |
|
|
${MAKE} DIRPRFX=${_tool}/ obj; \ |
1096 |
|
|
${MAKE} DIRPRFX=${_tool}/ depend; \ |
1097 |
|
|
${MAKE} DIRPRFX=${_tool}/ all; \ |
1098 |
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install |
1099 |
|
|
.endfor |
1100 |
|
|
|
1101 |
|
|
# |
1102 |
|
|
# build-tools: Build special purpose build tools |
1103 |
|
|
# |
1104 |
|
|
.if defined(MODULES_WITH_WORLD) && exists(${KERNSRCDIR}/modules) |
1105 |
|
|
_aicasm= sys/modules/aic7xxx/aicasm |
1106 |
|
|
.endif |
1107 |
|
|
|
1108 |
|
|
.if !defined(NO_SHARE) |
1109 |
|
|
_share= share/syscons/scrnmaps |
1110 |
|
|
.endif |
1111 |
|
|
|
1112 |
laffer1 |
5123 |
.if ${MK_GCC} != "no" && ${MK_CLANG_IS_CC} == "no" |
1113 |
|
|
_gcc_tools= gnu/usr.bin/cc/cc_tools |
1114 |
|
|
.endif |
1115 |
|
|
|
1116 |
laffer1 |
1926 |
.if ${MK_KERBEROS} != "no" |
1117 |
laffer1 |
7150 |
_kerberos5_bootstrap_tools= \ |
1118 |
|
|
kerberos5/tools/make-roken \ |
1119 |
|
|
kerberos5/lib/libroken \ |
1120 |
|
|
kerberos5/lib/libvers \ |
1121 |
|
|
kerberos5/tools/asn1_compile \ |
1122 |
|
|
kerberos5/tools/slc \ |
1123 |
|
|
usr.bin/compile_et |
1124 |
|
|
|
1125 |
|
|
.ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g} |
1126 |
laffer1 |
2 |
.endif |
1127 |
|
|
|
1128 |
laffer1 |
1926 |
.if ${MK_RESCUE} != "no" |
1129 |
laffer1 |
2 |
_rescue= rescue/rescue |
1130 |
|
|
.endif |
1131 |
|
|
|
1132 |
|
|
build-tools: |
1133 |
|
|
.for _tool in \ |
1134 |
|
|
bin/csh \ |
1135 |
|
|
bin/sh \ |
1136 |
|
|
${_rescue} \ |
1137 |
laffer1 |
1926 |
lib/ncurses/ncurses \ |
1138 |
|
|
lib/ncurses/ncursesw \ |
1139 |
laffer1 |
2 |
${_share} \ |
1140 |
|
|
${_aicasm} \ |
1141 |
|
|
usr.bin/awk \ |
1142 |
|
|
lib/libmagic \ |
1143 |
laffer1 |
5004 |
usr.sbin/sysinstall \ |
1144 |
|
|
usr.bin/mkesdb_static \ |
1145 |
|
|
usr.bin/mkcsmapper_static |
1146 |
laffer1 |
2 |
${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \ |
1147 |
|
|
cd ${.CURDIR}/${_tool}; \ |
1148 |
|
|
${MAKE} DIRPRFX=${_tool}/ obj; \ |
1149 |
|
|
${MAKE} DIRPRFX=${_tool}/ build-tools |
1150 |
|
|
.endfor |
1151 |
|
|
.for _tool in \ |
1152 |
laffer1 |
5123 |
${_gcc_tools} \ |
1153 |
laffer1 |
7150 |
${_kerberos5_bootstrap_tools} |
1154 |
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ |
1155 |
|
|
cd ${.CURDIR}/${_tool} && \ |
1156 |
|
|
${MAKE} DIRPRFX=${_tool}/ obj && \ |
1157 |
|
|
${MAKE} DIRPRFX=${_tool}/ depend && \ |
1158 |
|
|
${MAKE} DIRPRFX=${_tool}/ all && \ |
1159 |
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP}/legacy install |
1160 |
laffer1 |
2 |
.endfor |
1161 |
|
|
|
1162 |
|
|
# |
1163 |
|
|
# cross-tools: Build cross-building tools |
1164 |
|
|
# |
1165 |
laffer1 |
5738 |
.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 4016 |
1166 |
laffer1 |
1926 |
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" |
1167 |
laffer1 |
2 |
_btxld= usr.sbin/btxld |
1168 |
|
|
.endif |
1169 |
laffer1 |
5123 |
.endif |
1170 |
|
|
.if ${TARGET_ARCH} != ${MACHINE_ARCH} |
1171 |
laffer1 |
1926 |
.if ${MK_RESCUE} != "no" || defined(RELEASEDIR) |
1172 |
laffer1 |
2 |
_crunchide= usr.sbin/crunch/crunchide |
1173 |
|
|
.endif |
1174 |
laffer1 |
1926 |
.if ${TARGET_ARCH} == "i386" && defined(RELEASEDIR) |
1175 |
laffer1 |
2 |
_kgzip= usr.sbin/kgzip |
1176 |
|
|
.endif |
1177 |
laffer1 |
1926 |
.endif |
1178 |
laffer1 |
2 |
|
1179 |
laffer1 |
5123 |
.if ${MK_BINUTILS} != "no" |
1180 |
|
|
_binutils= gnu/usr.bin/binutils |
1181 |
|
|
.endif |
1182 |
|
|
|
1183 |
|
|
.if ${MK_CLANG} != "no" && (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") |
1184 |
|
|
_clang= usr.bin/clang |
1185 |
|
|
_clang_libs= lib/clang |
1186 |
|
|
.endif |
1187 |
|
|
|
1188 |
|
|
.if ${MK_GCC} != "no" && ${MK_CLANG_IS_CC} == "no" |
1189 |
|
|
_cc= gnu/usr.bin/cc |
1190 |
|
|
.endif |
1191 |
|
|
|
1192 |
laffer1 |
2 |
cross-tools: |
1193 |
|
|
.for _tool in \ |
1194 |
laffer1 |
5123 |
${_clang_libs} \ |
1195 |
|
|
${_clang} \ |
1196 |
|
|
${_binutils} \ |
1197 |
|
|
${_cc} \ |
1198 |
laffer1 |
2 |
usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ |
1199 |
|
|
${_btxld} \ |
1200 |
|
|
${_crunchide} \ |
1201 |
|
|
${_kgzip} |
1202 |
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ |
1203 |
|
|
cd ${.CURDIR}/${_tool}; \ |
1204 |
|
|
${MAKE} DIRPRFX=${_tool}/ obj; \ |
1205 |
|
|
${MAKE} DIRPRFX=${_tool}/ depend; \ |
1206 |
|
|
${MAKE} DIRPRFX=${_tool}/ all; \ |
1207 |
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install |
1208 |
|
|
.endfor |
1209 |
|
|
|
1210 |
|
|
# |
1211 |
|
|
# hierarchy - ensure that all the needed directories are present |
1212 |
|
|
# |
1213 |
|
|
hierarchy: |
1214 |
|
|
cd ${.CURDIR}/etc; ${MAKE} distrib-dirs |
1215 |
|
|
|
1216 |
|
|
# |
1217 |
|
|
# libraries - build all libraries, and install them under ${DESTDIR}. |
1218 |
|
|
# |
1219 |
|
|
# The list of libraries with dependents (${_prebuild_libs}) and their |
1220 |
|
|
# interdependencies (__L) are built automatically by the |
1221 |
|
|
# ${.CURDIR}/tools/make_libdeps.sh script. |
1222 |
|
|
# |
1223 |
|
|
libraries: |
1224 |
|
|
cd ${.CURDIR}; \ |
1225 |
laffer1 |
1926 |
${MAKE} -f Makefile.inc1 _prereq_libs; \ |
1226 |
laffer1 |
2 |
${MAKE} -f Makefile.inc1 _startup_libs; \ |
1227 |
|
|
${MAKE} -f Makefile.inc1 _prebuild_libs; \ |
1228 |
|
|
${MAKE} -f Makefile.inc1 _generic_libs; |
1229 |
|
|
|
1230 |
laffer1 |
1926 |
# |
1231 |
|
|
# static libgcc.a prerequisite for shared libc |
1232 |
|
|
# |
1233 |
laffer1 |
5123 |
_prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc lib/libcompiler_rt |
1234 |
laffer1 |
1926 |
|
1235 |
laffer1 |
2 |
# These dependencies are not automatically generated: |
1236 |
|
|
# |
1237 |
laffer1 |
1926 |
# gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before |
1238 |
|
|
# all shared libraries for ELF. |
1239 |
laffer1 |
2 |
# |
1240 |
laffer1 |
1926 |
_startup_libs= gnu/lib/csu |
1241 |
laffer1 |
2 |
.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf) |
1242 |
|
|
_startup_libs+= lib/csu/${MACHINE_ARCH}-elf |
1243 |
laffer1 |
5123 |
.elif exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}) |
1244 |
|
|
_startup_libs+= lib/csu/${MACHINE_ARCH} |
1245 |
laffer1 |
2 |
.else |
1246 |
laffer1 |
5123 |
_startup_libs+= lib/csu/${MACHINE_CPUARCH} |
1247 |
laffer1 |
2 |
.endif |
1248 |
laffer1 |
1926 |
_startup_libs+= gnu/lib/libgcc |
1249 |
laffer1 |
5123 |
_startup_libs+= lib/libcompiler_rt |
1250 |
laffer1 |
1926 |
_startup_libs+= lib/libc |
1251 |
laffer1 |
5123 |
.if ${MK_LIBCPLUSPLUS} != "no" |
1252 |
|
|
_startup_libs+= lib/libcxxrt |
1253 |
|
|
.endif |
1254 |
laffer1 |
2 |
|
1255 |
laffer1 |
1926 |
gnu/lib/libgcc__L: lib/libc__L |
1256 |
laffer1 |
5123 |
.if ${MK_LIBCPLUSPLUS} != "no" |
1257 |
|
|
lib/libcxxrt__L: gnu/lib/libgcc__L |
1258 |
|
|
.endif |
1259 |
laffer1 |
2 |
|
1260 |
laffer1 |
7151 |
_prebuild_libs= ${_kerberos5_lib_libasn1} \ |
1261 |
|
|
${_kerberos5_lib_libhdb} \ |
1262 |
|
|
${_kerberos5_lib_libheimbase} \ |
1263 |
laffer1 |
5123 |
${_kerberos5_lib_libheimntlm} \ |
1264 |
laffer1 |
7151 |
${_kerberos5_lib_libheimsqlite} \ |
1265 |
|
|
${_kerberos5_lib_libheimipcc} \ |
1266 |
laffer1 |
5123 |
${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \ |
1267 |
laffer1 |
1926 |
${_kerberos5_lib_libroken} \ |
1268 |
laffer1 |
7151 |
${_kerberos5_lib_libwind} \ |
1269 |
laffer1 |
4290 |
lib/libbz2 lib/libcom_err lib/libcrypt \ |
1270 |
laffer1 |
7151 |
lib/libelf lib/libexpat \ |
1271 |
laffer1 |
1926 |
${_lib_libgssapi} ${_lib_libipx} \ |
1272 |
laffer1 |
5123 |
lib/libkiconv lib/libkvm lib/liblzma lib/libmd \ |
1273 |
laffer1 |
1926 |
lib/ncurses/ncurses lib/ncurses/ncursesw \ |
1274 |
laffer1 |
5123 |
lib/libopie lib/libpam ${_lib_libthr} \ |
1275 |
|
|
lib/libradius lib/libsbuf lib/libtacplus \ |
1276 |
|
|
${_cddl_lib_libumem} \ |
1277 |
|
|
lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ |
1278 |
laffer1 |
1926 |
${_secure_lib_libcrypto} ${_secure_lib_libssh} \ |
1279 |
laffer1 |
5123 |
${_secure_lib_libssl} lib/libsqlite3 \ |
1280 |
laffer1 |
7394 |
lib/libarchive lib/libfetch lib/libmagic \ |
1281 |
|
|
lib/libblocksruntime |
1282 |
laffer1 |
5123 |
.if ${MK_LIBTHR} != "no" |
1283 |
|
|
_lib_libthr= lib/libthr |
1284 |
|
|
.endif |
1285 |
laffer1 |
2 |
|
1286 |
laffer1 |
5123 |
.if ${MK_OFED} != "no" |
1287 |
|
|
_ofed_lib= contrib/ofed/usr.lib/ |
1288 |
laffer1 |
2 |
.endif |
1289 |
|
|
|
1290 |
laffer1 |
5123 |
_generic_libs= ${_apache_lib} ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib} |
1291 |
laffer1 |
2 |
|
1292 |
|
|
lib/libopie__L lib/libtacplus__L: lib/libmd__L |
1293 |
|
|
|
1294 |
laffer1 |
3446 |
.if ${MK_APACHE} != "no" |
1295 |
|
|
_apache_lib= apache/lib |
1296 |
|
|
.endif |
1297 |
|
|
|
1298 |
laffer1 |
1926 |
.if ${MK_CDDL} != "no" |
1299 |
laffer1 |
5123 |
_cddl_lib_libumem= cddl/lib/libumem |
1300 |
laffer1 |
1926 |
_cddl_lib= cddl/lib |
1301 |
|
|
.endif |
1302 |
laffer1 |
2 |
|
1303 |
laffer1 |
1926 |
.if ${MK_CRYPT} != "no" |
1304 |
|
|
.if ${MK_OPENSSL} != "no" |
1305 |
|
|
_secure_lib_libcrypto= secure/lib/libcrypto |
1306 |
|
|
_secure_lib_libssl= secure/lib/libssl |
1307 |
|
|
lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L |
1308 |
|
|
.if ${MK_OPENSSH} != "no" |
1309 |
|
|
_secure_lib_libssh= secure/lib/libssh |
1310 |
|
|
secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L |
1311 |
laffer1 |
5123 |
.if ${MK_KERBEROS_SUPPORT} != "no" |
1312 |
laffer1 |
1926 |
secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \ |
1313 |
laffer1 |
5123 |
kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \ |
1314 |
|
|
lib/libmd__L kerberos5/lib/libroken__L |
1315 |
laffer1 |
2 |
.endif |
1316 |
|
|
.endif |
1317 |
|
|
.endif |
1318 |
laffer1 |
1926 |
_secure_lib= secure/lib |
1319 |
laffer1 |
2 |
.endif |
1320 |
|
|
|
1321 |
laffer1 |
5123 |
.if ${MK_KERBEROS} != "no" |
1322 |
|
|
kerberos5/lib/libasn1__L: lib/libcom_err__L kerberos5/lib/libroken__L |
1323 |
|
|
kerberos5/lib/libhdb__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ |
1324 |
laffer1 |
7151 |
kerberos5/lib/libkrb5__L kerberos5/lib/libroken__L \ |
1325 |
|
|
kerberos5/lib/libwind__L kerberos5/lib/libheimsqlite__L |
1326 |
|
|
kerberos5/lib/libheimntlm__L: secure/lib/libcrypto__L kerberos5/lib/libkrb5__L \ |
1327 |
|
|
kerberos5/lib/libroken__L lib/libcom_err__L |
1328 |
laffer1 |
5123 |
kerberos5/lib/libhx509__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ |
1329 |
laffer1 |
7151 |
secure/lib/libcrypto__L kerberos5/lib/libroken__L kerberos5/lib/libwind__L |
1330 |
laffer1 |
5123 |
kerberos5/lib/libkrb5__L: kerberos5/lib/libasn1__L lib/libcom_err__L \ |
1331 |
|
|
lib/libcrypt__L secure/lib/libcrypto__L kerberos5/lib/libhx509__L \ |
1332 |
laffer1 |
7151 |
kerberos5/lib/libroken__L kerberos5/lib/libwind__L \ |
1333 |
|
|
kerberos5/lib/libheimbase__L kerberos5/lib/libheimipcc__L |
1334 |
laffer1 |
5123 |
kerberos5/lib/libroken__L: lib/libcrypt__L |
1335 |
laffer1 |
7151 |
kerberos5/lib/libwind__L: kerberos5/lib/libroken__L lib/libcom_err__L |
1336 |
|
|
kerberos5/lib/libheimbase__L: lib/libthr__L |
1337 |
|
|
kerberos5/lib/libheimipcc__L: kerberos5/lib/libroken__L kerberos5/lib/libheimbase__L lib/libthr__L |
1338 |
|
|
kerberos5/lib/libheimsqlite__L: lib/libthr__L |
1339 |
laffer1 |
5123 |
.endif |
1340 |
|
|
|
1341 |
|
|
.if ${MK_GSSAPI} != "no" |
1342 |
|
|
_lib_libgssapi= lib/libgssapi |
1343 |
|
|
.endif |
1344 |
|
|
|
1345 |
laffer1 |
1926 |
.if ${MK_IPX} != "no" |
1346 |
|
|
_lib_libipx= lib/libipx |
1347 |
|
|
.endif |
1348 |
|
|
|
1349 |
|
|
.if ${MK_KERBEROS} != "no" |
1350 |
laffer1 |
7151 |
_kerberos5_lib= kerberos5/lib |
1351 |
laffer1 |
1926 |
_kerberos5_lib_libasn1= kerberos5/lib/libasn1 |
1352 |
laffer1 |
5123 |
_kerberos5_lib_libhdb= kerberos5/lib/libhdb |
1353 |
laffer1 |
7151 |
_kerberos5_lib_libheimbase= kerberos5/lib/libheimbase |
1354 |
laffer1 |
1926 |
_kerberos5_lib_libkrb5= kerberos5/lib/libkrb5 |
1355 |
laffer1 |
5123 |
_kerberos5_lib_libhx509= kerberos5/lib/libhx509 |
1356 |
laffer1 |
1926 |
_kerberos5_lib_libroken= kerberos5/lib/libroken |
1357 |
laffer1 |
5123 |
_kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm |
1358 |
laffer1 |
7151 |
_kerberos5_lib_libheimsqlite= kerberos5/lib/libheimsqlite |
1359 |
|
|
_kerberos5_lib_libheimipcc= kerberos5/lib/libheimipcc |
1360 |
|
|
_kerberos5_lib_libwind= kerberos5/lib/libwind |
1361 |
|
|
_libcom_err= lib/libcom_err |
1362 |
laffer1 |
1926 |
.endif |
1363 |
|
|
|
1364 |
|
|
.if ${MK_NIS} != "no" |
1365 |
|
|
_lib_libypclnt= lib/libypclnt |
1366 |
|
|
.endif |
1367 |
|
|
|
1368 |
|
|
.if ${MK_OPENSSL} == "no" |
1369 |
laffer1 |
2 |
lib/libradius__L: lib/libmd__L |
1370 |
|
|
.endif |
1371 |
|
|
|
1372 |
laffer1 |
1926 |
.for _lib in ${_prereq_libs} |
1373 |
laffer1 |
7151 |
${_lib}__PL: .PHONY .MAKE |
1374 |
laffer1 |
1926 |
.if exists(${.CURDIR}/${_lib}) |
1375 |
|
|
${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ |
1376 |
laffer1 |
7151 |
cd ${.CURDIR}/${_lib} && \ |
1377 |
|
|
${MAKE} DIRPRFX=${_lib}/ obj && \ |
1378 |
|
|
${MAKE} DIRPRFX=${_lib}/ depend && \ |
1379 |
|
|
${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all && \ |
1380 |
laffer1 |
5123 |
${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install |
1381 |
laffer1 |
2 |
.endif |
1382 |
laffer1 |
1926 |
.endfor |
1383 |
laffer1 |
2 |
|
1384 |
|
|
.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs} |
1385 |
|
|
${_lib}__L: .PHONY |
1386 |
|
|
.if exists(${.CURDIR}/${_lib}) |
1387 |
laffer1 |
1549 |
${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ |
1388 |
laffer1 |
7151 |
cd ${.CURDIR}/${_lib} && \ |
1389 |
|
|
${MAKE} DIRPRFX=${_lib}/ obj && \ |
1390 |
|
|
${MAKE} DIRPRFX=${_lib}/ depend && \ |
1391 |
|
|
${MAKE} DIRPRFX=${_lib}/ all && \ |
1392 |
laffer1 |
2 |
${MAKE} DIRPRFX=${_lib}/ install |
1393 |
|
|
.endif |
1394 |
|
|
.endfor |
1395 |
|
|
|
1396 |
|
|
# libpam is special: we need to build static PAM modules before |
1397 |
|
|
# static PAM library, and dynamic PAM library before dynamic PAM |
1398 |
|
|
# modules. |
1399 |
|
|
lib/libpam__L: .PHONY |
1400 |
laffer1 |
1549 |
${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ |
1401 |
laffer1 |
2 |
cd ${.CURDIR}/lib/libpam; \ |
1402 |
laffer1 |
1549 |
${MAKE} DIRPRFX=lib/libpam/ obj; \ |
1403 |
laffer1 |
2 |
${MAKE} DIRPRFX=lib/libpam/ depend; \ |
1404 |
|
|
${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \ |
1405 |
|
|
${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install |
1406 |
|
|
|
1407 |
laffer1 |
1926 |
_prereq_libs: ${_prereq_libs:S/$/__PL/} |
1408 |
laffer1 |
2 |
_startup_libs: ${_startup_libs:S/$/__L/} |
1409 |
|
|
_prebuild_libs: ${_prebuild_libs:S/$/__L/} |
1410 |
|
|
_generic_libs: ${_generic_libs:S/$/__L/} |
1411 |
|
|
|
1412 |
|
|
.for __target in all clean cleandepend cleandir depend includes obj |
1413 |
|
|
.for entry in ${SUBDIR} |
1414 |
|
|
${entry}.${__target}__D: .PHONY |
1415 |
|
|
${_+_}@if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \ |
1416 |
|
|
${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH} (${__target})"; \ |
1417 |
|
|
edir=${entry}.${MACHINE_ARCH}; \ |
1418 |
|
|
cd ${.CURDIR}/$${edir}; \ |
1419 |
|
|
else \ |
1420 |
|
|
${ECHODIR} "===> ${DIRPRFX}${entry} (${__target})"; \ |
1421 |
|
|
edir=${entry}; \ |
1422 |
|
|
cd ${.CURDIR}/$${edir}; \ |
1423 |
|
|
fi; \ |
1424 |
|
|
${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/ |
1425 |
|
|
.endfor |
1426 |
|
|
par-${__target}: ${SUBDIR:S/$/.${__target}__D/} |
1427 |
|
|
.endfor |
1428 |
|
|
|
1429 |
|
|
.include <bsd.subdir.mk> |
1430 |
laffer1 |
5 |
|
1431 |
laffer1 |
1926 |
.if make(check-old) || make(check-old-dirs) || \ |
1432 |
|
|
make(check-old-files) || make(check-old-libs) || \ |
1433 |
|
|
make(delete-old) || make(delete-old-dirs) || \ |
1434 |
|
|
make(delete-old-files) || make(delete-old-libs) |
1435 |
laffer1 |
5 |
|
1436 |
|
|
# |
1437 |
|
|
# check for / delete old files section |
1438 |
|
|
# |
1439 |
|
|
|
1440 |
|
|
.include "ObsoleteFiles.inc" |
1441 |
|
|
|
1442 |
|
|
OLD_LIBS_MESSAGE="Please be sure no application still uses those libraries, \ |
1443 |
|
|
else you can not start such an application. Consult UPDATING for more \ |
1444 |
|
|
information regarding how to cope with the removal/revision bump of a \ |
1445 |
|
|
specific library." |
1446 |
|
|
|
1447 |
|
|
.if !defined(BATCH_DELETE_OLD_FILES) |
1448 |
|
|
RM_I=-i |
1449 |
|
|
.else |
1450 |
|
|
RM_I=-v |
1451 |
|
|
.endif |
1452 |
|
|
|
1453 |
|
|
delete-old-files: |
1454 |
|
|
@echo ">>> Removing old files (only deletes safe to delete libs)" |
1455 |
|
|
# Ask for every old file if the user really wants to remove it. |
1456 |
|
|
# It's annoying, but better safe than sorry. |
1457 |
laffer1 |
4290 |
# NB: We cannot pass the list of OLD_FILES as a parameter because the |
1458 |
|
|
# argument list will get too long. Using .for/.endfor make "loops" will make |
1459 |
|
|
# the Makefile parser segfault. |
1460 |
|
|
@exec 3<&0; \ |
1461 |
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1462 |
|
|
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \ |
1463 |
|
|
while read file; do \ |
1464 |
laffer1 |
1926 |
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ |
1465 |
|
|
chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ |
1466 |
laffer1 |
4290 |
rm ${RM_I} "${DESTDIR}/$${file}" <&3; \ |
1467 |
laffer1 |
1926 |
fi; \ |
1468 |
|
|
done |
1469 |
laffer1 |
5 |
# Remove catpages without corresponding manpages. |
1470 |
laffer1 |
4290 |
@exec 3<&0; \ |
1471 |
laffer1 |
5 |
find ${DESTDIR}/usr/share/man/cat* ! -type d | \ |
1472 |
|
|
sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ |
1473 |
|
|
while read catpage; do \ |
1474 |
|
|
read manpage; \ |
1475 |
|
|
if [ ! -e "$${manpage}" ]; then \ |
1476 |
laffer1 |
4290 |
rm ${RM_I} $${catpage} <&3; \ |
1477 |
laffer1 |
5 |
fi; \ |
1478 |
|
|
done |
1479 |
|
|
@echo ">>> Old files removed" |
1480 |
|
|
|
1481 |
|
|
check-old-files: |
1482 |
|
|
@echo ">>> Checking for old files" |
1483 |
laffer1 |
4290 |
@${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1484 |
|
|
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \ |
1485 |
|
|
while read file; do \ |
1486 |
laffer1 |
1926 |
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ |
1487 |
|
|
echo "${DESTDIR}/$${file}"; \ |
1488 |
|
|
fi; \ |
1489 |
|
|
done |
1490 |
laffer1 |
5 |
# Check for catpages without corresponding manpages. |
1491 |
|
|
@find ${DESTDIR}/usr/share/man/cat* ! -type d | \ |
1492 |
|
|
sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ |
1493 |
|
|
while read catpage; do \ |
1494 |
|
|
read manpage; \ |
1495 |
|
|
if [ ! -e "$${manpage}" ]; then \ |
1496 |
laffer1 |
4290 |
echo $${catpage}; \ |
1497 |
laffer1 |
5 |
fi; \ |
1498 |
|
|
done |
1499 |
|
|
|
1500 |
|
|
delete-old-libs: |
1501 |
|
|
@echo ">>> Removing old libraries" |
1502 |
|
|
@echo "${OLD_LIBS_MESSAGE}" | fmt |
1503 |
laffer1 |
4290 |
@exec 3<&0; \ |
1504 |
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1505 |
|
|
-V OLD_LIBS | xargs -n1 | \ |
1506 |
|
|
while read file; do \ |
1507 |
laffer1 |
1926 |
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ |
1508 |
|
|
chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \ |
1509 |
laffer1 |
4290 |
rm ${RM_I} "${DESTDIR}/$${file}" <&3; \ |
1510 |
laffer1 |
1926 |
fi; \ |
1511 |
|
|
done |
1512 |
laffer1 |
5 |
@echo ">>> Old libraries removed" |
1513 |
|
|
|
1514 |
|
|
check-old-libs: |
1515 |
|
|
@echo ">>> Checking for old libraries" |
1516 |
laffer1 |
4290 |
@${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1517 |
|
|
-V OLD_LIBS | xargs -n1 | \ |
1518 |
|
|
while read file; do \ |
1519 |
laffer1 |
1926 |
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ |
1520 |
|
|
echo "${DESTDIR}/$${file}"; \ |
1521 |
|
|
fi; \ |
1522 |
|
|
done |
1523 |
laffer1 |
5 |
|
1524 |
|
|
delete-old-dirs: |
1525 |
|
|
@echo ">>> Removing old directories" |
1526 |
laffer1 |
4290 |
@${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1527 |
|
|
-V OLD_DIRS | xargs -n1 | \ |
1528 |
|
|
while read dir; do \ |
1529 |
laffer1 |
1926 |
if [ -d "${DESTDIR}/$${dir}" ]; then \ |
1530 |
|
|
rmdir -v "${DESTDIR}/$${dir}" || true; \ |
1531 |
|
|
elif [ -L "${DESTDIR}/$${dir}" ]; then \ |
1532 |
|
|
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ |
1533 |
|
|
fi; \ |
1534 |
|
|
done |
1535 |
laffer1 |
5 |
@echo ">>> Old directories removed" |
1536 |
|
|
|
1537 |
|
|
check-old-dirs: |
1538 |
|
|
@echo ">>> Checking for old directories" |
1539 |
laffer1 |
4290 |
@${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \ |
1540 |
|
|
-V OLD_DIRS | xargs -n1 | \ |
1541 |
|
|
while read dir; do \ |
1542 |
laffer1 |
1926 |
if [ -d "${DESTDIR}/$${dir}" ]; then \ |
1543 |
|
|
echo "${DESTDIR}/$${dir}"; \ |
1544 |
|
|
elif [ -L "${DESTDIR}/$${dir}" ]; then \ |
1545 |
|
|
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ |
1546 |
|
|
fi; \ |
1547 |
|
|
done |
1548 |
laffer1 |
5 |
|
1549 |
|
|
delete-old: delete-old-files delete-old-dirs |
1550 |
|
|
@echo "To remove old libraries run '${MAKE} delete-old-libs'." |
1551 |
|
|
|
1552 |
|
|
check-old: check-old-files check-old-libs check-old-dirs |
1553 |
|
|
@echo "To remove old files and directories run '${MAKE} delete-old'." |
1554 |
|
|
@echo "To remove old libraries run '${MAKE} delete-old-libs'." |
1555 |
|
|
|
1556 |
|
|
.endif |
1557 |
|
|
|
1558 |
laffer1 |
1925 |
# |
1559 |
|
|
# showconfig - show build configuration. |
1560 |
|
|
# |
1561 |
|
|
showconfig: |
1562 |
|
|
@${MAKE} -n -f bsd.own.mk -V dummy -dg1 | grep ^MK_ | sort |
1563 |
laffer1 |
5123 |
|
1564 |
|
|
.if !empty(KRNLOBJDIR) && !empty(KERNCONF) |
1565 |
|
|
DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/ |
1566 |
|
|
|
1567 |
|
|
.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE) |
1568 |
|
|
.if exists(${KERNCONFDIR}/${KERNCONF}) |
1569 |
|
|
FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \ |
1570 |
|
|
${KERNCONFDIR}/${KERNCONF} |
1571 |
|
|
.endif |
1572 |
|
|
.endif |
1573 |
|
|
|
1574 |
|
|
.endif |
1575 |
|
|
|
1576 |
|
|
.if !defined(DTBOUTPUTPATH) || !exists(${DTBOUTPUTPATH}) |
1577 |
|
|
DTBOUTPUTPATH= ${.CURDIR} |
1578 |
|
|
.endif |
1579 |
|
|
|
1580 |
|
|
# |
1581 |
|
|
# Build 'standalone' Device Tree Blob |
1582 |
|
|
# |
1583 |
|
|
builddtb: |
1584 |
|
|
@if [ "${FDT_DTS_FILE}" = "" ]; then \ |
1585 |
|
|
echo "ERROR: FDT_DTS_FILE must be specified!"; \ |
1586 |
|
|
exit 1; \ |
1587 |
|
|
fi; \ |
1588 |
|
|
if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} ]; then \ |
1589 |
|
|
echo "ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \ |
1590 |
|
|
exist!"; \ |
1591 |
|
|
exit 1; \ |
1592 |
|
|
fi; \ |
1593 |
|
|
if [ "${DTBOUTPUTPATH}" = "${.CURDIR}" ]; then \ |
1594 |
|
|
echo "WARNING: DTB will be placed in the current working \ |
1595 |
|
|
directory"; \ |
1596 |
|
|
fi |
1597 |
|
|
@PATH=${TMPPATH} \ |
1598 |
|
|
dtc -O dtb -o \ |
1599 |
|
|
${DTBOUTPUTPATH}/`echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 \ |
1600 |
|
|
-p 1024 ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} |
1601 |
|
|
|
1602 |
|
|
############### |
1603 |
|
|
|
1604 |
|
|
.if defined(XDEV) && defined(XDEV_ARCH) |
1605 |
|
|
|
1606 |
|
|
.if ${XDEV} == ${MACHINE} && ${XDEV_ARCH} == ${MACHINE_ARCH} |
1607 |
|
|
XDEV_CPUTYPE?=${CPUTYPE} |
1608 |
|
|
.else |
1609 |
|
|
XDEV_CPUTYPE?=${TARGET_CPUTYPE} |
1610 |
|
|
.endif |
1611 |
|
|
|
1612 |
|
|
NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \ |
1613 |
|
|
-DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE \ |
1614 |
|
|
-DWITHOUT_KERBEROS -DWITHOUT_RESCUE -DNO_WARNS \ |
1615 |
|
|
TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ |
1616 |
|
|
CPUTYPE=${XDEV_CPUTYPE} |
1617 |
|
|
|
1618 |
|
|
XDDIR=${XDEV_ARCH}-midnightbsd |
1619 |
|
|
XDTP=/usr/${XDDIR} |
1620 |
|
|
CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} |
1621 |
|
|
CDENV= ${CDBENV} \ |
1622 |
|
|
_SHLIBDIRPREFIX=${XDTP} \ |
1623 |
|
|
TOOLS_PREFIX=${XDTP} |
1624 |
|
|
CD2ENV=${CDENV} \ |
1625 |
|
|
MACHINE=${XDEV} MACHINE_ARCH=${XDEV_ARCH} |
1626 |
|
|
|
1627 |
|
|
CDTMP= ${MAKEOBJDIRPREFIX}/${XDEV}/${.CURDIR}/tmp |
1628 |
|
|
CDMAKE=${CDENV} ${MAKE} ${NOFUN} |
1629 |
|
|
CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDTP}/usr/bin:${PATH} ${MAKE} ${NOFUN} |
1630 |
|
|
XDDESTDIR=${DESTDIR}${XDTP} |
1631 |
|
|
.if !defined(OSREL) |
1632 |
|
|
OSREL!= uname -r | sed -e 's/[-(].*//' |
1633 |
|
|
.endif |
1634 |
|
|
|
1635 |
|
|
.ORDER: xdev-build xdev-install |
1636 |
|
|
xdev: xdev-build xdev-install |
1637 |
|
|
|
1638 |
|
|
.ORDER: _xb-build-tools _xb-cross-tools |
1639 |
|
|
xdev-build: _xb-build-tools _xb-cross-tools |
1640 |
|
|
|
1641 |
|
|
_xb-build-tools: |
1642 |
|
|
${_+_}@cd ${.CURDIR}; \ |
1643 |
|
|
${CDBENV} ${MAKE} -f Makefile.inc1 ${NOFUN} build-tools |
1644 |
|
|
|
1645 |
|
|
_xb-cross-tools: |
1646 |
|
|
.for _tool in \ |
1647 |
|
|
gnu/usr.bin/binutils \ |
1648 |
|
|
gnu/usr.bin/cc \ |
1649 |
|
|
usr.bin/ar |
1650 |
|
|
${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ |
1651 |
|
|
cd ${.CURDIR}/${_tool}; \ |
1652 |
|
|
${CDMAKE} DIRPRFX=${_tool}/ obj; \ |
1653 |
|
|
${CDMAKE} DIRPRFX=${_tool}/ depend; \ |
1654 |
|
|
${CDMAKE} DIRPRFX=${_tool}/ all |
1655 |
|
|
.endfor |
1656 |
|
|
|
1657 |
|
|
_xi-mtree: |
1658 |
|
|
${_+_}@${ECHODIR} "mtree populating ${XDDESTDIR}" |
1659 |
|
|
mkdir -p ${XDDESTDIR} |
1660 |
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \ |
1661 |
|
|
-p ${XDDESTDIR} >/dev/null |
1662 |
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ |
1663 |
|
|
-p ${XDDESTDIR}/usr >/dev/null |
1664 |
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ |
1665 |
|
|
-p ${XDDESTDIR}/usr/include >/dev/null |
1666 |
|
|
|
1667 |
|
|
.ORDER: _xi-mtree _xi-cross-tools _xi-includes _xi-libraries _xi-links |
1668 |
|
|
xdev-install: _xi-mtree _xi-cross-tools _xi-includes _xi-libraries _xi-links |
1669 |
|
|
|
1670 |
|
|
_xi-cross-tools: |
1671 |
|
|
@echo "_xi-cross-tools" |
1672 |
|
|
.for _tool in \ |
1673 |
|
|
gnu/usr.bin/binutils \ |
1674 |
|
|
gnu/usr.bin/cc \ |
1675 |
|
|
usr.bin/ar |
1676 |
|
|
${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \ |
1677 |
|
|
cd ${.CURDIR}/${_tool}; \ |
1678 |
|
|
${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR} |
1679 |
|
|
.endfor |
1680 |
|
|
|
1681 |
|
|
_xi-includes: |
1682 |
|
|
${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 par-includes \ |
1683 |
|
|
DESTDIR=${XDDESTDIR} |
1684 |
|
|
|
1685 |
|
|
_xi-libraries: |
1686 |
|
|
${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 libraries \ |
1687 |
|
|
DESTDIR=${XDDESTDIR} |
1688 |
|
|
|
1689 |
|
|
_xi-links: |
1690 |
|
|
${_+_}cd ${XDDESTDIR}/usr/bin; \ |
1691 |
|
|
for i in *; do \ |
1692 |
|
|
ln -sf ../../${XDTP}/usr/bin/$$i \ |
1693 |
|
|
../../../../usr/bin/${XDDIR}-$$i; \ |
1694 |
|
|
ln -sf ../../${XDTP}/usr/bin/$$i \ |
1695 |
|
|
../../../../usr/bin/${XDDIR}${OSREL}-$$i; \ |
1696 |
|
|
done |
1697 |
|
|
.endif |