4 # Make command line options:
5 # -DMAKE_KERBEROS4 to build KerberosIV
6 # -DMAKE_KERBEROS5 to build Kerberos5
7 # -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
8 # -DNOCLEAN do not clean at all
9 # -DNOCRYPT will prevent building of crypt versions
10 # -DNOPROFILE do not build profiled libraries
11 # -DNOSECURE do not go into secure subdir
12 # -DNOGAMES do not go into games subdir
13 # -DNOSHARE do not go into share subdir
14 # -DNOINFO do not make or install info files
15 # -DNOLIBC_R do not build libc_r.
16 # -DNO_FORTRAN do not build g77 and related libraries.
17 # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
18 # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
19 # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
20 # -DNO_PORTSUPDATE do not update ports in ${MAKE} update
21 # -DNO_DOCUPDATE do not update doc in ${MAKE} update
22 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
23 # TARGET_ARCH="arch" to crossbuild world to a different arch
26 # The intended user-driven targets are:
27 # buildworld - rebuild *everything*, including glue to help do upgrades
28 # installworld- install everything built by "buildworld"
29 # update - convenient way to update your source tree (eg: sup/cvs)
30 # most - build user commands, no libraries or include files
31 # installmost - install user commands, no libraries or include files
33 # Standard targets (not defined here) are documented in the makefiles in
34 # /usr/share/mk. These include:
35 # obj depend all install clean cleandepend cleanobj
37 # Put initial settings here.
40 # We must do share/info early so that installation of info `dir'
41 # entries works correctly. Do it first since it is less likely to
42 # grow dependencies on include and lib than vice versa.
43 .if exists(${.CURDIR}/share/info)
47 # We must do include and lib early so that the perl *.ph generation
48 # works correctly as it uses the header files installed by this.
49 .if exists(${.CURDIR}/include)
52 .if exists(${.CURDIR}/lib)
56 .if exists(${.CURDIR}/bin)
59 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
62 .if exists(${.CURDIR}/gnu)
65 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
66 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS4)
69 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
70 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS5)
73 .if exists(${.CURDIR}/libexec)
76 .if exists(${.CURDIR}/sbin)
79 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
82 .if exists(${.CURDIR}/sys)
85 .if exists(${.CURDIR}/usr.bin)
88 .if exists(${.CURDIR}/usr.sbin)
91 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
95 # etc must be last for "distribute" to work
96 .if exists(${.CURDIR}/etc)
100 # These are last, since it is nice to at least get the base system
101 # rebuilt before you do them.
102 .if defined(LOCAL_DIRS)
103 .for _DIR in ${LOCAL_DIRS}
104 .if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
110 .if defined(NOCLEANDIR)
111 CLEANDIR= clean cleandepend
117 SUPFLAGS?= -g -L 2 -P -
119 SUPFLAGS+= -h ${SUPHOST}
122 MAKEOBJDIRPREFIX?= /usr/obj
123 TARGET_ARCH?= ${MACHINE_ARCH}
126 BUILD_ARCH!= sysctl -n hw.machine_arch
127 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
128 .error To cross-build, set TARGET_ARCH.
131 .if ${MACHINE_ARCH} == ${TARGET_ARCH}
132 OBJTREE= ${MAKEOBJDIRPREFIX}
134 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET_ARCH}
136 WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
137 # /usr/games added for fortune which depend on strfile
138 STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
139 TMPPATH= ${STRICTTMPPATH}:${PATH}
140 OBJFORMAT_PATH?= /usr/libexec
144 INSTALLTMP= ${TMPDIR}/install.${TMPPID}
147 # Building a world goes through the following stages
149 # 1. bootstrap-tool stage [BMAKE]
150 # This stage is responsible for creating programs that
151 # are needed for backward compatibility reasons. They
152 # are not built as cross-tools.
153 # 2. build-tool stage [TMAKE]
154 # This stage is responsible for creating the object
155 # tree and building any tools that are needed during
157 # 3. cross-tool stage [XMAKE]
158 # This stage is responsible for creating any tools that
159 # are needed for cross-builds. A cross-compiler is one
161 # 4. world stage [WMAKE]
162 # This stage actually builds the world.
163 # 5. install stage (optional) [IMAKE]
164 # This stage installs a previously built world.
167 # Common environment for world related stages
168 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
169 MACHINE_ARCH=${TARGET_ARCH} \
171 COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \
172 LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib \
173 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
174 CFLAGS="-nostdinc ${CFLAGS}" \
175 CXXINCLUDES="-nostdinc++ ${CXXINCLUDES}" \
176 PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.6.0 \
177 GROFF_BIN_PATH=${WORLDTMP}/usr/bin \
178 GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \
179 GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac
181 # bootstrap-tool stage
182 BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
184 INSTALL="sh ${.CURDIR}/tools/install.sh"
185 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
186 -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED
189 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
191 INSTALL="sh ${.CURDIR}/tools/install.sh"
192 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1
195 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
198 WMAKEENV= ${CROSSENV} \
199 DESTDIR=${WORLDTMP} \
200 INSTALL="sh ${.CURDIR}/tools/install.sh" \
202 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
205 IMAKEENV= ${CROSSENV} \
206 PATH=${STRICTTMPPATH}:${INSTALLTMP}
207 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
210 KMAKEENV= ${WMAKEENV} \
211 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec:${OBJFORMAT_PATH}
213 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
214 usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc \
216 usr/share/groff_font/devX100 \
217 usr/share/groff_font/devX100-12 \
218 usr/share/groff_font/devX75 \
219 usr/share/groff_font/devX75-12 \
220 usr/share/groff_font/devascii \
221 usr/share/groff_font/devcp1047 \
222 usr/share/groff_font/devdvi \
223 usr/share/groff_font/devhtml \
224 usr/share/groff_font/devkoi8-r \
225 usr/share/groff_font/devlatin1 \
226 usr/share/groff_font/devlbp \
227 usr/share/groff_font/devlj4 \
228 usr/share/groff_font/devps \
229 usr/share/groff_font/devutf8 \
230 usr/share/tmac/mdoc usr/share/tmac/mm
232 INCDIRS= arpa g++/std isc objc protocols readline rpc rpcsvc openssl \
238 # Attempt to rebuild the entire system, with reasonable chance of
239 # success, regardless of how old your existing system is.
243 @echo "--------------------------------------------------------------"
244 @echo ">>> Rebuilding the temporary build tree"
245 @echo "--------------------------------------------------------------"
246 .if !defined(NOCLEAN)
249 .for _dir in ${USRDIRS}
250 mkdir -p ${WORLDTMP}/${_dir}
252 .for _dir in ${INCDIRS}
253 mkdir -p ${WORLDTMP}/usr/include/${_dir}
255 ln -sf ${.CURDIR}/sys ${WORLDTMP}
257 @echo "--------------------------------------------------------------"
258 @echo ">>> stage 1: bootstrap tools"
259 @echo "--------------------------------------------------------------"
260 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
261 .if !defined(NOCLEAN)
263 @echo "--------------------------------------------------------------"
264 @echo ">>> stage 2: cleaning up the object tree"
265 @echo "--------------------------------------------------------------"
266 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
269 @echo "--------------------------------------------------------------"
270 @echo ">>> stage 2: rebuilding the object tree"
271 @echo "--------------------------------------------------------------"
272 cd ${.CURDIR}; ${WMAKE} par-obj
274 @echo "--------------------------------------------------------------"
275 @echo ">>> stage 2: build tools"
276 @echo "--------------------------------------------------------------"
277 cd ${.CURDIR}; ${TMAKE} build-tools
279 @echo "--------------------------------------------------------------"
280 @echo ">>> stage 3: cross tools"
281 @echo "--------------------------------------------------------------"
282 cd ${.CURDIR}; ${XMAKE} cross-tools
284 @echo "--------------------------------------------------------------"
285 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
286 @echo "--------------------------------------------------------------"
287 cd ${.CURDIR}; ${WMAKE} SHARED=copies includes
289 @echo "--------------------------------------------------------------"
290 @echo ">>> stage 4: building libraries"
291 @echo "--------------------------------------------------------------"
292 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
294 @echo "--------------------------------------------------------------"
295 @echo ">>> stage 4: make dependencies"
296 @echo "--------------------------------------------------------------"
297 cd ${.CURDIR}; ${WMAKE} par-depend
299 @echo "--------------------------------------------------------------"
300 @echo ">>> stage 4: building everything.."
301 @echo "--------------------------------------------------------------"
302 cd ${.CURDIR}; ${WMAKE} all
305 @echo "--------------------------------------------------------------"
306 @echo ">>> Building everything.."
307 @echo "--------------------------------------------------------------"
308 cd ${.CURDIR}; ${WMAKE} all
313 # Installs everything compiled by a 'buildworld'.
316 mkdir -p ${INSTALLTMP}
317 for prog in [ awk cat chflags chmod chown date echo egrep find grep \
318 ln make makewhatis mkdir mtree mv perl rm sed sh sysctl \
319 test true uname wc zic; do \
320 cp `which $$prog` ${INSTALLTMP}; \
322 cd ${.CURDIR}; ${IMAKE} reinstall
328 # If you have a build server, you can NFS mount the source and obj directories
329 # and do a 'make reinstall' on the *client* to install new binaries from the
330 # most recent server build.
333 @echo "--------------------------------------------------------------"
334 @echo ">>> Making hierarchy"
335 @echo "--------------------------------------------------------------"
336 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
338 @echo "--------------------------------------------------------------"
339 @echo ">>> Installing everything.."
340 @echo "--------------------------------------------------------------"
341 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
344 @echo "--------------------------------------------------------------"
345 @echo ">>> Rebuilding man page indices"
346 @echo "--------------------------------------------------------------"
347 cd ${.CURDIR}/share/man; ${MAKE} makedb
353 # Front-end to distribute to make sure the search path contains
354 # the object directory. Needed for miniperl.
357 cd ${.CURDIR}; PATH=${TMPPATH} ${MAKE} -f Makefile.inc1 distribute
360 # buildkernel and installkernel
362 # Which kernels to build and/or install is specified by setting
363 # KERNCONF. If not defined a GENERIC kernel is built/installed.
364 # Only the existing (depending TARGET) config files are used
365 # for building kernels and only the first of these is designated
366 # as the one being installed.
368 # Note that we have to use TARGET instead of TARGET_ARCH when
369 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
370 # be set to cross-build, we have to make sure TARGET is set
373 .if !defined(KERNCONF) && defined(KERNEL)
379 INSTKERNNAME?= kernel
381 # The only exotic TARGET_ARCH/TARGET combination valid at this
382 # time is i386/pc98. In all other cases set TARGET equal to
384 .if ${TARGET_ARCH} != "i386" || ${TARGET} != "pc98"
385 TARGET= ${TARGET_ARCH}
388 KRNLSRCDIR= ${.CURDIR}/sys
389 KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
390 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
391 KERNCONFDIR?= ${KRNLCONFDIR}
395 .for _kernel in ${KERNCONF}
396 .if exists(${KERNCONFDIR}/${_kernel})
397 BUILDKERNELS+= ${_kernel}
398 .if empty(INSTALLKERNEL)
399 INSTALLKERNEL= ${_kernel}
407 # Builds all kernels defined by BUILDKERNELS.
410 .if empty(BUILDKERNELS)
411 @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNCONF})."
414 .if defined(KERNWARN)
415 @echo "--------------------------------------------------------------"
416 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
417 @echo "--------------------------------------------------------------"
421 .for _kernel in ${BUILDKERNELS}
422 @echo "--------------------------------------------------------------"
423 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
424 @echo "--------------------------------------------------------------"
425 @echo "===> ${_kernel}"
426 mkdir -p ${KRNLOBJDIR}
427 .if !defined(NO_KERNELCONFIG)
430 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
431 ${KERNCONFDIR}/${_kernel}
433 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
434 cd ${KRNLOBJDIR}/${_kernel}; \
435 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} clean
437 cd ${KRNLOBJDIR}/${_kernel}; \
438 MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx/aicasm \
439 ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/aicasm/Makefile
440 .if !defined(NO_KERNELDEPEND)
441 cd ${KRNLOBJDIR}/${_kernel}; \
442 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
444 cd ${KRNLOBJDIR}/${_kernel}; \
445 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
446 @echo "--------------------------------------------------------------"
447 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
448 @echo "--------------------------------------------------------------"
454 # Install the kernel defined by INSTALLKERNEL
457 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
458 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} install
460 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
461 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} reinstall
466 # Short hand for `make buildkernel installkernel'
468 kernel: buildkernel installkernel
473 # Update the source tree, by running sup and/or running cvs to update to the
477 .if defined(SUP_UPDATE)
478 @echo "--------------------------------------------------------------"
479 @echo ">>> Running ${SUP}"
480 @echo "--------------------------------------------------------------"
482 @${SUP} ${SUPFLAGS} ${SUPFILE}
484 .if defined(SUPFILE1)
485 @${SUP} ${SUPFLAGS} ${SUPFILE1}
487 .if defined(SUPFILE2)
488 @${SUP} ${SUPFLAGS} ${SUPFILE2}
490 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
491 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
493 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
494 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
497 .if defined(CVS_UPDATE)
498 @echo "--------------------------------------------------------------"
499 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
500 @echo "--------------------------------------------------------------"
501 cd ${.CURDIR}; cvs -q update -A -P -d
507 # Build most of the user binaries on the existing system libs and includes.
510 @echo "--------------------------------------------------------------"
511 @echo ">>> Building programs only"
512 @echo "--------------------------------------------------------------"
513 cd ${.CURDIR}/bin; ${MAKE} all
514 cd ${.CURDIR}/sbin; ${MAKE} all
515 cd ${.CURDIR}/libexec; ${MAKE} all
516 cd ${.CURDIR}/usr.bin; ${MAKE} all
517 cd ${.CURDIR}/usr.sbin; ${MAKE} all
518 cd ${.CURDIR}/gnu/libexec; ${MAKE} all
519 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} all
520 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} all
525 # Install the binaries built by the 'most' target. This does not include
526 # libraries or include files.
529 @echo "--------------------------------------------------------------"
530 @echo ">>> Installing programs only"
531 @echo "--------------------------------------------------------------"
532 cd ${.CURDIR}/bin; ${MAKE} install
533 cd ${.CURDIR}/sbin; ${MAKE} install
534 cd ${.CURDIR}/libexec; ${MAKE} install
535 cd ${.CURDIR}/usr.bin; ${MAKE} install
536 cd ${.CURDIR}/usr.sbin; ${MAKE} install
537 cd ${.CURDIR}/gnu/libexec; ${MAKE} install
538 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} install
539 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} install
542 # ------------------------------------------------------------------------
544 # From here onwards are utility targets used by the 'make world' and
545 # related targets. If your 'world' breaks, you may like to try to fix
546 # the problem and manually run the following targets to attempt to
547 # complete the build. Beware, this is *not* guaranteed to work, you
548 # need to have a pretty good grip on the current state of the system
549 # to attempt to manually finish it. If in doubt, 'make world' again.
553 # bootstrap-tools: Build tools needed for compatibility
555 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
556 _strfile= games/fortune/strfile
560 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef usr.bin/xinstall \
561 usr.sbin/config usr.sbin/kbdcontrol \
562 gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo
563 cd ${.CURDIR}/${_tool}; \
567 ${MAKE} DESTDIR=${MAKEOBJDIRPREFIX} install
571 # build-tools: Build special purpose build tools
573 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
574 _games= games/adventure games/hack games/phantasia
577 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
578 _share= share/syscons/scrnmaps
581 .if !defined(NO_FORTRAN)
582 _fortran= gnu/usr.bin/cc/f771
586 _perl= gnu/usr.bin/perl/miniperl
589 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
590 !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
591 _libroken4= kerberosIV/lib/libroken
594 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
595 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
596 _libkrb5= kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
600 .for _tool in bin/csh bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
601 ${_perl} ${_libroken4} ${_libkrb5} lib/libncurses ${_share} usr.bin/awk \
602 usr.bin/file usr.sbin/sysinstall
603 cd ${.CURDIR}/${_tool}; ${MAKE} build-tools
607 # cross-tools: Build cross-building tools
609 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
610 _elf2exe= usr.sbin/elf2exe
613 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
614 _btxld= usr.sbin/btxld
618 .for _tool in ${_btxld} ${_elf2exe} \
619 gnu/usr.bin/binutils usr.bin/objformat gnu/usr.bin/cc
620 cd ${.CURDIR}/${_tool}; \
624 ${MAKE} DESTDIR=${MAKEOBJDIRPREFIX} install
628 # hierarchy - ensure that all the needed directories are present
631 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
634 # includes - possibly generate and install the include files.
637 cd ${.CURDIR}/include; ${MAKE} -B all install
638 cd ${.CURDIR}/gnu/include; ${MAKE} install
639 cd ${.CURDIR}/gnu/lib/libobjc; ${MAKE} beforeinstall
640 cd ${.CURDIR}/gnu/lib/libreadline/readline; ${MAKE} beforeinstall
641 cd ${.CURDIR}/gnu/lib/libregex; ${MAKE} beforeinstall
642 cd ${.CURDIR}/gnu/lib/libstdc++; ${MAKE} beforeinstall
643 cd ${.CURDIR}/gnu/lib/libdialog; ${MAKE} beforeinstall
644 cd ${.CURDIR}/gnu/usr.bin/cc/cc1plus; ${MAKE} beforeinstall
645 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
646 .if exists(${.CURDIR}/secure/lib/libcrypto)
647 cd ${.CURDIR}/secure/lib/libcrypto; ${MAKE} beforeinstall
649 .if exists(${.CURDIR}/secure/lib/libssl)
650 cd ${.CURDIR}/secure/lib/libssl; ${MAKE} beforeinstall
653 .if exists(${.CURDIR}/kerberosIV) && !defined(NOCRYPT) && \
654 defined(MAKE_KERBEROS4)
655 cd ${.CURDIR}/kerberosIV/lib/libacl; ${MAKE} beforeinstall
656 cd ${.CURDIR}/kerberosIV/lib/libkadm; ${MAKE} beforeinstall
657 cd ${.CURDIR}/kerberosIV/lib/libkafs; ${MAKE} beforeinstall
658 cd ${.CURDIR}/kerberosIV/lib/libkdb; ${MAKE} beforeinstall
659 cd ${.CURDIR}/kerberosIV/lib/libkrb; ${MAKE} beforeinstall
660 cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall
661 .elif exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
662 cd ${.CURDIR}/secure/lib/libtelnet; ${MAKE} beforeinstall
664 cd ${.CURDIR}/lib/libtelnet; ${MAKE} beforeinstall
666 .if exists(${.CURDIR}/kerberos5) && !defined(NOCRYPT) && \
667 defined(MAKE_KERBEROS5)
668 cd ${.CURDIR}/kerberos5/lib/libasn1; ${MAKE} beforeinstall
669 cd ${.CURDIR}/kerberos5/lib/libhdb; ${MAKE} beforeinstall
670 cd ${.CURDIR}/kerberos5/lib/libkadm5clnt; ${MAKE} beforeinstall
671 cd ${.CURDIR}/kerberos5/lib/libkadm5srv; ${MAKE} beforeinstall
672 cd ${.CURDIR}/kerberos5/lib/libkafs5; ${MAKE} beforeinstall
673 cd ${.CURDIR}/kerberos5/lib/libkrb5; ${MAKE} beforeinstall
674 cd ${.CURDIR}/kerberos5/lib/libsl; ${MAKE} beforeinstall
676 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
677 cd ${.CURDIR}/lib/csu/${MACHINE_ARCH}; ${MAKE} beforeinstall
679 cd ${.CURDIR}/gnu/lib/csu; ${MAKE} beforeinstall
680 cd ${.CURDIR}/lib/libalias; ${MAKE} beforeinstall
681 cd ${.CURDIR}/lib/libatm; ${MAKE} beforeinstall
682 cd ${.CURDIR}/lib/libdevstat; ${MAKE} beforeinstall
683 cd ${.CURDIR}/lib/libc; ${MAKE} beforeinstall
684 cd ${.CURDIR}/lib/libcalendar; ${MAKE} beforeinstall
685 cd ${.CURDIR}/lib/libcam; ${MAKE} beforeinstall
686 cd ${.CURDIR}/lib/libdisk; ${MAKE} beforeinstall
687 cd ${.CURDIR}/lib/libedit; ${MAKE} beforeinstall
688 cd ${.CURDIR}/lib/libfetch; ${MAKE} beforeinstall
689 cd ${.CURDIR}/lib/libftpio; ${MAKE} beforeinstall
690 cd ${.CURDIR}/lib/libkvm; ${MAKE} beforeinstall
691 cd ${.CURDIR}/lib/libmd; ${MAKE} beforeinstall
692 cd ${.CURDIR}/lib/libmp; ${MAKE} beforeinstall
693 .if !defined(WANT_CSRG_LIBM)
694 cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall
696 cd ${.CURDIR}/lib/libncp; ${MAKE} beforeinstall
697 cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall
698 cd ${.CURDIR}/lib/libnetgraph; ${MAKE} beforeinstall
699 cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall
700 cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall
701 cd ${.CURDIR}/lib/libradius; ${MAKE} beforeinstall
702 cd ${.CURDIR}/lib/librpcsvc; ${MAKE} beforeinstall
703 cd ${.CURDIR}/lib/libpam/libpam; ${MAKE} beforeinstall
704 cd ${.CURDIR}/lib/libsbuf; ${MAKE} beforeinstall
705 cd ${.CURDIR}/lib/libstand; ${MAKE} beforeinstall
706 cd ${.CURDIR}/lib/libtacplus; ${MAKE} beforeinstall
707 cd ${.CURDIR}/lib/libcom_err; ${MAKE} beforeinstall
708 cd ${.CURDIR}/lib/libutil; ${MAKE} beforeinstall
709 cd ${.CURDIR}/lib/libvgl; ${MAKE} beforeinstall
710 cd ${.CURDIR}/lib/libwrap; ${MAKE} beforeinstall
711 cd ${.CURDIR}/lib/libz; ${MAKE} beforeinstall
712 cd ${.CURDIR}/usr.bin/lex; ${MAKE} beforeinstall
715 # libraries - build all libraries, and install them under ${DESTDIR}.
717 # The following dependencies exist between the libraries:
719 # lib*: csu libgcc_pic
724 # libdialog: libncurses
725 # libedit: libncurses
729 # libpam: libcom_err libcrypt libcrypto libkrb libopie libradius \
730 # librpcsvc libtacplus libutil libz libssh
732 # libreadline: libncurses
736 # Across directories this comes down to (rougly):
738 # gnu/lib: lib/libm lib/libncurses
739 # kerberosIV/lib kerberos5/lib: lib/libcrypt
740 # lib/libpam: secure/lib/libcrypto kerberosIV/lib/libkrb \
741 # secure/lib/libssh lib/libz
742 # secure/lib: lib/libmd
744 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}.pcc)
745 _csu= lib/csu/${MACHINE_ARCH}.pcc
746 .elif ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf"
747 _csu= lib/csu/i386-elf
749 _csu= lib/csu/${MACHINE_ARCH}
752 .if !defined(NOSECURE) && !defined(NOCRYPT)
753 _secure_lib= secure/lib
756 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
757 _kerberosIV_lib= kerberosIV/lib
760 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
761 _kerberos5_lib= kerberos5/lib
764 .if defined(WANT_CSRG_LIBM)
770 .if ${MACHINE_ARCH} == "i386"
771 _libkeycap= usr.sbin/pcvt/keycap
775 _libperl= gnu/usr.bin/perl/libperl
779 .for _lib in ${_csu} gnu/lib/csu gnu/lib/libgcc lib/libmd lib/libcrypt \
780 ${_secure_lib} ${_kerberosIV_lib} \
781 ${_kerberos5_lib} lib/libcom_err lib/libkvm ${_libm} lib/libncurses \
782 lib/libopie lib/libradius lib/librpcsvc lib/libsbuf lib/libtacplus \
783 lib/libutil lib/libz lib gnu/lib ${_libperl} usr.bin/lex/lib ${_libkeycap}
784 .if exists(${.CURDIR}/${_lib})
785 cd ${.CURDIR}/${_lib}; \
792 .for __target in clean cleandepend cleandir depend obj
793 .for entry in ${SUBDIR}
794 ${entry}.${__target}__D: .PHONY
795 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
796 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
797 edir=${entry}.${MACHINE_ARCH}; \
798 cd ${.CURDIR}/$${edir}; \
800 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
802 cd ${.CURDIR}/$${edir}; \
804 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
806 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
809 .include <bsd.subdir.mk>