Merge from vendor branch HEIMDAL:
[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 $
de567082 3# $DragonFly: src/Makefile.inc1,v 1.52 2005/01/05 22:03:51 joerg 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
984263bc
MD
24#
25# The intended user-driven targets are:
1397f94a 26#
984263bc 27# buildworld - rebuild *everything*, including glue to help do upgrades
1397f94a
MD
28# quickworld - skip the glue and do a depend+build on the meat
29# realquickworld - skip the glue and depend stages and just build the meat
30# crossworld - only build the glue (particularly the cross-build environment)
984263bc
MD
31# installworld- install everything built by "buildworld"
32# update - convenient way to update your source tree (eg: sup/cvs)
33# most - build user commands, no libraries or include files
34# installmost - install user commands, no libraries or include files
35#
36# Standard targets (not defined here) are documented in the makefiles in
37# /usr/share/mk. These include:
38# obj depend all install clean cleandepend cleanobj
39
40# Put initial settings here.
41SUBDIR=
42
43# We must do share/info early so that installation of info `dir'
44# entries works correctly. Do it first since it is less likely to
45# grow dependencies on include and lib than vice versa.
46.if exists(${.CURDIR}/share/info)
47SUBDIR+= share/info
48.endif
49
50# We must do include and lib early so that the perl *.ph generation
51# works correctly as it uses the header files installed by this.
52.if exists(${.CURDIR}/include)
53SUBDIR+= include
54.endif
55.if exists(${.CURDIR}/lib)
56SUBDIR+= lib
57.endif
17d0fefe
MD
58# This exists simply to ensure that the obj dir hierarchy is
59# intact for nrelease, allowing the nrelease Makefile's to
60# reference ${.OBJDIR}.
61#
62.if exists(${.CURDIR}/nrelease)
63SUBDIR+= nrelease
64.endif
984263bc
MD
65
66.if exists(${.CURDIR}/bin)
67SUBDIR+= bin
68.endif
69.if exists(${.CURDIR}/games) && !defined(NOGAMES)
70SUBDIR+= games
71.endif
72.if exists(${.CURDIR}/gnu)
73SUBDIR+= gnu
74.endif
984263bc
MD
75.if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
76 !defined(NOCRYPT) && !defined(NO_OPENSSL) && defined(MAKE_KERBEROS5)
77SUBDIR+= kerberos5
78.endif
79.if exists(${.CURDIR}/libexec)
80SUBDIR+= libexec
81.endif
82.if exists(${.CURDIR}/sbin)
83SUBDIR+= sbin
84.endif
de347b31 85.if exists(${.CURDIR}/secure) && !defined(NOCRYPT)
984263bc
MD
86SUBDIR+= secure
87.endif
88.if exists(${.CURDIR}/share) && !defined(NOSHARE)
89SUBDIR+= share
90.endif
91.if exists(${.CURDIR}/sys)
92SUBDIR+= sys
93.endif
94.if exists(${.CURDIR}/usr.bin)
95SUBDIR+= usr.bin
96.endif
97.if exists(${.CURDIR}/usr.sbin)
98SUBDIR+= usr.sbin
99.endif
100
101# etc must be last for "distribute" to work
102.if exists(${.CURDIR}/etc)
103SUBDIR+= etc
104.endif
105
106# These are last, since it is nice to at least get the base system
107# rebuilt before you do them.
108.if defined(LOCAL_DIRS)
109.for _DIR in ${LOCAL_DIRS}
110.if exists(${.CURDIR}/${_DIR}) & exists(${.CURDIR}/${_DIR}/Makefile)
111SUBDIR+= ${_DIR}
112.endif
113.endfor
114.endif
115
116.if defined(SUBDIR_OVERRIDE)
117SUBDIR= ${SUBDIR_OVERRIDE}
118.endif
119
120.if defined(NOCLEANDIR)
121CLEANDIR= clean cleandepend
122.else
123CLEANDIR= cleandir
124.endif
125
126SUP?= /usr/local/bin/cvsup
127SUPFLAGS?= -g -L 2 -P -
128.if defined(SUPHOST)
129SUPFLAGS+= -h ${SUPHOST}
130.endif
131
1397f94a
MD
132# Object directory base in primary make. Note that when we rerun make
133# from inside this file we change MAKEOBJDIRPREFIX to the appropriate
134# subdirectory because the rest of the build system needs it that way.
135# The original object directory base is saved in OBJTREE.
136#
984263bc 137MAKEOBJDIRPREFIX?= /usr/obj
1397f94a
MD
138OBJTREE?= ${MAKEOBJDIRPREFIX}
139
140# Used for stage installs and pathing
141#
142DESTDIRBASE?= ${OBJTREE}${.CURDIR}
143
984263bc
MD
144TARGET_ARCH?= ${MACHINE_ARCH}
145.if ${TARGET_ARCH} == ${MACHINE_ARCH}
146TARGET?= ${MACHINE}
147.else
148TARGET?= ${TARGET_ARCH}
149.endif
150.if make(buildworld)
151BUILD_ARCH!= sysctl -n hw.machine_arch
152.if ${MACHINE_ARCH} != ${BUILD_ARCH}
153.error To cross-build, set TARGET_ARCH.
154.endif
155.endif
1397f94a
MD
156
157# BTOOLS (Natively built) All non-cross-development tools that the
158# main build needs. This includes things like 'mkdir' and 'rm'.
159# We will not use the native system's exec path once we start
160# on WORLD. (bootstrap-tools and build-tools or BTOOLS)
161#
162# CTOOLS (Natively built) Cross development tools which are specific
163# to the target architecture.
164#
165# WORLD (Cross built) Our ultimate buildworld, using only BTOOLS and
166# CTOOLS.
167#
168# MACHINE_ARCH Architecture we are building on
169# TARGET_ARCH Architecture we are building for
170#
171BTOOLSDEST= ${DESTDIRBASE}/btools_${MACHINE_ARCH}
172CTOOLSDEST= ${DESTDIRBASE}/ctools_${MACHINE_ARCH}_${TARGET_ARCH}
173WORLDDEST= ${DESTDIRBASE}/world_${TARGET_ARCH}
174
79aa78bc
MD
175# The bootstrap-tools path is used by the bootstrap-tools, build-tools, and
176# cross-tools stages to augment the existing command path to access newer
177# versions of certain utilities such as 'patch' that the cross-tools stage
178# might expect.
179#
180BTOOLSPATH= ${BTOOLSDEST}/usr/sbin:${BTOOLSDEST}/usr/bin:${BTOOLSDEST}/bin:${BTOOLSDEST}/usr/games
181
1397f94a
MD
182# The strict temporary command path contains all binaries required
183# by the buildworld system after the cross-tools stage.
184#
185STRICTTMPPATH= ${CTOOLSDEST}/usr/sbin:${CTOOLSDEST}/usr/bin:${CTOOLSDEST}/bin:${CTOOLSDEST}/usr/games:${BTOOLSDEST}/usr/sbin:${BTOOLSDEST}/usr/bin:${BTOOLSDEST}/bin:${BTOOLSDEST}/usr/games
984263bc
MD
186
187TMPDIR?= /tmp
188TMPPID!= echo $$$$
984263bc
MD
189
190#
191# Building a world goes through the following stages
192#
193# 1. bootstrap-tool stage [BMAKE]
194# This stage is responsible for creating programs that
195# are needed for backward compatibility reasons. They
196# are not built as cross-tools.
197# 2. build-tool stage [TMAKE]
198# This stage is responsible for creating the object
199# tree and building any tools that are needed during
200# the build process.
201# 3. cross-tool stage [XMAKE]
202# This stage is responsible for creating any tools that
203# are needed for cross-builds. A cross-compiler is one
204# of them.
205# 4. world stage [WMAKE]
206# This stage actually builds the world.
207# 5. install stage (optional) [IMAKE]
208# This stage installs a previously built world.
209#
210
984263bc 211# bootstrap-tool stage
1397f94a
MD
212#
213BMAKEENV= MAKEOBJDIRPREFIX=${BTOOLSDEST} \
214 OBJTREE=${OBJTREE} \
44831353 215 DESTDIR=${BTOOLSDEST} \
79aa78bc 216 PATH=${BTOOLSPATH}:${PATH} \
984263bc 217 INSTALL="sh ${.CURDIR}/tools/install.sh"
1397f94a 218
984263bc
MD
219BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
220 -DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
221 -DNO_WERROR
222
223# build-tool stage
1397f94a
MD
224#
225TMAKEENV= MAKEOBJDIRPREFIX=${BTOOLSDEST} \
226 OBJTREE=${OBJTREE} \
984263bc 227 DESTDIR= \
79aa78bc 228 PATH=${BTOOLSPATH}:${PATH} \
984263bc 229 INSTALL="sh ${.CURDIR}/tools/install.sh"
1397f94a
MD
230
231TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
232 -DNO_FORTRAN
984263bc
MD
233
234# cross-tool stage
1397f94a
MD
235#
236# note: TOOLS_PREFIX points to the obj root holding the cross
44831353
MD
237# compiler binaries, while USRDATA_PREFIX points to the obj root
238# holding the target environment (and also determines where cross-built
239# libraries, crt*.o, and include files are installed).
1397f94a
MD
240#
241XMAKEENV= MAKEOBJDIRPREFIX=${CTOOLSDEST} \
242 OBJTREE=${OBJTREE} \
243 DESTDIR=${CTOOLSDEST} \
244 INSTALL="sh ${.CURDIR}/tools/install.sh" \
245 TOOLS_PREFIX=${CTOOLSDEST} \
79aa78bc
MD
246 USRDATA_PREFIX=${WORLDDEST} \
247 PATH=${BTOOLSPATH}:${PATH}
1397f94a 248
44831353
MD
249XMAKE= ${XMAKEENV} ${MAKE} -f Makefile.inc1 -DNO_FORTRAN -DNO_GDB \
250 -DBOOTSTRAPPING
1397f94a
MD
251
252# world stage, note the strict path and note that TOOLS_PREFIX is left
253# unset and USRDATA_PREFIX (which defaults to TOOLS_PREFIX) is set to empty,
254# which is primarily for the compiler so it targets / (e.g. /usr/<blah>)
255# for both binary and library paths, even though it is being compiled to
256# WORLDDEST. None of the programs in the world stage are ever actually
257# executed during the buildworld/installworld.
258#
259CROSSENV= MAKEOBJDIRPREFIX=${WORLDDEST} \
260 OBJTREE=${OBJTREE} \
261 MACHINE_ARCH=${TARGET_ARCH} \
262 MACHINE=${TARGET} \
263 OBJFORMAT_PATH=${CTOOLSDEST} \
c02263c2
MD
264 GROFF_BIN_PATH=${BTOOLSDEST}/usr/bin \
265 GROFF_FONT_PATH=${BTOOLSDEST}/usr/share/groff_font \
266 GROFF_TMAC_PATH=${BTOOLSDEST}/usr/share/tmac
984263bc 267
984263bc 268WMAKEENV= ${CROSSENV} \
1397f94a 269 DESTDIR=${WORLDDEST} \
984263bc 270 INSTALL="sh ${.CURDIR}/tools/install.sh" \
1397f94a
MD
271 PATH=${STRICTTMPPATH}
272
984263bc
MD
273WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
274
275# install stage
b07b69cc 276#
984263bc 277IMAKEENV= ${CROSSENV} \
1397f94a 278 PATH=${STRICTTMPPATH}
984263bc
MD
279IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
280
281# kernel stage
b07b69cc
MD
282#
283KMAKEENV= ${WMAKEENV}
984263bc 284
984263bc
MD
285# buildworld
286#
287# Attempt to rebuild the entire system, with reasonable chance of
288# success, regardless of how old your existing system is.
289#
290_worldtmp:
291 @echo
292 @echo "--------------------------------------------------------------"
293 @echo ">>> Rebuilding the temporary build tree"
294 @echo "--------------------------------------------------------------"
295.if !defined(NOCLEAN)
1397f94a 296 rm -rf ${BTOOLSDEST} ${CTOOLSDEST} ${WORLDDEST}
984263bc
MD
297.else
298 # XXX - These two can depend on any header file.
299 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
300 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
301.endif
1397f94a
MD
302 mkdir -p ${DESTDIRBASE} ${BTOOLSDEST} ${CTOOLSDEST} ${WORLDDEST}
303.for _dir in ${WORLDDEST} ${BTOOLSDEST} ${CTOOLSDEST}
304 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
305 -p ${_dir}/ > /dev/null
306 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
307 -p ${_dir}/usr > /dev/null
984263bc 308.endfor
1397f94a
MD
309 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
310 -p ${WORLDDEST}/usr/include > /dev/null
311 ln -sf ${.CURDIR}/sys ${WORLDDEST}
312
984263bc
MD
313_bootstrap-tools:
314 @echo
315 @echo "--------------------------------------------------------------"
316 @echo ">>> stage 1: bootstrap tools"
317 @echo "--------------------------------------------------------------"
318 cd ${.CURDIR}; ${BMAKE} bootstrap-tools
319_cleanobj:
984263bc
MD
320 @echo
321 @echo "--------------------------------------------------------------"
1397f94a 322 @echo ">>> stage 2a: cleaning up the object tree"
984263bc
MD
323 @echo "--------------------------------------------------------------"
324 cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
984263bc
MD
325_obj:
326 @echo
327 @echo "--------------------------------------------------------------"
1397f94a 328 @echo ">>> stage 2b: rebuilding the object tree"
984263bc
MD
329 @echo "--------------------------------------------------------------"
330 cd ${.CURDIR}; ${WMAKE} par-obj
331_build-tools:
332 @echo
333 @echo "--------------------------------------------------------------"
1397f94a 334 @echo ">>> stage 2c: build tools"
984263bc
MD
335 @echo "--------------------------------------------------------------"
336 cd ${.CURDIR}; ${TMAKE} build-tools
337_cross-tools:
338 @echo
339 @echo "--------------------------------------------------------------"
340 @echo ">>> stage 3: cross tools"
341 @echo "--------------------------------------------------------------"
342 cd ${.CURDIR}; ${XMAKE} cross-tools
343_includes:
344 @echo
345 @echo "--------------------------------------------------------------"
1397f94a 346 @echo ">>> stage 4a: populating ${WORLDDEST}/usr/include"
984263bc
MD
347 @echo "--------------------------------------------------------------"
348 cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
349_libraries:
350 @echo
351 @echo "--------------------------------------------------------------"
1397f94a 352 @echo ">>> stage 4b: building libraries"
984263bc
MD
353 @echo "--------------------------------------------------------------"
354 cd ${.CURDIR}; ${WMAKE} -DNOHTML -DNOINFO -DNOMAN -DNOFSCHG libraries
355_depend:
356 @echo
357 @echo "--------------------------------------------------------------"
1397f94a 358 @echo ">>> stage 4c: make dependencies"
984263bc
MD
359 @echo "--------------------------------------------------------------"
360 cd ${.CURDIR}; ${WMAKE} par-depend
361everything:
362 @echo
363 @echo "--------------------------------------------------------------"
1397f94a 364 @echo ">>> stage 4d: building everything.."
984263bc
MD
365 @echo "--------------------------------------------------------------"
366 cd ${.CURDIR}; ${WMAKE} all
367
1397f94a
MD
368# note: buildworld no longer depends on _cleanobj because we rm -rf the
369# entire object tree and built the bootstrap tools in a different location.
370#
371# buildworld - build everything from scratch
372# quickworld - skip the bootstrap, build, and cross-build steps
373# realquickworld - skip the bootstrap, build, crossbuild, and depend step.
374#
375# note: we include _obj in realquickworld to prevent accidental creation
376# of files in /usr/src.
984263bc
MD
377
378WMAKE_TGTS=
379.if !defined(SUBDIR_OVERRIDE)
380WMAKE_TGTS+= _worldtmp _bootstrap-tools
381.endif
1397f94a 382WMAKE_TGTS+= _obj _build-tools
984263bc
MD
383.if !defined(SUBDIR_OVERRIDE)
384WMAKE_TGTS+= _cross-tools
385.endif
386WMAKE_TGTS+= _includes _libraries _depend everything
387
388buildworld: ${WMAKE_TGTS}
1397f94a
MD
389
390quickworld: _obj _includes _libraries _depend everything
391
392realquickworld: _obj _includes _libraries everything
393
394crossworld: _worldtmp _bootstrap-tools _obj _build-tools _cross-tools
395
984263bc
MD
396.ORDER: ${WMAKE_TGTS}
397
398#
399# installcheck
400#
401# Checks to be sure system is ready for installworld
402#
403installcheck:
404.if !defined(NO_SENDMAIL)
f35282e3
MD
405 @pw usershow smmsp || (echo "You may need to run 'make preupgrade' first"; exit 1)
406 @pw groupshow smmsp || (echo "You may need to run 'make preupgrade' first"; exit 1)
984263bc 407.endif
f35282e3
MD
408 @pw usershow _pflogd || (echo "You may need to run 'make preupgrade' first"; exit 1)
409 @pw usershow _ntp || (echo "You may need to run 'make preupgrade' first"; exit 1)
410 @pw groupshow authpf || (echo "You may need to run 'make preupgrade' first"; exit 1)
411 @pw groupshow _pflogd || (echo "You may need to run 'make preupgrade' first"; exit 1)
412 @pw groupshow _ntp || (echo "You may need to run 'make preupgrade' first"; exit 1)
413
984263bc
MD
414# distributeworld
415#
416# Distributes everything compiled by a `buildworld'.
417#
418# installworld
419#
420# Installs everything compiled by a 'buildworld'.
421#
422distributeworld installworld: installcheck
984263bc 423 cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}
984263bc
MD
424
425#
426# reinstall
427#
428# If you have a build server, you can NFS mount the source and obj directories
429# and do a 'make reinstall' on the *client* to install new binaries from the
430# most recent server build.
431#
432reinstall:
433 @echo "--------------------------------------------------------------"
434 @echo ">>> Making hierarchy"
435 @echo "--------------------------------------------------------------"
436 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
437 @echo
438 @echo "--------------------------------------------------------------"
439 @echo ">>> Installing everything.."
440 @echo "--------------------------------------------------------------"
441 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
442.if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
443 @echo
444 @echo "--------------------------------------------------------------"
445 @echo ">>> Rebuilding man page indices"
446 @echo "--------------------------------------------------------------"
447 cd ${.CURDIR}/share/man; ${MAKE} makedb
448.endif
449
450redistribute:
451 @echo "--------------------------------------------------------------"
452 @echo ">>> Distributing everything.."
453 @echo "--------------------------------------------------------------"
454 cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
455
456#
fc7aca3e 457# buildkernel, nativekernel, quickkernel, and installkernel
984263bc
MD
458#
459# Which kernels to build and/or install is specified by setting
460# KERNCONF. If not defined a GENERIC kernel is built/installed.
461# Only the existing (depending TARGET) config files are used
462# for building kernels and only the first of these is designated
463# as the one being installed.
464#
c2c83759
MD
465# You can specify INSTALLSTRIPPED=1 if you wish the installed
466# kernel and modules to be stripped of its debug info (required
467# symbols are left intact). You can specify INSTALLSTRIPPEDMODULES
468# if you only want to strip the modules of their debug info. These
469# only apply if you have DEBUG=-g in your kernel config or make line.
470#
984263bc
MD
471# Note that we have to use TARGET instead of TARGET_ARCH when
472# we're in kernel-land. Since only TARGET_ARCH is (expected) to
473# be set to cross-build, we have to make sure TARGET is set
474# properly.
475
476.if !defined(KERNCONF) && defined(KERNEL)
477KERNCONF= ${KERNEL}
478KERNWARN= yes
479.else
480KERNCONF?= GENERIC
481.endif
482INSTKERNNAME?= kernel
483
484KRNLSRCDIR= ${.CURDIR}/sys
485KRNLCONFDIR= ${KRNLSRCDIR}/${TARGET}/conf
486KRNLOBJDIR= ${OBJTREE}${KRNLSRCDIR}
487KERNCONFDIR?= ${KRNLCONFDIR}
488
489BUILDKERNELS=
490INSTALLKERNEL=
491.for _kernel in ${KERNCONF}
492.if exists(${KERNCONFDIR}/${_kernel})
493BUILDKERNELS+= ${_kernel}
494.if empty(INSTALLKERNEL)
495INSTALLKERNEL= ${_kernel}
496.endif
497.endif
498.endfor
499
9a359590
MD
500# kernel version numbers survive rm -rf
501#
502.for _kernel in ${BUILDKERNELS}
503.if exists(${KRNLOBJDIR}/${_kernel}/version)
504KERNEL_VERSION_${_kernel} != cat ${KRNLOBJDIR}/${_kernel}/version
505.endif
506.endfor
507
984263bc
MD
508#
509# buildkernel
510#
511# Builds all kernels defined by BUILDKERNELS.
512#
fc7aca3e 513bk_tools:
e05c8c84
MD
514 @if [ ! -f ${WORLDDEST}/.libraries_done ]; then \
515 echo "You must buildworld before buildkernel. If you wish"; \
516 echo "to build a kernel using native tools, config it manually"; \
517 echo "or use the nativekernel target if you are in a rush"; \
518 exit 1; \
c2c83759
MD
519 fi
520
521maybe_bk_tools:
522.for _kernel in ${BUILDKERNELS}
523 @if [ ! -f ${KRNLOBJDIR}/${_kernel}/.nativekernel_run ]; then \
524 if [ ! -f ${WORLDDEST}/.libraries_done ]; then \
525 echo "The kernel was build using buildworld tools which no" ; \
526 echo "longer appear to exist, quickkernel failed!" ; \
527 exit 1; \
528 fi; \
529 fi
530.endfor
e05c8c84 531
fc7aca3e 532bk_build_list:
984263bc
MD
533.if empty(BUILDKERNELS)
534 @echo ">>> ERROR: Missing kernel configuration file(s) (${KERNCONF})."
535 @false
536.endif
fc7aca3e
MD
537
538bk_kernwarn:
984263bc
MD
539.if defined(KERNWARN)
540 @echo "--------------------------------------------------------------"
541 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
542 @echo "--------------------------------------------------------------"
543 @sleep 3
544.endif
545 @echo
fc7aca3e
MD
546
547# The buildkernel target rebuilds the specified kernels from scratch
548# using the crossbuild tools generated by the last buildworld. It is
549# the safest (but also the most time consuming) way to build a new kernel.
550#
551buildkernel: bk_tools bk_build_list bk_kernwarn
984263bc
MD
552.for _kernel in ${BUILDKERNELS}
553 @echo "--------------------------------------------------------------"
554 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
555 @echo "--------------------------------------------------------------"
556 @echo "===> ${_kernel}"
fc7aca3e
MD
557.if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
558 rm -rf ${KRNLOBJDIR}/${_kernel}
559.else
e05c8c84 560 @if [ -f ${KRNLOBJDIR}/${_kernel}/.nativekernel_run ]; then \
fc7aca3e 561 echo "YOU ARE REBUILDING WITH BUILDKERNEL, REMOVING OLD NATIVEKERNEL BUILD"; \
e05c8c84 562 rm -rf ${KRNLOBJDIR}/${_kernel}; fi
fc7aca3e 563.endif
984263bc
MD
564 mkdir -p ${KRNLOBJDIR}
565.if !defined(NO_KERNELCONFIG)
566 cd ${KRNLCONFDIR}; \
1397f94a 567 PATH=${STRICTTMPPATH} \
984263bc
MD
568 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
569 ${KERNCONFDIR}/${_kernel}
9a359590
MD
570.endif
571.if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN) && defined(KERNEL_VERSION_${_kernel})
572 echo ${KERNEL_VERSION_${_kernel}} > ${KRNLOBJDIR}/${_kernel}/version
984263bc 573.endif
e05c8c84 574 touch ${KRNLOBJDIR}/${_kernel}/.buildkernel_run
984263bc 575 cd ${KRNLOBJDIR}/${_kernel}; \
9f3906fd
MD
576 MAKESRCPATH=${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm \
577 ${MAKE} -DBOOTSTRAPPING -f ${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm/Makefile
984263bc
MD
578.if !defined(NO_KERNELDEPEND)
579 cd ${KRNLOBJDIR}/${_kernel}; \
580 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
581.endif
582 cd ${KRNLOBJDIR}/${_kernel}; \
583 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
584 @echo "--------------------------------------------------------------"
585 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
586 @echo "--------------------------------------------------------------"
587.endfor
588
fc7aca3e
MD
589# The nativekernel target rebuilds the specified kernels from scratch
590# using the systems standard compiler rather then using the crossbuild
591# tools generated by the last buildworld. This is fairly safe if your
592# system is reasonable up-to-date.
e05c8c84 593#
fc7aca3e 594nativekernel: bk_build_list bk_kernwarn
e05c8c84
MD
595.for _kernel in ${BUILDKERNELS}
596 @echo "--------------------------------------------------------------"
597 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
598 @echo "--------------------------------------------------------------"
599 @echo "===> ${_kernel}"
fc7aca3e
MD
600.if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN)
601 rm -rf ${KRNLOBJDIR}/${_kernel}
602.else
e05c8c84 603 @if [ -f ${KRNLOBJDIR}/${_kernel}/.buildkernel_run ]; then \
fc7aca3e 604 echo "YOU ARE REBUILDING WITH NATIVEKERNEL, REMOVING OLD BUILDKERNEL BUILD"; \
e05c8c84 605 rm -rf ${KRNLOBJDIR}/${_kernel}; fi
fc7aca3e 606.endif
e05c8c84
MD
607 mkdir -p ${KRNLOBJDIR}
608.if !defined(NO_KERNELCONFIG)
609 cd ${KRNLCONFDIR}; \
610 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
611 ${KERNCONFDIR}/${_kernel}
9a359590
MD
612.endif
613.if !defined(NOCLEAN) && !defined(NO_KERNELCLEAN) && defined(KERNEL_VERSION_${_kernel})
614 echo ${KERNEL_VERSION_${_kernel}} > ${KRNLOBJDIR}/${_kernel}/version
e05c8c84
MD
615.endif
616 touch ${KRNLOBJDIR}/${_kernel}/.nativekernel_run
e05c8c84
MD
617 cd ${KRNLOBJDIR}/${_kernel}; \
618 MAKESRCPATH=${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm \
619 ${MAKE} -DBOOTSTRAPPING -f ${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm/Makefile
620.if !defined(NO_KERNELDEPEND)
621 cd ${KRNLOBJDIR}/${_kernel}; \
622 ${MAKE} KERNEL=${INSTKERNNAME} depend
623.endif
624 cd ${KRNLOBJDIR}/${_kernel}; \
625 ${MAKE} KERNEL=${INSTKERNNAME} all
626 @echo "--------------------------------------------------------------"
627 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
628 @echo "--------------------------------------------------------------"
629.endfor
630
fc7aca3e
MD
631# The quickkernel target rebuilds the specified kernels as quickly
632# as possible. It will use the native tools or the buildworld cross tools
633# based on whether the kernel was originally generated via buildkernel or
634# nativekernel. Config is rerun but the object hierarchy is not rebuilt,
635# nor is the make depend step run.
984263bc 636#
c2c83759 637quickkernel: maybe_bk_tools bk_build_list bk_kernwarn
fc7aca3e
MD
638.for _kernel in ${BUILDKERNELS}
639 @echo "--------------------------------------------------------------"
640 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
641 @echo "--------------------------------------------------------------"
642 @echo "===> ${_kernel}"
643.if exists(${KRNLOBJDIR}/${_kernel}/.buildkernel_run)
644.if !defined(NO_KERNELCONFIG)
645 cd ${KRNLCONFDIR}; \
646 PATH=${STRICTTMPPATH} \
647 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
648 ${KERNCONFDIR}/${_kernel}
649.endif
650 cd ${KRNLOBJDIR}/${_kernel}; \
651 ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
652.else
653.if !defined(NO_KERNELCONFIG)
654 cd ${KRNLCONFDIR}; \
655 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
656 ${KERNCONFDIR}/${_kernel}
657.endif
658 cd ${KRNLOBJDIR}/${_kernel}; \
659 ${MAKE} KERNEL=${INSTKERNNAME} all
660.endif
661 @echo "--------------------------------------------------------------"
662 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
663 @echo "--------------------------------------------------------------"
664.endfor
665
666
984263bc
MD
667# installkernel
668#
669# Install the kernel defined by INSTALLKERNEL
670#
671installkernel reinstallkernel:
c2c83759 672.if exists(${KRNLOBJDIR}/${_kernel}/.buildkernel_run)
984263bc
MD
673 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
674 ${CROSSENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
c2c83759
MD
675.else
676 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
677 ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
678.endif
984263bc
MD
679
680#
681# update
682#
683# Update the source tree, by running sup and/or running cvs to update to the
684# latest copy.
685#
686update:
687.if defined(SUP_UPDATE)
688 @echo "--------------------------------------------------------------"
689 @echo ">>> Running ${SUP}"
690 @echo "--------------------------------------------------------------"
691.if defined(SUPFILE)
692 @${SUP} ${SUPFLAGS} ${SUPFILE}
693.endif
694.if defined(SUPFILE1)
695 @${SUP} ${SUPFLAGS} ${SUPFILE1}
696.endif
697.if defined(SUPFILE2)
698 @${SUP} ${SUPFLAGS} ${SUPFILE2}
699.endif
700.if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
701 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
702.endif
703.if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
704 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
705.endif
706.endif
707.if defined(CVS_UPDATE)
708 @echo "--------------------------------------------------------------"
9a359590 709 @echo ">>> Updating ${.CURDIR} from cvs repository `cat ${.CURDIR}/CVS/Root`"
984263bc 710 @echo "--------------------------------------------------------------"
9a359590
MD
711 @sleep 2
712 cd ${.CURDIR}; cvs -q update -P -d
984263bc
MD
713.endif
714
715#
716# most
717#
718# Build most of the user binaries on the existing system libs and includes.
719#
720most:
721 @echo "--------------------------------------------------------------"
722 @echo ">>> Building programs only"
723 @echo "--------------------------------------------------------------"
724.for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
725 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ all
726.endfor
727
728#
729# installmost
730#
731# Install the binaries built by the 'most' target. This does not include
732# libraries or include files.
733#
734installmost:
735 @echo "--------------------------------------------------------------"
736 @echo ">>> Installing programs only"
737 @echo "--------------------------------------------------------------"
738.for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
739 cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ install
740.endfor
741
742#
743# ------------------------------------------------------------------------
744#
745# From here onwards are utility targets used by the 'make world' and
746# related targets. If your 'world' breaks, you may like to try to fix
747# the problem and manually run the following targets to attempt to
748# complete the build. Beware, this is *not* guaranteed to work, you
749# need to have a pretty good grip on the current state of the system
750# to attempt to manually finish it. If in doubt, 'make world' again.
751#
752
79aa78bc
MD
753# bootstrap-tools: Build all tools required to build all tools. Note that
754# order is important in a number of cases and also note that the bootstrap
755# and build tools stages have access to earlier binaries they themselves
756# had generated.
984263bc 757#
79aa78bc
MD
758# patch: older patch's do not have -i. This program must be built
759# first so other bootstrap tools that need to apply patches
760# can use it.
17030342
MD
761# [x]install: dependancies on various new install features
762# rpcgen: old rpcgen used a hardwired cpp path, newer OBJFORMAT_PATH
763# envs are not compatible with older objformat binaries.
764#
984263bc
MD
765.if exists(${.CURDIR}/games) && !defined(NOGAMES)
766_strfile= games/fortune/strfile
767.endif
768
769bootstrap-tools:
1397f94a 770.for _tool in ${_strfile} \
1a7434d5 771 usr.bin/patch \
1397f94a
MD
772 bin/chmod bin/cp bin/dd bin/mkdir bin/rm bin/echo bin/test \
773 bin/cat bin/date bin/ln bin/mv bin/csh bin/expr bin/sh bin/ls \
b07b69cc 774 bin/hostname bin/kill \
1397f94a
MD
775 sbin/sysctl \
776 usr.bin/yacc usr.bin/colldef usr.bin/uudecode usr.bin/xinstall \
97da8ecb 777 usr.bin/m4 usr.bin/rpcgen usr.bin/make usr.bin/awk \
1397f94a
MD
778 usr.bin/find usr.bin/lex usr.bin/sed usr.bin/uname usr.bin/touch \
779 usr.bin/mkdep usr.bin/mktemp usr.bin/lorder usr.bin/file2c \
780 usr.bin/tsort usr.bin/tr usr.bin/join usr.bin/wc usr.bin/basename \
781 usr.bin/gencat usr.bin/chflags usr.bin/expand usr.bin/paste \
b07b69cc 782 usr.bin/mklocale usr.bin/uuencode usr.bin/compile_et usr.bin/hexdump \
1397f94a 783 usr.bin/vi usr.bin/cap_mkdb usr.bin/vgrind usr.bin/true usr.bin/false \
c02263c2 784 usr.bin/cmp usr.bin/xargs usr.bin/id usr.bin/env usr.bin/dirname \
1397f94a 785 usr.sbin/chown usr.sbin/mtree usr.sbin/config \
8a48ec64 786 usr.sbin/btxld usr.sbin/pwd_mkdb usr.sbin/zic usr.sbin/makewhatis \
1397f94a 787 gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo \
79aa78bc 788 gnu/usr.bin/grep gnu/usr.bin/sort \
7acf311f 789 usr.bin/gzip usr.bin/bzip2
1397f94a 790 ${ECHODIR} "===> ${_tool} (bootstrap-tools)"; \
984263bc
MD
791 cd ${.CURDIR}/${_tool}; \
792 ${MAKE} DIRPRFX=${_tool}/ obj; \
793 ${MAKE} DIRPRFX=${_tool}/ depend; \
794 ${MAKE} DIRPRFX=${_tool}/ all; \
1397f94a 795 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${BTOOLSDEST} install
984263bc 796.endfor
e05c8c84 797 touch ${BTOOLSDEST}/.bootstrap_done
984263bc 798
17030342
MD
799# build-tools: Build special purpose build tools. gcc2 related tools are
800# only built under the i386 architecture. Other architectures are
801# gcc3-only.
984263bc 802#
1397f94a
MD
803# XXX we may be able to remove or consolidate this into bootstrap-tools
804# now that we have the native helper (.nx/.no) infrastructure.
805#
984263bc
MD
806.if exists(${.CURDIR}/games) && !defined(NOGAMES)
807_games= games/adventure games/hack games/phantasia
808.endif
809
810.if exists(${.CURDIR}/share) && !defined(NOSHARE)
811_share= share/syscons/scrnmaps
812.endif
813
4db2a28c 814_gcc34_cross= gnu/usr.bin/cc34
c32e17fc 815_gcc34_tools= gnu/usr.bin/cc34/cc_prep gnu/usr.bin/cc34/cc_tools
17030342
MD
816.if ${MACHINE_ARCH} == "i386" && ${TARGET_ARCH} == "i386"
817_gcc2_cross= gnu/usr.bin/cc
818_gcc2_tools= gnu/usr.bin/cc/cc_tools
4f50e548 819_binutils= gnu/usr.bin/binutils gnu/usr.bin/binutils215
17030342 820.else
4f50e548 821_binutils= gnu/usr.bin/binutils215
17030342
MD
822.endif
823
984263bc 824.if !defined(NO_FORTRAN)
17030342 825.if ${TARGET_ARCH} == "i386"
984263bc 826_fortran= gnu/usr.bin/cc/f771
17030342 827.else
4db2a28c 828_fortran= gnu/usr.bin/cc34/f771
17030342 829.endif
984263bc
MD
830.endif
831
984263bc
MD
832.if exists(${.CURDIR}/kerberos5) && exists(${.CURDIR}/crypto) && \
833 !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
834_libkrb5= kerberos5/lib/libroken kerberos5/lib/libvers \
835 kerberos5/lib/libasn1 kerberos5/lib/libhdb kerberos5/lib/libsl
836.endif
837
838.if defined(RELEASEDIR)
839_sysinstall= release/sysinstall
840.endif
841
842build-tools:
73e93a5d 843.for _tool in ${_gcc2_tools} ${_gcc34_tools} \
de567082 844 ${_fortran} ${_libroken4} ${_libkrb5} \
1397f94a
MD
845 ${_share} ${_sysinstall}
846 ${ECHODIR} "===> ${_tool} (build-tools)"; \
984263bc
MD
847 cd ${.CURDIR}/${_tool}; \
848 ${MAKE} DIRPRFX=${_tool}/ obj; \
1397f94a
MD
849 ${MAKE} DIRPRFX=${_tool}/ depend; \
850 ${MAKE} DIRPRFX=${_tool}/ all; \
851 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${BTOOLSDEST} install
984263bc 852.endfor
e05c8c84 853 touch ${BTOOLSDEST}/.build_done
984263bc
MD
854
855#
856# cross-tools: Build cross-building tools
857#
858.if ${TARGET_ARCH} == "alpha" && ${MACHINE_ARCH} != "alpha"
859_elf2exe= usr.sbin/elf2exe
860.endif
861
862.if ${TARGET_ARCH} == "i386" && ${MACHINE_ARCH} != "i386"
863_btxld= usr.sbin/btxld
864.endif
865
866cross-tools:
17030342
MD
867.for _tool in ${_btxld} ${_elf2exe} ${_binutils} \
868 usr.bin/objformat usr.sbin/crunch/crunchide \
73e93a5d 869 ${_gcc2_cross} ${_gcc34_cross}
1397f94a 870 ${ECHODIR} "===> ${_tool} (cross-tools)"; \
984263bc
MD
871 cd ${.CURDIR}/${_tool}; \
872 ${MAKE} DIRPRFX=${_tool}/ obj; \
873 ${MAKE} DIRPRFX=${_tool}/ depend; \
874 ${MAKE} DIRPRFX=${_tool}/ all; \
1397f94a 875 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${CTOOLSDEST} install
984263bc 876.endfor
e05c8c84 877 touch ${CTOOLSDEST}/.cross_done
984263bc
MD
878
879#
880# hierarchy - ensure that all the needed directories are present
881#
882hierarchy:
883 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
884
885#
886# libraries - build all libraries, and install them under ${DESTDIR}.
887#
888# The list of libraries with dependents (${_prebuild_libs}) and their
889# interdependencies (__L) are built automatically by the
890# ${.CURDIR}/tools/make_libdeps.sh script.
891#
5228fe46
MD
892# .makeenv does not work when bootstrapping from 4.x, so we must be sure
893# to specify the correct CCVER or 'cc' will not exec the correct compiler.
894#
984263bc
MD
895libraries:
896 cd ${.CURDIR}; \
4db2a28c
MD
897 HOST_CCVER=${HOST_CCVER} CCVER=gcc2 \
898 ${MAKE} -f Makefile.inc1 _startup_libs2; \
4db2a28c
MD
899 HOST_CCVER=${HOST_CCVER} CCVER=gcc34 \
900 ${MAKE} -f Makefile.inc1 _startup_libs34; \
984263bc
MD
901 ${MAKE} -f Makefile.inc1 _startup_libs; \
902 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
903 ${MAKE} -f Makefile.inc1 _generic_libs;
e05c8c84 904 touch ${WORLDDEST}/.libraries_done
984263bc
MD
905
906# These dependencies are not automatically generated:
907#
0fda1879 908# gnu/lib/libgcc and lib/csu must be built before all
5228fe46
MD
909# shared libraries for ELF. The targets for _startup_libs{2,3} are
910# specifically built using gcc{2,3}.
984263bc 911#
0fda1879 912_startup_libs2= gnu/lib/gcc2/libgcc
4db2a28c 913_startup_libs34= gnu/lib/gcc34/libgcc
aa8d5dcb
DR
914.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
915_startup_libs= lib/csu/${MACHINE_ARCH}-elf
984263bc 916.else
5228fe46 917_startup_libs= lib/csu/${MACHINE_ARCH}
984263bc 918.endif
0fda1879 919_startup_libs+= lib/csu/common lib/libc
984263bc 920
faeb88ed 921_prebuild_libs= lib/libarchive
984263bc
MD
922
923_generic_libs= gnu/lib
924
984263bc
MD
925.if !defined(NOCRYPT) && defined(MAKE_KERBEROS5)
926_prebuild_libs+= kerberos5/lib/libasn1
927_prebuild_libs+= kerberos5/lib/libgssapi
928_prebuild_libs+= kerberos5/lib/libkrb5
929_prebuild_libs+= kerberos5/lib/libroken
930_generic_libs+= kerberos5/lib
931.endif
932
984263bc
MD
933_prebuild_libs+= lib/libcom_err lib/libcrypt lib/libmd \
934 lib/libncurses lib/libopie lib/libradius lib/libskey \
935 lib/libtacplus lib/libutil \
f5217ad9 936 lib/libz lib/msun
984263bc
MD
937
938lib/libopie__L lib/libradius__L lib/libtacplus__L: lib/libmd__L
939lib/libskey__L: lib/libcrypt__L lib/libmd__L
940
941_generic_libs+= lib
942
de347b31 943.if !defined(NOCRYPT)
984263bc
MD
944.if !defined(NO_OPENSSL)
945_prebuild_libs+= secure/lib/libcrypto secure/lib/libssl
946.if !defined(NO_OPENSSH)
947_prebuild_libs+= secure/lib/libssh
948secure/lib/libssh__L: secure/lib/libcrypto__L lib/libz__L
949.endif
950.endif
951_generic_libs+= secure/lib
952.endif
953
954_generic_libs+= usr.bin/lex/lib
955
956.if ${MACHINE_ARCH} == "i386"
957_generic_libs+= usr.sbin/pcvt/keycap
958.endif
959
4db2a28c
MD
960.for _lib in ${_startup_libs2} ${_startup_libs3} ${_startup_libs34} \
961 ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
984263bc
MD
962${_lib}__L: .PHONY
963.if exists(${.CURDIR}/${_lib})
964 ${ECHODIR} "===> ${_lib}"; \
965 cd ${.CURDIR}/${_lib}; \
966 ${MAKE} DIRPRFX=${_lib}/ depend; \
967 ${MAKE} DIRPRFX=${_lib}/ all; \
968 ${MAKE} DIRPRFX=${_lib}/ install
969.endif
970.endfor
971
17030342
MD
972# only mess with gcc2 for i386 architectures.
973#
984263bc 974_startup_libs: ${_startup_libs:S/$/__L/}
17030342 975.if ${TARGET_ARCH} == "i386"
5228fe46 976_startup_libs2: ${_startup_libs2:S/$/__L/}
17030342
MD
977.else
978_startup_libs2:
979.endif
5228fe46 980_startup_libs3: ${_startup_libs3:S/$/__L/}
4db2a28c 981_startup_libs34: ${_startup_libs34:S/$/__L/}
984263bc
MD
982_prebuild_libs: ${_prebuild_libs:S/$/__L/}
983_generic_libs: ${_generic_libs:S/$/__L/}
984
1397f94a
MD
985# library targets must be ordered because there are inter-library
986# races (e.g. generation of tconfig.h)
987#
988.ORDER: ${_startup_libs2:S/$/__L/}
989.ORDER: ${_startup_libs3:S/$/__L/}
4db2a28c 990.ORDER: ${_startup_libs34:S/$/__L/}
1397f94a
MD
991.ORDER: ${_startup_libs:S/$/__L/}
992.ORDER: ${_prebuild_libs:S/$/__L/}
993.ORDER: ${_generic_libs:S/$/__L/}
994
995.for __target in clean cleandepend cleandir obj depend includes
984263bc
MD
996.for entry in ${SUBDIR}
997${entry}.${__target}__D: .PHONY
998 @if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
999 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH}"; \
1000 edir=${entry}.${MACHINE_ARCH}; \
1001 cd ${.CURDIR}/$${edir}; \
1002 else \
1003 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
1004 edir=${entry}; \
1005 cd ${.CURDIR}/$${edir}; \
1006 fi; \
1007 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
1008.endfor
1009par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
1397f94a 1010.ORDER: ${SUBDIR:S/$/.${__target}__D/}
984263bc 1011.endfor
1397f94a 1012.ORDER: par-clean par-cleandepend par-cleandir par-obj par-depend par-includes
984263bc 1013
cb0f1574
MD
1014# The wmake target is used by /usr/bin/wmake to run make in a
1015# world build environment.
1016#
1017wmake:
1397f94a 1018 @echo '${WMAKEENV} ${MAKE} -m ${.CURDIR}/share/mk ${WMAKE_ARGS}'
cb0f1574 1019
5c7da0d7
MD
1020wmakeenv:
1021 @echo '${WMAKEENV} /bin/sh'
1022
1397f94a
MD
1023bmake:
1024 @echo '${BMAKEENV} ${MAKE} -m ${.CURDIR}/share/mk ${BMAKE_ARGS}'
1025
17030342
MD
1026bmakeenv:
1027 @echo '${BMAKEENV} /bin/sh'
1028
1397f94a
MD
1029tmake:
1030 @echo '${TMAKEENV} ${MAKE} -m ${.CURDIR}/share/mk ${TMAKE_ARGS}'
1031
17030342
MD
1032tmakeenv:
1033 @echo '${TMAKEENV} /bin/sh'
1034
984263bc 1035.include <bsd.subdir.mk>
cb0f1574 1036