Change to PCI_VENDOR_DELL
[dragonfly.git] / Makefile.inc1
CommitLineData
984263bc
MD
1#
2# $FreeBSD: src/Makefile.inc1,v 1.141.2.62 2003/04/06 19:54:00 dwmalone Exp $
592ce487 3# $DragonFly: src/Makefile.inc1,v 1.22 2004/03/21 03:48:38 dillon Exp $
984263bc
MD
4#
5# Make command line options:
984263bc
MD
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# -DNOMAN do not build the manual pages
11# -DNOPROFILE do not build profiled libraries
984263bc
MD
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
24
25#
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
32#
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
36
37# Put initial settings here.
38SUBDIR=
39
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)
44SUBDIR+= share/info
45.endif
46
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)
50SUBDIR+= include
51.endif
52.if exists(${.CURDIR}/lib)
53SUBDIR+= lib
54.endif
17d0fefe
MD
55# This exists simply to ensure that the obj dir hierarchy is
56# intact for nrelease, allowing the nrelease Makefile's to
57# reference ${.OBJDIR}.
58#
59.if exists(${.CURDIR}/nrelease)
60SUBDIR+= nrelease
61.endif
984263bc
MD
62
63.if exists(${.CURDIR}/bin)
64SUBDIR+= bin
65.endif
66.if exists(${.CURDIR}/games) && !defined(NOGAMES)
67SUBDIR+= games
68.endif
69.if exists(${.CURDIR}/gnu)
70SUBDIR+= gnu
71.endif
984263bc
MD
72.if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
73 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS5)
74SUBDIR+= kerberos5
75.endif
76.if exists(${.CURDIR}/libexec)
77SUBDIR+= libexec
78.endif
79.if exists(${.CURDIR}/sbin)
80SUBDIR+= sbin
81.endif
de347b31 82.if exists(${.CURDIR}/secure) && !defined(NOCRYPT)
984263bc
MD
83SUBDIR+= secure
84.endif
85.if exists(${.CURDIR}/share) && !defined(NOSHARE)
86SUBDIR+= share
87.endif
88.if exists(${.CURDIR}/sys)
89SUBDIR+= sys
90.endif
91.if exists(${.CURDIR}/usr.bin)
92SUBDIR+= usr.bin
93.endif
94.if exists(${.CURDIR}/usr.sbin)
95SUBDIR+= usr.sbin
96.endif
97
98# etc must be last for "distribute" to work
99.if exists(${.CURDIR}/etc)
100SUBDIR+= etc
101.endif
102
103# These are last, since it is nice to at least get the base system
104# rebuilt before you do them.
105.if defined(LOCAL_DIRS)
106.for _DIR in ${LOCAL_DIRS}
107.if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
108SUBDIR+= ${_DIR}
109.endif
110.endfor
111.endif
112
113.if defined(SUBDIR_OVERRIDE)
114SUBDIR= ${SUBDIR_OVERRIDE}
115.endif
116
117.if defined(NOCLEANDIR)
118CLEANDIR= clean cleandepend
119.else
120CLEANDIR= cleandir
121.endif
122
123SUP?= /usr/local/bin/cvsup
124SUPFLAGS?= -g -L 2 -P -
125.if defined(SUPHOST)
126SUPFLAGS+= -h ${SUPHOST}
127.endif
128
129MAKEOBJDIRPREFIX?= /usr/obj
130TARGET_ARCH?= ${MACHINE_ARCH}
131.if ${TARGET_ARCH} == ${MACHINE_ARCH}
132TARGET?= ${MACHINE}
133.else
134TARGET?= ${TARGET_ARCH}
135.endif
136.if make(buildworld)
137BUILD_ARCH!= sysctl -n hw.machine_arch
138.if ${MACHINE_ARCH} != ${BUILD_ARCH}
139.error To cross-build, set TARGET_ARCH.
140.endif
141.endif
142.if ${MACHINE} == ${TARGET}
143OBJTREE= ${MAKEOBJDIRPREFIX}
144.else
145OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
146.endif
147WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH}
148# /usr/games added for fortune which depend on strfile
149STRICTTMPPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
150TMPPATH= ${STRICTTMPPATH}:${PATH}
984263bc
MD
151
152TMPDIR?= /tmp
153TMPPID!= echo $$$$
154INSTALLTMP= ${TMPDIR}/install.${TMPPID}
155
156#
157# Building a world goes through the following stages
158#
159# 1. bootstrap-tool stage [BMAKE]
160# This stage is responsible for creating programs that
161# are needed for backward compatibility reasons. They
162# are not built as cross-tools.
163# 2. build-tool stage [TMAKE]
164# This stage is responsible for creating the object
165# tree and building any tools that are needed during
166# the build process.
167# 3. cross-tool stage [XMAKE]
168# This stage is responsible for creating any tools that
169# are needed for cross-builds. A cross-compiler is one
170# of them.
171# 4. world stage [WMAKE]
172# This stage actually builds the world.
173# 5. install stage (optional) [IMAKE]
174# This stage installs a previously built world.
175#
176
177# Common environment for world related stages
178CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
179 MACHINE_ARCH=${TARGET_ARCH} \
180 MACHINE=${TARGET} \
592ce487 181 OBJFORMAT_PATH=${WORLDTMP} \
984263bc
MD
182 PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.00503 \
183 GROFF_BIN_PATH=${WORLDTMP}/usr/bin \
184 GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \
185 GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac
186
187# bootstrap-tool stage
188BMAKEENV= MAKEOBJDIRPREFIX=${WORLDTMP} \
189 DESTDIR= \
190 INSTALL="sh ${.CURDIR}/tools/install.sh"
191BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
192 -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
193 -DNO_WERROR
194
195# build-tool stage
196TMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE} \
197 DESTDIR= \
198 INSTALL="sh ${.CURDIR}/tools/install.sh"
199TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING
200
201# cross-tool stage
202XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB
203
204# world stage
205WMAKEENV= ${CROSSENV} \
206 DESTDIR=${WORLDTMP} \
207 INSTALL="sh ${.CURDIR}/tools/install.sh" \
208 PATH=${TMPPATH}
209WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
210
211# install stage
212IMAKEENV= ${CROSSENV} \
213 PATH=${STRICTTMPPATH}:${INSTALLTMP}
214IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
215
216# kernel stage
592ce487
MD
217KMAKEENV= ${WMAKEENV} \
218 OBJFORMAT_PATH=${WORLDTMP}:${OBJFORMAT_PATH}
4806ab2e 219
17030342
MD
220# /usr/bin/gccX version-specific gcc binaries
221# /usr/lib/gccX version-specific gcc libraries
222# /usr/libexec/gccX version-specific gcc helper binaries
223# /usr/libexec/binutilsXXX version-specific binutils
224
225USRDIRS= usr/bin \
4806ab2e 226 usr/lib/gcc2 usr/lib/gcc3 \
17030342 227 usr/libexec/gcc2 usr/libexec/gcc3 \
4806ab2e 228 usr/lib/compat/aout usr/games \
17030342
MD
229 usr/libdata \
230 usr/libexec/binutils212 \
0f3c41f3
MD
231 usr/libexec/binutils212/elf \
232 usr/libexec/binutils212/aout \
17030342
MD
233 usr/libexec/binutils212/ldscripts \
234 usr/libexec/binutils214 \
235 usr/libexec/binutils214/elf \
236 usr/libexec/binutils214/ldscripts \
4806ab2e 237 usr/sbin usr/share/misc \
984263bc
MD
238 usr/share/dict \
239 usr/share/groff_font/devX100 \
240 usr/share/groff_font/devX100-12 \
241 usr/share/groff_font/devX75 \
242 usr/share/groff_font/devX75-12 \
243 usr/share/groff_font/devascii \
244 usr/share/groff_font/devcp1047 \
245 usr/share/groff_font/devdvi \
246 usr/share/groff_font/devhtml \
247 usr/share/groff_font/devkoi8-r \
248 usr/share/groff_font/devlatin1 \
249 usr/share/groff_font/devlbp \
250 usr/share/groff_font/devlj4 \
251 usr/share/groff_font/devps \
252 usr/share/groff_font/devutf8 \
253 usr/share/tmac/mdoc usr/share/tmac/mm
254
38a690d7
MD
255# XXX remove in favor of the BSD.include.dist mtree that we already have.
256#
63e34214 257INCDIRS= arpa dev c++/2.95 isc libmilter objc openssl \
38a690d7 258 protocols readline rpc rpcsvc security
984263bc
MD
259
260#
261# buildworld
262#
263# Attempt to rebuild the entire system, with reasonable chance of
264# success, regardless of how old your existing system is.
265#
266_worldtmp:
267 @echo
268 @echo "--------------------------------------------------------------"
269 @echo ">>> Rebuilding the temporary build tree"
270 @echo "--------------------------------------------------------------"
271.if !defined(NOCLEAN)
272 rm -rf ${WORLDTMP}
273.else
274 # XXX - These two can depend on any header file.
275 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
276 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
277.endif
278.for _dir in ${USRDIRS}
279 mkdir -p ${WORLDTMP}/${_dir}
280.endfor
281.for _dir in ${INCDIRS}
282 mkdir -p ${WORLDTMP}/usr/include/${_dir}
283.endfor
284 ln -sf ${.CURDIR}/sys ${WORLDTMP}
285_bootstrap-tools:
286 @echo
287 @echo "--------------------------------------------------------------"
288 @echo ">>> stage 1: bootstrap tools"
289 @echo "--------------------------------------------------------------"
290 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
291_cleanobj:
292.if !defined(NOCLEAN)
293 @echo
294 @echo "--------------------------------------------------------------"
295 @echo ">>> stage 2: cleaning up the object tree"
296 @echo "--------------------------------------------------------------"
297 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
298.endif
299_obj:
300 @echo
301 @echo "--------------------------------------------------------------"
302 @echo ">>> stage 2: rebuilding the object tree"
303 @echo "--------------------------------------------------------------"
304 cd ${.CURDIR}; ${WMAKE} par-obj
305_build-tools:
306 @echo
307 @echo "--------------------------------------------------------------"
308 @echo ">>> stage 2: build tools"
309 @echo "--------------------------------------------------------------"
310 cd ${.CURDIR}; ${TMAKE} build-tools
311_cross-tools:
312 @echo
313 @echo "--------------------------------------------------------------"
314 @echo ">>> stage 3: cross tools"
315 @echo "--------------------------------------------------------------"
316 cd ${.CURDIR}; ${XMAKE} cross-tools
317_includes:
318 @echo
319 @echo "--------------------------------------------------------------"
320 @echo ">>> stage 4: populating ${WORLDTMP}/usr/include"
321 @echo "--------------------------------------------------------------"
322 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
323_libraries:
324 @echo
325 @echo "--------------------------------------------------------------"
326 @echo ">>> stage 4: building libraries"
327 @echo "--------------------------------------------------------------"
328 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
329_depend:
330 @echo
331 @echo "--------------------------------------------------------------"
332 @echo ">>> stage 4: make dependencies"
333 @echo "--------------------------------------------------------------"
334 cd ${.CURDIR}; ${WMAKE} par-depend
335everything:
336 @echo
337 @echo "--------------------------------------------------------------"
338 @echo ">>> stage 4: building everything.."
339 @echo "--------------------------------------------------------------"
340 cd ${.CURDIR}; ${WMAKE} all
341
342
343WMAKE_TGTS=
344.if !defined(SUBDIR_OVERRIDE)
345WMAKE_TGTS+= _worldtmp _bootstrap-tools
346.endif
347WMAKE_TGTS+= _cleanobj _obj _build-tools
348.if !defined(SUBDIR_OVERRIDE)
349WMAKE_TGTS+= _cross-tools
350.endif
351WMAKE_TGTS+= _includes _libraries _depend everything
352
353buildworld: ${WMAKE_TGTS}
354.ORDER: ${WMAKE_TGTS}
355
356#
357# installcheck
358#
359# Checks to be sure system is ready for installworld
360#
361installcheck:
362.if !defined(NO_SENDMAIL)
72ac4ef4 363 @if ! `id -u smmsp > /dev/null`; then \
984263bc
MD
364 echo "ERROR: Required smmsp user is missing, see /usr/src/UPDATING."; \
365 false; \
366 fi
72ac4ef4 367 @if ! `id -g smmsp > /dev/null`; then \
984263bc
MD
368 echo "ERROR: Required smmsp group is missing, see /usr/src/UPDATING."; \
369 false; \
370 fi
371.endif
372
373#
374# distributeworld
375#
376# Distributes everything compiled by a `buildworld'.
377#
378# installworld
379#
380# Installs everything compiled by a 'buildworld'.
381#
382distributeworld installworld: installcheck
383 mkdir -p ${INSTALLTMP}
384 for prog in [ awk cap_mkdb cat chflags chmod chown \
385 date echo egrep find grep \
386 ln make makewhatis mkdir mtree mv perl pwd_mkdb rm sed sh sysctl \
387 test true uname wc zic; do \
388 cp `which $$prog` ${INSTALLTMP}; \
389 done
390 cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
391 rm -rf ${INSTALLTMP}
392
393#
394# reinstall
395#
396# If you have a build server, you can NFS mount the source and obj directories
397# and do a 'make reinstall' on the *client* to install new binaries from the
398# most recent server build.
399#
400reinstall:
401 @echo "--------------------------------------------------------------"
402 @echo ">>> Making hierarchy"
403 @echo "--------------------------------------------------------------"
404 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
405 @echo
406 @echo "--------------------------------------------------------------"
407 @echo ">>> Installing everything.."
408 @echo "--------------------------------------------------------------"
409 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
410.if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
411 @echo
412 @echo "--------------------------------------------------------------"
413 @echo ">>> Rebuilding man page indices"
414 @echo "--------------------------------------------------------------"
415 cd ${.CURDIR}/share/man; ${MAKE} makedb
416.endif
417
418redistribute:
419 @echo "--------------------------------------------------------------"
420 @echo ">>> Distributing everything.."
421 @echo "--------------------------------------------------------------"
422 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
423
424#
425# buildkernel and installkernel
426#
427# Which kernels to build and/or install is specified by setting
428# KERNCONF. If not defined a GENERIC kernel is built/installed.
429# Only the existing (depending TARGET) config files are used
430# for building kernels and only the first of these is designated
431# as the one being installed.
432#
433# Note that we have to use TARGET instead of TARGET_ARCH when
434# we're in kernel-land. Since only TARGET_ARCH is (expected) to
435# be set to cross-build, we have to make sure TARGET is set
436# properly.
437
438.if !defined(KERNCONF) && defined(KERNEL)
439KERNCONF= ${KERNEL}
440KERNWARN= yes
441.else
442KERNCONF?= GENERIC
443.endif
444INSTKERNNAME?= kernel
445
446KRNLSRCDIR= ${.CURDIR}/sys
447KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
448KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
449KERNCONFDIR?= ${KRNLCONFDIR}
450
451BUILDKERNELS=
452INSTALLKERNEL=
453.for _kernel in ${KERNCONF}
454.if exists(${KERNCONFDIR}/${_kernel})
455BUILDKERNELS+= ${_kernel}
456.if empty(INSTALLKERNEL)
457INSTALLKERNEL= ${_kernel}
458.endif
459.endif
460.endfor
461
462#
463# buildkernel
464#
465# Builds all kernels defined by BUILDKERNELS.
466#
467buildkernel:
468.if empty(BUILDKERNELS)
469 @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNCONF})."
470 @false
471.endif
472.if defined(KERNWARN)
473 @echo "--------------------------------------------------------------"
474 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
475 @echo "--------------------------------------------------------------"
476 @sleep 3
477.endif
478 @echo
479.for _kernel in ${BUILDKERNELS}
480 @echo "--------------------------------------------------------------"
481 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
482 @echo "--------------------------------------------------------------"
483 @echo "===> ${_kernel}"
484 mkdir -p ${KRNLOBJDIR}
485.if !defined(NO_KERNELCONFIG)
486 cd ${KRNLCONFDIR}; \
487 PATH=${TMPPATH} \
488 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
489 ${KERNCONFDIR}/${_kernel}
490.endif
491.if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
492 cd ${KRNLOBJDIR}/${_kernel}; \
493 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} -DNO_MODULES clean
494.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KRNLSRCDIR}/modules)
495 cd ${KRNLOBJDIR}/${_kernel}; \
496 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} cleandir
497.endif
498.endif
499 cd ${KRNLOBJDIR}/${_kernel}; \
9f3906fd
MD
500 MAKESRCPATH=${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm \
501 ${MAKE} -DBOOTSTRAPPING -f ${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm/Makefile
984263bc
MD
502.if !defined(NO_KERNELDEPEND)
503 cd ${KRNLOBJDIR}/${_kernel}; \
504 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
505.endif
506 cd ${KRNLOBJDIR}/${_kernel}; \
507 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
508 @echo "--------------------------------------------------------------"
509 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
510 @echo "--------------------------------------------------------------"
511.endfor
512
513#
514# installkernel
515#
516# Install the kernel defined by INSTALLKERNEL
517#
518installkernel reinstallkernel:
519 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
520 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
521
522#
523# update
524#
525# Update the source tree, by running sup and/or running cvs to update to the
526# latest copy.
527#
528update:
529.if defined(SUP_UPDATE)
530 @echo "--------------------------------------------------------------"
531 @echo ">>> Running ${SUP}"
532 @echo "--------------------------------------------------------------"
533.if defined(SUPFILE)
534 @${SUP} ${SUPFLAGS} ${SUPFILE}
535.endif
536.if defined(SUPFILE1)
537 @${SUP} ${SUPFLAGS} ${SUPFILE1}
538.endif
539.if defined(SUPFILE2)
540 @${SUP} ${SUPFLAGS} ${SUPFILE2}
541.endif
542.if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
543 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
544.endif
545.if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
546 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
547.endif
548.endif
549.if defined(CVS_UPDATE)
550 @echo "--------------------------------------------------------------"
551 @echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
552 @echo "--------------------------------------------------------------"
553 cd ${.CURDIR}; cvs -q update -rRELENG_4 -P -d
554.endif
555
556#
557# most
558#
559# Build most of the user binaries on the existing system libs and includes.
560#
561most:
562 @echo "--------------------------------------------------------------"
563 @echo ">>> Building programs only"
564 @echo "--------------------------------------------------------------"
565.for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
566 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ all
567.endfor
568
569#
570# installmost
571#
572# Install the binaries built by the 'most' target. This does not include
573# libraries or include files.
574#
575installmost:
576 @echo "--------------------------------------------------------------"
577 @echo ">>> Installing programs only"
578 @echo "--------------------------------------------------------------"
579.for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
580 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ install
581.endfor
582
583#
584# ------------------------------------------------------------------------
585#
586# From here onwards are utility targets used by the 'make world' and
587# related targets. If your 'world' breaks, you may like to try to fix
588# the problem and manually run the following targets to attempt to
589# complete the build. Beware, this is *not* guaranteed to work, you
590# need to have a pretty good grip on the current state of the system
591# to attempt to manually finish it. If in doubt, 'make world' again.
592#
593
984263bc
MD
594# bootstrap-tools: Build tools needed for compatibility
595#
17030342
MD
596# [x]install: dependancies on various new install features
597# rpcgen: old rpcgen used a hardwired cpp path, newer OBJFORMAT_PATH
598# envs are not compatible with older objformat binaries.
599#
984263bc
MD
600.if exists(${.CURDIR}/games) && !defined(NOGAMES)
601_strfile= games/fortune/strfile
602.endif
603
604bootstrap-tools:
605.for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef \
17030342 606 usr.bin/uudecode usr.bin/xinstall usr.bin/rpcgen \
984263bc
MD
607 usr.sbin/config \
608 gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo
609 ${ECHODIR} "===> ${_tool}"; \
610 cd ${.CURDIR}/${_tool}; \
611 ${MAKE} DIRPRFX=${_tool}/ obj; \
612 ${MAKE} DIRPRFX=${_tool}/ depend; \
613 ${MAKE} DIRPRFX=${_tool}/ all; \
614 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
615.endfor
616
17030342
MD
617# build-tools: Build special purpose build tools. gcc2 related tools are
618# only built under the i386 architecture. Other architectures are
619# gcc3-only.
984263bc
MD
620#
621.if exists(${.CURDIR}/games) && !defined(NOGAMES)
622_games= games/adventure games/hack games/phantasia
623.endif
624
625.if exists(${.CURDIR}/share) && !defined(NOSHARE)
626_share= share/syscons/scrnmaps
627.endif
628
17030342
MD
629_gcc3_cross= gnu/usr.bin/cc3
630_gcc3_tools= gnu/usr.bin/cc3/cc_tools
631.if ${MACHINE_ARCH} == "i386" && ${TARGET_ARCH} == "i386"
632_gcc2_cross= gnu/usr.bin/cc
633_gcc2_tools= gnu/usr.bin/cc/cc_tools
634_binutils= gnu/usr.bin/binutils gnu/usr.bin/binutils214
635.else
636_binutils= gnu/usr.bin/binutils214
637.endif
638
984263bc 639.if !defined(NO_FORTRAN)
17030342 640.if ${TARGET_ARCH} == "i386"
984263bc 641_fortran= gnu/usr.bin/cc/f771
17030342
MD
642.else
643_fortran= gnu/usr.bin/cc3/f771
644.endif
984263bc
MD
645.endif
646
647.if !defined(NOPERL)
648_perl= gnu/usr.bin/perl/miniperl
649.endif
650
984263bc
MD
651.if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
652 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
653_libkrb5= kerberos5/lib/libroken kerberos5/lib/libvers \
654 kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
655.endif
656
657.if defined(RELEASEDIR)
658_sysinstall= release/sysinstall
659.endif
660
17030342
MD
661# build-tools: tools we need
662#
984263bc 663build-tools:
17030342
MD
664.for _tool in bin/csh bin/sh ${_games} ${_gcc2_tools} ${_gcc3_tools} \
665 ${_fortran} ${_perl} ${_libroken4} ${_libkrb5} \
666 lib/libncurses ${_share} usr.bin/awk usr.bin/file \
667 ${_sysinstall}
984263bc
MD
668 ${ECHODIR} "===> ${_tool}"; \
669 cd ${.CURDIR}/${_tool}; \
670 ${MAKE} DIRPRFX=${_tool}/ obj; \
671 ${MAKE} DIRPRFX=${_tool}/ build-tools
672.endfor
673
674#
675# cross-tools: Build cross-building tools
676#
677.if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
678_elf2exe= usr.sbin/elf2exe
679.endif
680
681.if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
682_btxld= usr.sbin/btxld
683.endif
684
685cross-tools:
17030342
MD
686.for _tool in ${_btxld} ${_elf2exe} ${_binutils} \
687 usr.bin/objformat usr.sbin/crunch/crunchide \
688 ${_gcc2_cross} ${_gcc3_cross}
984263bc
MD
689 ${ECHODIR} "===> ${_tool}"; \
690 cd ${.CURDIR}/${_tool}; \
691 ${MAKE} DIRPRFX=${_tool}/ obj; \
692 ${MAKE} DIRPRFX=${_tool}/ depend; \
693 ${MAKE} DIRPRFX=${_tool}/ all; \
694 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
695.endfor
696
697#
698# hierarchy - ensure that all the needed directories are present
699#
700hierarchy:
701 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
702
703#
704# libraries - build all libraries, and install them under ${DESTDIR}.
705#
706# The list of libraries with dependents (${_prebuild_libs}) and their
707# interdependencies (__L) are built automatically by the
708# ${.CURDIR}/tools/make_libdeps.sh script.
709#
5228fe46
MD
710# .makeenv does not work when bootstrapping from 4.x, so we must be sure
711# to specify the correct CCVER or 'cc' will not exec the correct compiler.
712#
984263bc
MD
713libraries:
714 cd ${.CURDIR}; \
5228fe46
MD
715 CCVER=gcc2 ${MAKE} -f Makefile.inc1 _startup_libs2; \
716 CCVER=gcc3 ${MAKE} -f Makefile.inc1 _startup_libs3; \
984263bc
MD
717 ${MAKE} -f Makefile.inc1 _startup_libs; \
718 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
719 ${MAKE} -f Makefile.inc1 _generic_libs;
720
721# These dependencies are not automatically generated:
722#
723# gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all
5228fe46
MD
724# shared libraries for ELF. The targets for _startup_libs{2,3} are
725# specifically built using gcc{2,3}.
984263bc 726#
5228fe46
MD
727_startup_libs2= gnu/lib/gcc2/csu gnu/lib/gcc2/libgcc
728_startup_libs3= gnu/lib/gcc3/csu gnu/lib/gcc3/libgcc
aa8d5dcb
DR
729.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
730_startup_libs= lib/csu/${MACHINE_ARCH}-elf
984263bc 731.else
5228fe46 732_startup_libs= lib/csu/${MACHINE_ARCH}
984263bc
MD
733.endif
734
735_prebuild_libs=
736
737_generic_libs= gnu/lib
738
739.if !defined(NOPERL)
740_generic_libs+= gnu/usr.bin/perl/libperl
741.endif
742
743.if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
744_prebuild_libs+= kerberos5/lib/libasn1
745_prebuild_libs+= kerberos5/lib/libgssapi
746_prebuild_libs+= kerberos5/lib/libkrb5
747_prebuild_libs+= kerberos5/lib/libroken
748_generic_libs+= kerberos5/lib
749.endif
750
984263bc
MD
751_prebuild_libs+= lib/libcom_err lib/libcrypt lib/libmd \
752 lib/libncurses lib/libopie lib/libradius lib/libskey \
753 lib/libtacplus lib/libutil \
754 lib/libz lib/msun
755
756lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
757lib/libskey__L: lib/libcrypt__L lib/libmd__L
758
759_generic_libs+= lib
760
de347b31 761.if !defined(NOCRYPT)
984263bc
MD
762.if !defined(NO_OPENSSL)
763_prebuild_libs+= secure/lib/libcrypto secure/lib/libssl
764.if !defined(NO_OPENSSH)
765_prebuild_libs+= secure/lib/libssh
766secure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
767.endif
768.endif
769_generic_libs+= secure/lib
770.endif
771
772_generic_libs+= usr.bin/lex/lib
773
774.if ${MACHINE_ARCH} == "i386"
775_generic_libs+= usr.sbin/pcvt/keycap
776.endif
777
5228fe46
MD
778.for _lib in ${_startup_libs2} ${_startup_libs3} ${_startup_libs} \
779 ${_prebuild_libs} ${_generic_libs}
984263bc
MD
780${_lib}__L: .PHONY
781.if exists(${.CURDIR}/${_lib})
782 ${ECHODIR} "===> ${_lib}"; \
783 cd ${.CURDIR}/${_lib}; \
784 ${MAKE} DIRPRFX=${_lib}/ depend; \
785 ${MAKE} DIRPRFX=${_lib}/ all; \
786 ${MAKE} DIRPRFX=${_lib}/ install
787.endif
788.endfor
789
17030342
MD
790# only mess with gcc2 for i386 architectures.
791#
984263bc 792_startup_libs: ${_startup_libs:S/$/__L/}
17030342 793.if ${TARGET_ARCH} == "i386"
5228fe46 794_startup_libs2: ${_startup_libs2:S/$/__L/}
17030342
MD
795.else
796_startup_libs2:
797.endif
5228fe46 798_startup_libs3: ${_startup_libs3:S/$/__L/}
984263bc
MD
799_prebuild_libs: ${_prebuild_libs:S/$/__L/}
800_generic_libs: ${_generic_libs:S/$/__L/}
801
802.for __target in clean cleandepend cleandir depend includes obj
803.for entry in ${SUBDIR}
804${entry}.${__target}__D: .PHONY
805 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
806 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
807 edir=${entry}.${MACHINE_ARCH}; \
808 cd ${.CURDIR}/$${edir}; \
809 else \
810 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
811 edir=${entry}; \
812 cd ${.CURDIR}/$${edir}; \
813 fi; \
814 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
815.endfor
816par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
817.endfor
818
cb0f1574
MD
819# The wmake target is used by /usr/bin/wmake to run make in a
820# world build environment.
821#
822wmake:
823 @echo '${WMAKEENV} ${MAKE} ${WMAKE_ARGS}'
824
5c7da0d7
MD
825wmakeenv:
826 @echo '${WMAKEENV} /bin/sh'
827
17030342
MD
828bmakeenv:
829 @echo '${BMAKEENV} /bin/sh'
830
831tmakeenv:
832 @echo '${TMAKEENV} /bin/sh'
833
984263bc 834.include <bsd.subdir.mk>
cb0f1574 835