ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/src/trunk/Makefile.inc1
Revision: 2744
Committed: Sun Apr 5 23:35:06 2009 UTC (15 years ago) by laffer1
File size: 37471 byte(s)
Log Message:
drop the pc98 arch and set the amd64 32bit libs up so that they work on all amd64 compatible cpus.  also enable the VERSION var for a future project

File Contents

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

Properties

Name Value
cvs2svn:cvs-rev 1.16