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_PERL do not build perl5 and related libraries
21 # -DNO_PORTSUPDATE do not update ports in ${MAKE} update
22 # -DNO_DOCUPDATE do not update doc in ${MAKE} update
23 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
24 # TARGET_ARCH="arch" to crossbuild world to a different arch
27 # The intended user-driven targets are:
28 # buildworld - rebuild *everything*, including glue to help do upgrades
29 # installworld- install everything built by "buildworld"
30 # update - convenient way to update your source tree (eg: sup/cvs)
31 # most - build user commands, no libraries or include files
32 # installmost - install user commands, no libraries or include files
34 # Standard targets (not defined here) are documented in the makefiles in
35 # /usr/share/mk. These include:
36 # obj depend all install clean cleandepend cleanobj
38 # Put initial settings here.
41 # We must do share/info early so that installation of info `dir'
42 # entries works correctly. Do it first since it is less likely to
43 # grow dependencies on include and lib than vice versa.
44 .if exists(${.CURDIR}/share/info)
48 # We must do include and lib early so that the perl *.ph generation
49 # works correctly as it uses the header files installed by this.
50 .if exists(${.CURDIR}/include)
53 .if exists(${.CURDIR}/lib)
57 .if exists(${.CURDIR}/bin)
60 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
63 .if exists(${.CURDIR}/gnu)
66 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
67 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS4)
70 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
71 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS5)
74 .if exists(${.CURDIR}/libexec)
77 .if exists(${.CURDIR}/sbin)
80 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
83 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
86 .if exists(${.CURDIR}/sys)
89 .if exists(${.CURDIR}/usr.bin)
92 .if exists(${.CURDIR}/usr.sbin)
96 # etc must be last for "distribute" to work
97 .if exists(${.CURDIR}/etc)
101 # These are last, since it is nice to at least get the base system
102 # rebuilt before you do them.
103 .if defined(LOCAL_DIRS)
104 .for _DIR in ${LOCAL_DIRS}
105 .if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
111 .if defined(NOCLEANDIR)
112 CLEANDIR= clean cleandepend
117 CVSUP_COLLECTION_BASE?= src-all
118 CVSUP_BRANCH_BASE?= .
119 CVSUP_COLLECTION_PORTS?=ports-all
120 CVSUP_BRANCH_PORTS?= .
121 CVSUP_COLLECTION_DOC?= doc-all
127 CVSUP_HOST?= cvsup.freebsd.org
130 SUP?= /usr/local/bin/cvsup
131 SUPFLAGS?= -g -L 2 -P -
133 SUPFLAGS+= -h ${SUPHOST}
135 .if defined(CVSUP_COMPRESS)
140 .if !defined(CVSUP_HOST)
141 echo "Please set CVSUP_HOST to your nearest cvsup mirror."
145 SUPFILE?= /usr/share/examples/cvsup/standard-supfile
146 SUPFILE1?= /usr/share/examples/cvsup/secure-supfile
147 SUPFILE2?= /usr/share/examples/cvsup/secure-supfile
148 PORTSSUPFILE?= /usr/share/examples/cvsup/ports-supfile
149 DOCSUPFILE?= /usr/share/examples/cvsup/doc-supfile
152 echo "*default base=${CVSUP_BASE}"
153 echo "*default prefix=${CVSUP_PREFIX}"
154 echo "*default release=cvs tag=${CVSUP_BRANCH_FOO}"
155 echo "*default delete use-rel-suffix"
156 echo "${CVSUP_COLLECTION_FOO}"
158 MAKEOBJDIRPREFIX?= /usr/obj
159 TARGET_ARCH?= ${MACHINE_ARCH}
162 BUILD_ARCH!= sysctl -n hw.machine_arch
163 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
164 .error To cross-build, set TARGET_ARCH.
167 .if ${MACHINE_ARCH} == ${TARGET_ARCH}
168 OBJTREE= ${MAKEOBJDIRPREFIX}
170 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET_ARCH}
172 WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
173 # /usr/games added for fortune which depend on strfile
174 STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
175 TMPPATH= ${STRICTTMPPATH}:${PATH}
176 OBJFORMAT_PATH?= /usr/libexec
178 INSTALLTMP!= /usr/bin/mktemp -d -u -t install
181 # Building a world goes through the following stages
183 # 1. bootstrap-tool stage [BMAKE]
184 # This stage is responsible for creating programs that
185 # are needed for backward compatibility reasons. They
186 # are not built as cross-tools.
187 # 2. build-tool stage [TMAKE]
188 # This stage is responsible for creating the object
189 # tree and building any tools that are needed during
191 # 3. cross-tool stage [XMAKE]
192 # This stage is responsible for creating any tools that
193 # are needed for cross-builds. A cross-compiler is one
195 # 4. world stage [WMAKE]
196 # This stage actually builds the world.
197 # 5. install stage (optional) [IMAKE]
198 # This stage installs a previously built world.
201 # Common environment for world related stages
202 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
203 MACHINE_ARCH=${TARGET_ARCH} \
205 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
206 PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.6.1 \
207 GROFF_BIN_PATH=${WORLDTMP}/usr/bin \
208 GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \
209 GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac
211 # bootstrap-tool stage
212 BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
214 INSTALL="sh ${.CURDIR}/tools/install.sh"
215 BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
216 -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
220 TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
222 INSTALL="sh ${.CURDIR}/tools/install.sh"
223 TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING
226 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
229 WMAKEENV= ${CROSSENV} \
230 DESTDIR=${WORLDTMP} \
231 INSTALL="sh ${.CURDIR}/tools/install.sh" \
233 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
236 IMAKEENV= ${CROSSENV} \
237 PATH=${STRICTTMPPATH}:${INSTALLTMP}
238 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
241 KMAKEENV= ${WMAKEENV} \
242 OBJFORMAT_PATH=${WORLDTMP}/usr/libexec:${OBJFORMAT_PATH}
244 USRDIRS= usr/bin usr/lib/compat/aout usr/games usr/libdata/ldscripts \
245 usr/libexec/${OBJFORMAT} usr/sbin usr/share/misc \
247 usr/share/groff_font/devX100 \
248 usr/share/groff_font/devX100-12 \
249 usr/share/groff_font/devX75 \
250 usr/share/groff_font/devX75-12 \
251 usr/share/groff_font/devascii \
252 usr/share/groff_font/devcp1047 \
253 usr/share/groff_font/devdvi \
254 usr/share/groff_font/devhtml \
255 usr/share/groff_font/devkoi8-r \
256 usr/share/groff_font/devlatin1 \
257 usr/share/groff_font/devlbp \
258 usr/share/groff_font/devlj4 \
259 usr/share/groff_font/devps \
260 usr/share/groff_font/devutf8 \
261 usr/share/tmac/mdoc usr/share/tmac/mm
263 INCDIRS= arpa g++/std isc objc protocols readline rpc rpcsvc openssl \
269 # Attempt to rebuild the entire system, with reasonable chance of
270 # success, regardless of how old your existing system is.
274 @echo "--------------------------------------------------------------"
275 @echo ">>> Rebuilding the temporary build tree"
276 @echo "--------------------------------------------------------------"
277 .if !defined(NOCLEAN)
280 .for _dir in ${USRDIRS}
281 mkdir -p ${WORLDTMP}/${_dir}
283 .for _dir in ${INCDIRS}
284 mkdir -p ${WORLDTMP}/usr/include/${_dir}
286 ln -sf ${.CURDIR}/sys ${WORLDTMP}
288 @echo "--------------------------------------------------------------"
289 @echo ">>> stage 1: bootstrap tools"
290 @echo "--------------------------------------------------------------"
291 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
292 .if !defined(NOCLEAN)
294 @echo "--------------------------------------------------------------"
295 @echo ">>> stage 2: cleaning up the object tree"
296 @echo "--------------------------------------------------------------"
297 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
300 @echo "--------------------------------------------------------------"
301 @echo ">>> stage 2: rebuilding the object tree"
302 @echo "--------------------------------------------------------------"
303 cd ${.CURDIR}; ${WMAKE} par-obj
305 @echo "--------------------------------------------------------------"
306 @echo ">>> stage 2: build tools"
307 @echo "--------------------------------------------------------------"
308 cd ${.CURDIR}; ${TMAKE} build-tools
310 @echo "--------------------------------------------------------------"
311 @echo ">>> stage 3: cross tools"
312 @echo "--------------------------------------------------------------"
313 cd ${.CURDIR}; ${XMAKE} cross-tools
315 @echo "--------------------------------------------------------------"
316 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
317 @echo "--------------------------------------------------------------"
318 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks includes
320 @echo "--------------------------------------------------------------"
321 @echo ">>> stage 4: building libraries"
322 @echo "--------------------------------------------------------------"
323 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
325 @echo "--------------------------------------------------------------"
326 @echo ">>> stage 4: make dependencies"
327 @echo "--------------------------------------------------------------"
328 cd ${.CURDIR}; ${WMAKE} par-depend
330 @echo "--------------------------------------------------------------"
331 @echo ">>> stage 4: building everything.."
332 @echo "--------------------------------------------------------------"
333 cd ${.CURDIR}; ${WMAKE} all
336 @echo "--------------------------------------------------------------"
337 @echo ">>> Building everything.."
338 @echo "--------------------------------------------------------------"
339 cd ${.CURDIR}; ${WMAKE} all
344 # Installs everything compiled by a 'buildworld'.
347 mkdir -p ${INSTALLTMP}
348 for prog in [ awk cat chflags chmod chown date echo egrep find grep \
349 ln make makewhatis mkdir mtree mv perl rm sed sh sysctl \
350 test true uname wc zic; do \
351 cp `which $$prog` ${INSTALLTMP}; \
353 cd ${.CURDIR}; ${IMAKE} reinstall
359 # If you have a build server, you can NFS mount the source and obj directories
360 # and do a 'make reinstall' on the *client* to install new binaries from the
361 # most recent server build.
364 @echo "--------------------------------------------------------------"
365 @echo ">>> Making hierarchy"
366 @echo "--------------------------------------------------------------"
367 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
369 @echo "--------------------------------------------------------------"
370 @echo ">>> Installing everything.."
371 @echo "--------------------------------------------------------------"
372 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
375 @echo "--------------------------------------------------------------"
376 @echo ">>> Rebuilding man page indices"
377 @echo "--------------------------------------------------------------"
378 cd ${.CURDIR}/share/man; ${MAKE} makedb
384 # Front-end to distribute to make sure the search path contains
385 # the object directory. Needed for miniperl.
388 cd ${.CURDIR}; PATH=${TMPPATH} ${MAKE} -f Makefile.inc1 distribute
391 # buildkernel and installkernel
393 # Which kernels to build and/or install is specified by setting
394 # KERNCONF. If not defined a GENERIC kernel is built/installed.
395 # Only the existing (depending TARGET) config files are used
396 # for building kernels and only the first of these is designated
397 # as the one being installed.
399 # Note that we have to use TARGET instead of TARGET_ARCH when
400 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
401 # be set to cross-build, we have to make sure TARGET is set
404 .if !defined(KERNCONF) && defined(KERNEL)
410 INSTKERNNAME?= kernel
412 # The only exotic TARGET_ARCH/TARGET combination valid at this
413 # time is i386/pc98. In all other cases set TARGET equal to
415 .if ${TARGET_ARCH} != "i386" || ${TARGET} != "pc98"
416 TARGET= ${TARGET_ARCH}
419 KRNLSRCDIR= ${.CURDIR}/sys
420 KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
421 KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
422 KERNCONFDIR?= ${KRNLCONFDIR}
426 .for _kernel in ${KERNCONF}
427 .if exists(${KERNCONFDIR}/${_kernel})
428 BUILDKERNELS+= ${_kernel}
429 .if empty(INSTALLKERNEL)
430 INSTALLKERNEL= ${_kernel}
438 # Builds all kernels defined by BUILDKERNELS.
441 .if empty(BUILDKERNELS)
442 @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNCONF})."
445 .if defined(KERNWARN)
446 @echo "--------------------------------------------------------------"
447 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
448 @echo "--------------------------------------------------------------"
452 .for _kernel in ${BUILDKERNELS}
453 @echo "--------------------------------------------------------------"
454 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
455 @echo "--------------------------------------------------------------"
456 @echo "===> ${_kernel}"
457 mkdir -p ${KRNLOBJDIR}
458 .if !defined(NO_KERNELCONFIG)
461 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
462 ${KERNCONFDIR}/${_kernel}
464 .if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
465 .if defined(MODULES_WITH_WORLD) || defined(NO_MODULES) || !exists(${KRNLSRCDIR}/modules)
466 cd ${KRNLOBJDIR}/${_kernel}; \
467 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} clean
469 cd ${KRNLOBJDIR}/${_kernel}; \
470 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} clean cleandir
473 cd ${KRNLOBJDIR}/${_kernel}; \
474 MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx/aicasm \
475 ${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/aicasm/Makefile
476 .if !defined(NO_KERNELDEPEND)
477 cd ${KRNLOBJDIR}/${_kernel}; \
478 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
480 cd ${KRNLOBJDIR}/${_kernel}; \
481 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
482 @echo "--------------------------------------------------------------"
483 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
484 @echo "--------------------------------------------------------------"
490 # Install the kernel defined by INSTALLKERNEL
493 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
494 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} install
496 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
497 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} reinstall
502 # Short hand for `make buildkernel installkernel'
504 kernel: buildkernel installkernel
509 # Update the source tree, by running sup and/or running cvs to update to the
515 .if defined(SUP_UPDATE)
516 @echo "--------------------------------------------------------------"
517 @echo ">>> Running ${SUP}"
518 @echo "--------------------------------------------------------------"
520 @${SUP} ${SUPFLAGS} ${SUPFILE}
522 .if defined(SUPFILE1)
523 @${SUP} ${SUPFLAGS} ${SUPFILE1}
525 .if defined(SUPFILE2)
526 @${SUP} ${SUPFLAGS} ${SUPFILE2}
528 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
529 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
531 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
532 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
535 .if defined(CVS_UPDATE)
536 @echo "--------------------------------------------------------------"
537 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
538 @echo "--------------------------------------------------------------"
539 cd ${.CURDIR}; ${CVS} -q update -A -P -d
545 # Build most of the user binaries on the existing system libs and includes.
548 @echo "--------------------------------------------------------------"
549 @echo ">>> Building programs only"
550 @echo "--------------------------------------------------------------"
551 cd ${.CURDIR}/bin; ${MAKE} all
552 cd ${.CURDIR}/sbin; ${MAKE} all
553 cd ${.CURDIR}/libexec; ${MAKE} all
554 cd ${.CURDIR}/usr.bin; ${MAKE} all
555 cd ${.CURDIR}/usr.sbin; ${MAKE} all
556 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} all
557 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} all
562 # Install the binaries built by the 'most' target. This does not include
563 # libraries or include files.
566 @echo "--------------------------------------------------------------"
567 @echo ">>> Installing programs only"
568 @echo "--------------------------------------------------------------"
569 cd ${.CURDIR}/bin; ${MAKE} install
570 cd ${.CURDIR}/sbin; ${MAKE} install
571 cd ${.CURDIR}/libexec; ${MAKE} install
572 cd ${.CURDIR}/usr.bin; ${MAKE} install
573 cd ${.CURDIR}/usr.sbin; ${MAKE} install
574 cd ${.CURDIR}/gnu/usr.bin; ${MAKE} install
575 cd ${.CURDIR}/gnu/usr.sbin; ${MAKE} install
578 # ------------------------------------------------------------------------
580 # From here onwards are utility targets used by the 'make world' and
581 # related targets. If your 'world' breaks, you may like to try to fix
582 # the problem and manually run the following targets to attempt to
583 # complete the build. Beware, this is *not* guaranteed to work, you
584 # need to have a pretty good grip on the current state of the system
585 # to attempt to manually finish it. If in doubt, 'make world' again.
589 # bootstrap-tools: Build tools needed for compatibility
591 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
592 _strfile= games/fortune/strfile
596 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef usr.bin/xinstall \
597 usr.sbin/config usr.sbin/kbdcontrol \
598 gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo
599 cd ${.CURDIR}/${_tool}; \
603 ${MAKE} DESTDIR=${MAKEOBJDIRPREFIX} install
607 # build-tools: Build special purpose build tools
609 .if exists(${.CURDIR}/games) && !defined(NOGAMES)
610 _games= games/adventure games/hack games/phantasia
613 .if exists(${.CURDIR}/share) && !defined(NOSHARE)
614 _share= share/syscons/scrnmaps
617 .if !defined(NO_FORTRAN)
618 _fortran= gnu/usr.bin/cc/f771
621 .if !defined(NOPERL) && !defined(NO_PERL)
622 _perl= gnu/usr.bin/perl/miniperl
625 .if exists(${.CURDIR}/kerberosIV) && exists(${.CURDIR}/crypto) && \
626 !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
627 _libroken4= kerberosIV/lib/libroken
630 .if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
631 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
632 _libkrb5= kerberos5/lib/libroken kerberos5/lib/libvers \
633 kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
637 .for _tool in bin/csh bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
638 ${_perl} ${_libroken4} ${_libkrb5} lib/libncurses ${_share} \
639 usr.bin/awk usr.bin/file usr.sbin/sysinstall
640 cd ${.CURDIR}/${_tool}; ${MAKE} build-tools
644 # cross-tools: Build cross-building tools
646 .if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
647 _elf2exe= usr.sbin/elf2exe
650 .if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
651 _btxld= usr.sbin/btxld
654 _xlint= usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint
657 .for _tool in ${_btxld} ${_elf2exe} \
658 gnu/usr.bin/binutils usr.bin/objformat gnu/usr.bin/cc ${_xlint}
659 cd ${.CURDIR}/${_tool}; \
663 ${MAKE} DESTDIR=${MAKEOBJDIRPREFIX} install
667 # hierarchy - ensure that all the needed directories are present
670 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
673 # includes - possibly generate and install the include files.
676 cd ${.CURDIR}/include; ${MAKE} -B all install
677 cd ${.CURDIR}/gnu/include; ${MAKE} install
678 cd ${.CURDIR}/gnu/lib/libobjc; ${MAKE} beforeinstall
679 cd ${.CURDIR}/gnu/lib/libreadline/readline; ${MAKE} beforeinstall
680 cd ${.CURDIR}/gnu/lib/libregex; ${MAKE} beforeinstall
681 cd ${.CURDIR}/gnu/lib/libstdc++; ${MAKE} beforeinstall
682 cd ${.CURDIR}/gnu/lib/libdialog; ${MAKE} beforeinstall
683 cd ${.CURDIR}/gnu/usr.bin/cc/cc1plus; ${MAKE} beforeinstall
684 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
685 .if exists(${.CURDIR}/secure/lib/libcrypto)
686 cd ${.CURDIR}/secure/lib/libcrypto; ${MAKE} beforeinstall
688 .if exists(${.CURDIR}/secure/lib/libssl)
689 cd ${.CURDIR}/secure/lib/libssl; ${MAKE} beforeinstall
692 .if exists(${.CURDIR}/kerberosIV) && !defined(NOCRYPT) && \
693 defined(MAKE_KERBEROS4)
694 cd ${.CURDIR}/kerberosIV/lib/libacl; ${MAKE} beforeinstall
695 cd ${.CURDIR}/kerberosIV/lib/libkadm; ${MAKE} beforeinstall
696 cd ${.CURDIR}/kerberosIV/lib/libkafs; ${MAKE} beforeinstall
697 cd ${.CURDIR}/kerberosIV/lib/libkdb; ${MAKE} beforeinstall
698 cd ${.CURDIR}/kerberosIV/lib/libkrb; ${MAKE} beforeinstall
699 cd ${.CURDIR}/kerberosIV/lib/libtelnet; ${MAKE} beforeinstall
700 .elif exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
701 cd ${.CURDIR}/secure/lib/libtelnet; ${MAKE} beforeinstall
703 cd ${.CURDIR}/lib/libtelnet; ${MAKE} beforeinstall
705 .if exists(${.CURDIR}/kerberos5) && !defined(NOCRYPT) && \
706 defined(MAKE_KERBEROS5)
707 cd ${.CURDIR}/kerberos5/lib/libasn1; ${MAKE} beforeinstall
708 cd ${.CURDIR}/kerberos5/lib/libhdb; ${MAKE} beforeinstall
709 cd ${.CURDIR}/kerberos5/lib/libkadm5clnt; ${MAKE} beforeinstall
710 cd ${.CURDIR}/kerberos5/lib/libkadm5srv; ${MAKE} beforeinstall
711 cd ${.CURDIR}/kerberos5/lib/libkafs5; ${MAKE} beforeinstall
712 cd ${.CURDIR}/kerberos5/lib/libkrb5; ${MAKE} beforeinstall
713 cd ${.CURDIR}/kerberos5/lib/libsl; ${MAKE} beforeinstall
715 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
716 cd ${.CURDIR}/lib/csu/${MACHINE_ARCH}; ${MAKE} beforeinstall
718 cd ${.CURDIR}/gnu/lib/csu; ${MAKE} beforeinstall
719 cd ${.CURDIR}/lib/libalias; ${MAKE} beforeinstall
720 cd ${.CURDIR}/lib/libatm; ${MAKE} beforeinstall
721 cd ${.CURDIR}/lib/libdevstat; ${MAKE} beforeinstall
722 cd ${.CURDIR}/lib/libc; ${MAKE} beforeinstall
723 cd ${.CURDIR}/lib/libcalendar; ${MAKE} beforeinstall
724 cd ${.CURDIR}/lib/libcam; ${MAKE} beforeinstall
725 cd ${.CURDIR}/lib/libdisk; ${MAKE} beforeinstall
726 cd ${.CURDIR}/lib/libedit; ${MAKE} beforeinstall
727 cd ${.CURDIR}/lib/libfetch; ${MAKE} beforeinstall
728 cd ${.CURDIR}/lib/libftpio; ${MAKE} beforeinstall
729 cd ${.CURDIR}/lib/libkvm; ${MAKE} beforeinstall
730 cd ${.CURDIR}/lib/libmd; ${MAKE} beforeinstall
731 cd ${.CURDIR}/lib/libmp; ${MAKE} beforeinstall
732 cd ${.CURDIR}/lib/msun; ${MAKE} beforeinstall
733 cd ${.CURDIR}/lib/libncp; ${MAKE} beforeinstall
734 cd ${.CURDIR}/lib/libncurses; ${MAKE} beforeinstall
735 cd ${.CURDIR}/lib/libnetgraph; ${MAKE} beforeinstall
736 cd ${.CURDIR}/lib/libopie; ${MAKE} beforeinstall
737 cd ${.CURDIR}/lib/libpcap; ${MAKE} beforeinstall
738 cd ${.CURDIR}/lib/libradius; ${MAKE} beforeinstall
739 cd ${.CURDIR}/lib/librpcsvc; ${MAKE} beforeinstall
740 cd ${.CURDIR}/lib/libpam/libpam; ${MAKE} beforeinstall
741 cd ${.CURDIR}/lib/libsbuf; ${MAKE} beforeinstall
742 cd ${.CURDIR}/lib/libstand; ${MAKE} beforeinstall
743 cd ${.CURDIR}/lib/libtacplus; ${MAKE} beforeinstall
744 cd ${.CURDIR}/lib/libcom_err; ${MAKE} beforeinstall
745 cd ${.CURDIR}/lib/libusbhid; ${MAKE} beforeinstall
746 cd ${.CURDIR}/lib/libutil; ${MAKE} beforeinstall
747 cd ${.CURDIR}/lib/libvgl; ${MAKE} beforeinstall
748 cd ${.CURDIR}/lib/libwrap; ${MAKE} beforeinstall
749 cd ${.CURDIR}/lib/libz; ${MAKE} beforeinstall
750 cd ${.CURDIR}/usr.bin/lex; ${MAKE} beforeinstall
753 # libraries - build all libraries, and install them under ${DESTDIR}.
755 # The following dependencies exist between the libraries:
757 # lib*: csu libgcc_pic
762 # libdialog: libncurses
763 # libedit: libncurses
767 # libpam: libcom_err libcrypt libcrypto libkrb libopie libradius \
768 # librpcsvc libtacplus libutil libz libssh
770 # libreadline: libncurses
771 # libssh: libcrypto libz
775 # Across directories this comes down to (rougly):
777 # gnu/lib: lib/msun lib/libncurses
778 # kerberosIV/lib kerberos5/lib: lib/libcrypt
779 # lib/libpam: secure/lib/libcrypto kerberosIV/lib/libkrb \
780 # secure/lib/libssh lib/libz
781 # secure/lib: secure/lib/libcrypto lib/libmd lib/libz
783 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}.pcc)
784 _csu= lib/csu/${MACHINE_ARCH}.pcc
785 .elif ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf"
786 _csu= lib/csu/i386-elf
788 _csu= lib/csu/${MACHINE_ARCH}
791 .if exists(${.CURDIR}/secure) && !defined(NOCRYPT) && !defined(NOSECURE)
792 _secure_lib= secure/lib
793 .if exists(${.CURDIR}/secure/lib/libcrypto)
794 _libcrypto= secure/lib/libcrypto
798 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
799 _kerberosIV_lib= kerberosIV/lib
802 .if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
803 _kerberos5_lib= kerberos5/lib
806 .if ${MACHINE_ARCH} == "i386"
807 _libkeycap= usr.sbin/pcvt/keycap
810 .if !defined(NOPERL) && !defined(NO_PERL)
811 _libperl= gnu/usr.bin/perl/libperl
815 .for _lib in ${_csu} gnu/lib/csu gnu/lib/libgcc lib/libmd lib/libcrypt \
816 lib/libz ${_libcrypto} ${_secure_lib} ${_kerberosIV_lib} \
817 ${_kerberos5_lib} lib/libcom_err lib/libkvm lib/msun lib/libncurses \
818 lib/libopie lib/libradius lib/librpcsvc lib/libsbuf lib/libtacplus \
819 lib/libutil lib gnu/lib ${_libperl} usr.bin/lex/lib ${_libkeycap}
820 .if exists(${.CURDIR}/${_lib})
821 cd ${.CURDIR}/${_lib}; \
828 .for __target in clean cleandepend cleandir depend obj
829 .for entry in ${SUBDIR}
830 ${entry}.${__target}__D: .PHONY
831 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
832 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
833 edir=${entry}.${MACHINE_ARCH}; \
834 cd ${.CURDIR}/$${edir}; \
836 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
838 cd ${.CURDIR}/$${edir}; \
840 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
842 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
845 .include <bsd.subdir.mk>