Deleted Added
full compact
Makefile (30277) Makefile (32427)
1#
1#
2# $Id: Makefile,v 1.154 1997/10/07 11:32:05 bde Exp $
2# $Id: Makefile,v 1.155 1997/10/10 13:02:36 asami Exp $
3#
3#
4# While porting to the Alpha architecture include the bootstrap instead
5# of the normal build.
6#
7.if ${MACHINE} == "alpha"
8.include "Makefile.alpha"
9.else
10#
4# Make command line options:
5# -DCLOBBER will remove /usr/include
6# -DMAKE_KERBEROS4 to build KerberosIV
7# -DALLLANG to build documentation for all languages
8# (where available -- see share/doc/Makefile)
9#
10# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
11# -DNOCLEAN do not clean at all
12# -DNOCRYPT will prevent building of crypt versions
13# -DNOLKM do not build loadable kernel modules
14# -DNOOBJDIR do not run ``${MAKE} obj''
15# -DNOPROFILE do not build profiled libraries
16# -DNOSECURE do not go into secure subdir
17# -DNOGAMES do not go into games subdir
18# -DNOSHARE do not go into share subdir
19# -DNOINFO do not make or install info files
20# -DNOLIBC_R do not build libc_r.
21# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
22
23#
24# The intended user-driven targets are:
25# buildworld - rebuild *everything*, including glue to help do upgrades
26# installworld- install everything built by "buildworld"
27# world - buildworld + installworld
28# update - convenient way to update your source tree (eg: sup/cvs)
29# most - build user commands, no libraries or include files
30# installmost - install user commands, no libraries or include files
31#
32# Standard targets (not defined here) are documented in the makefiles in
33# /usr/share/mk. These include:
34# obj depend all install clean cleandepend cleanobj
35
36.if (!make(world)) && (!make(buildworld)) && (!make(installworld))
37.MAKEFLAGS:= ${.MAKEFLAGS} -m ${.CURDIR}/share/mk
38.endif
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(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(include)
53SUBDIR+= include
54.endif
55.if exists(lib)
56SUBDIR+= lib
57.endif
58
59.if exists(bin)
60SUBDIR+= bin
61.endif
62.if exists(games) && !defined(NOGAMES)
63SUBDIR+= games
64.endif
65.if exists(gnu)
66SUBDIR+= gnu
67.endif
68.if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
69SUBDIR+= kerberosIV
70.endif
71.if exists(libexec)
72SUBDIR+= libexec
73.endif
74.if exists(sbin)
75SUBDIR+= sbin
76.endif
77.if exists(share) && !defined(NOSHARE)
78SUBDIR+= share
79.endif
80.if exists(sys)
81SUBDIR+= sys
82.endif
83.if exists(usr.bin)
84SUBDIR+= usr.bin
85.endif
86.if exists(usr.sbin)
87SUBDIR+= usr.sbin
88.endif
89.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
90SUBDIR+= secure
91.endif
92.if exists(lkm) && !defined(NOLKM)
93SUBDIR+= lkm
94.endif
95
96# etc must be last for "distribute" to work
97.if exists(etc) && make(distribute)
98SUBDIR+= etc
99.endif
100
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(${_DIR}) & exists(${_DIR}/Makefile)
106SUBDIR+= ${_DIR}
107.endif
108.endfor
109.endif
110
111# Handle -DNOOBJDIR, -DNOCLEAN and -DNOCLEANDIR
112.if defined(NOOBJDIR)
113OBJDIR=
114.else
115OBJDIR= obj
116.endif
117
118.if defined(NOCLEAN)
119CLEANDIR=
120.else
121.if defined(NOCLEANDIR)
122CLEANDIR= clean
123.else
124CLEANDIR= cleandir
125.endif
126.endif
127
128SUP?= sup
129SUPFLAGS?= -v
130
131#
132# While building tools for bootstrapping, we dont need to waste time on
133# profiled libraries or man pages. This speeds things up somewhat.
134#
135MK_FLAGS= -DNOINFO -DNOMAN -DNOPROFILE
136
137#
138# world
139#
140# Attempt to rebuild and reinstall *everything*, with reasonable chance of
141# success, regardless of how old your existing system is.
142#
143# >> Beware, it overwrites the local build environment! <<
144#
145world:
146 @echo "--------------------------------------------------------------"
147 @echo "make world started on `LC_TIME=C date`"
148 @echo "--------------------------------------------------------------"
149.if target(pre-world)
150 @echo
151 @echo "--------------------------------------------------------------"
152 @echo " Making 'pre-world' target"
153 @echo "--------------------------------------------------------------"
154 cd ${.CURDIR} && ${MAKE} pre-world
155.endif
156 cd ${.CURDIR} && ${MAKE} buildworld
157 cd ${.CURDIR} && ${MAKE} -B installworld
158.if target(post-world)
159 @echo
160 @echo "--------------------------------------------------------------"
161 @echo " Making 'post-world' target"
162 @echo "--------------------------------------------------------------"
163 cd ${.CURDIR} && ${MAKE} post-world
164.endif
165 @echo
166 @echo "--------------------------------------------------------------"
167 @echo "make world completed on `LC_TIME=C date`"
168 @echo "--------------------------------------------------------------"
169
170.if defined(MAKEOBJDIRPREFIX)
171WORLDTMP= ${MAKEOBJDIRPREFIX}${.CURDIR}/tmp
172.else
173WORLDTMP= /usr/obj${.CURDIR}/tmp
174.endif
175STRICTTMPPATH= ${WORLDTMP}/sbin:${WORLDTMP}/usr/sbin:${WORLDTMP}/bin:${WORLDTMP}/usr/bin
176TMPPATH= ${STRICTTMPPATH}:${PATH}
177
178# XXX COMPILER_PATH is needed for finding cc1, ld and as
179# XXX GCC_EXEC_PREFIX is for *crt.o. It is probably unnecssary now
180# tbat LIBRARY_PATH is set. We still can't use -nostdlib, since gcc
181# wouldn't link *crt.o or libgcc if it were used.
182# XXX LD_LIBRARY_PATH is for ld.so. It is also used by ld, although we don't
183# want that - all compile-time library paths should be resolved by gcc.
184# It fails for set[ug]id executables (are any used?).
185COMPILER_ENV= BISON_SIMPLE=${WORLDTMP}/usr/share/misc/bison.simple \
186 COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \
187 GCC_EXEC_PREFIX=${WORLDTMP}/usr/lib/ \
188 LD_LIBRARY_PATH=${WORLDTMP}${SHLIBDIR} \
189 LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib
190
191BMAKEENV= PATH=${TMPPATH} ${COMPILER_ENV} NOEXTRADEPEND=t
192XMAKEENV= PATH=${STRICTTMPPATH} ${COMPILER_ENV} \
193 CC='cc -nostdinc' # XXX -nostdlib
194
195# used to compile and install 'make' in temporary build tree
196IBMAKE= ${BMAKEENV} ${MAKE} DESTDIR=${WORLDTMP}
197# bootstrap make
198BMAKE= ${BMAKEENV} ${WORLDTMP}/usr/bin/${MAKE} DESTDIR=${WORLDTMP}
199# cross make used for compilation
200XMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/${MAKE} DESTDIR=${WORLDTMP}
201# cross make used for final installation
202IXMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/${MAKE}
203
204#
205# buildworld
206#
207# Attempt to rebuild the entire system, with reasonable chance of
208# success, regardless of how old your existing system is.
209#
210buildworld:
211.if !defined(NOCLEAN)
212 @echo
213 @echo "--------------------------------------------------------------"
214 @echo " Cleaning up the temporary build tree"
215 @echo "--------------------------------------------------------------"
216 mkdir -p ${WORLDTMP}
217 chflags -R noschg ${WORLDTMP}/
218 rm -rf ${WORLDTMP}
219.endif
220 @echo
221 @echo "--------------------------------------------------------------"
222 @echo " Making make"
223 @echo "--------------------------------------------------------------"
224 mkdir -p ${WORLDTMP}/usr/bin
225.if !defined(NOCLEAN) || !defined(NOOBJDIR)
226 cd ${.CURDIR}/usr.bin/make && \
227 ${IBMAKE} -I${.CURDIR}/share/mk ${CLEANDIR} ${OBJDIR}
228.endif
229 cd ${.CURDIR}/usr.bin/make && \
230 ${IBMAKE} -I${.CURDIR}/share/mk depend && \
231 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} all && \
232 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} install && \
233 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} clean cleandepend
234 @echo
235 @echo "--------------------------------------------------------------"
236 @echo " Making hierarchy"
237 @echo "--------------------------------------------------------------"
238 cd ${.CURDIR} && ${BMAKE} hierarchy
239.if !defined(NOCLEAN)
240 @echo
241 @echo "--------------------------------------------------------------"
242 @echo " Cleaning up the obj tree"
243 @echo "--------------------------------------------------------------"
244 cd ${.CURDIR} && ${BMAKE} par-${CLEANDIR}
245.endif
246.if !defined(NOOBJDIR)
247 @echo
248 @echo "--------------------------------------------------------------"
249 @echo " Rebuilding the obj tree"
250 @echo "--------------------------------------------------------------"
251 cd ${.CURDIR} && ${BMAKE} par-obj
252.endif
253 @echo
254 @echo "--------------------------------------------------------------"
255 @echo " Rebuilding bootstrap tools"
256 @echo "--------------------------------------------------------------"
257 cd ${.CURDIR} && ${BMAKE} bootstrap
258 @echo
259 @echo "--------------------------------------------------------------"
260 @echo " Rebuilding tools necessary to build the include files"
261 @echo "--------------------------------------------------------------"
262 cd ${.CURDIR} && ${BMAKE} include-tools
263 @echo
264 @echo "--------------------------------------------------------------"
265 @echo " Rebuilding /usr/include"
266 @echo "--------------------------------------------------------------"
267 cd ${.CURDIR} && SHARED=symlinks ${BMAKE} includes
268 @echo
269 @echo "--------------------------------------------------------------"
270 @echo " Rebuilding tools needed to build the libraries"
271 @echo "--------------------------------------------------------------"
272 cd ${.CURDIR} && ${BMAKE} lib-tools
273 @echo
274 @echo "--------------------------------------------------------------"
275 @echo " Rebuilding /usr/lib"
276 @echo "--------------------------------------------------------------"
277 cd ${.CURDIR} && ${BMAKE} libraries
278 @echo
279 @echo "--------------------------------------------------------------"
280 @echo " Rebuilding all other tools needed to build the world"
281 @echo "--------------------------------------------------------------"
282 cd ${.CURDIR} && ${BMAKE} build-tools
283 @echo
284 @echo "--------------------------------------------------------------"
285 @echo " Rebuilding dependencies"
286 @echo "--------------------------------------------------------------"
287 cd ${.CURDIR} && ${XMAKE} par-depend
288 @echo
289 @echo "--------------------------------------------------------------"
290 @echo " Building everything.."
291 @echo "--------------------------------------------------------------"
292 cd ${.CURDIR} && ${XMAKE} all
293
294#
295# installworld
296#
297# Installs everything compiled by a 'buildworld'.
298#
299installworld:
300 cd ${.CURDIR} && ${IXMAKE} reinstall
301
302#
303# reinstall
304#
305# If you have a build server, you can NFS mount the source and obj directories
306# and do a 'make reinstall' on the *client* to install new binaries from the
307# most recent server build.
308#
309reinstall:
310 @echo "--------------------------------------------------------------"
311 @echo " Making hierarchy"
312 @echo "--------------------------------------------------------------"
313 cd ${.CURDIR} && ${MAKE} hierarchy
314 @echo
315 @echo "--------------------------------------------------------------"
316 @echo " Installing everything.."
317 @echo "--------------------------------------------------------------"
318 cd ${.CURDIR} && ${MAKE} install
319 @echo
320 @echo "--------------------------------------------------------------"
321 @echo " Rebuilding man page indexes"
322 @echo "--------------------------------------------------------------"
323 cd ${.CURDIR}/share/man && ${MAKE} makedb
324
325#
326# update
327#
328# Update the source tree, by running sup and/or running cvs to update to the
329# latest copy.
330#
331update:
332.if defined(SUP_UPDATE)
333 @echo "--------------------------------------------------------------"
334 @echo "Running sup"
335 @echo "--------------------------------------------------------------"
336 @${SUP} ${SUPFLAGS} ${SUPFILE}
337.if defined(SUPFILE1)
338 @${SUP} ${SUPFLAGS} ${SUPFILE1}
339.endif
340.if defined(SUPFILE2)
341 @${SUP} ${SUPFLAGS} ${SUPFILE2}
342.endif
343.endif
344.if defined(CVS_UPDATE)
345 @echo "--------------------------------------------------------------"
346 @echo "Updating /usr/src from cvs repository" ${CVSROOT}
347 @echo "--------------------------------------------------------------"
348 cd ${.CURDIR} && cvs -q update -P -d
349.endif
350
351#
352# most
353#
354# Build most of the user binaries on the existing system libs and includes.
355#
356most:
357 @echo "--------------------------------------------------------------"
358 @echo " Building programs only"
359 @echo "--------------------------------------------------------------"
360 cd ${.CURDIR}/bin && ${MAKE} all
361 cd ${.CURDIR}/sbin && ${MAKE} all
362 cd ${.CURDIR}/libexec && ${MAKE} all
363 cd ${.CURDIR}/usr.bin && ${MAKE} all
364 cd ${.CURDIR}/usr.sbin && ${MAKE} all
365 cd ${.CURDIR}/gnu/libexec && ${MAKE} all
366 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} all
367 cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} all
368#.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT)
369# cd ${.CURDIR}/kerberosIV && ${MAKE} most
370#.endif
371#.if !defined(NOSECURE) && !defined(NOCRYPT)
372# cd ${.CURDIR}/secure && ${MAKE} most
373#.endif
374
375#
376# installmost
377#
378# Install the binaries built by the 'most' target. This does not include
379# libraries or include files.
380#
381installmost:
382 @echo "--------------------------------------------------------------"
383 @echo " Installing programs only"
384 @echo "--------------------------------------------------------------"
385 cd ${.CURDIR}/bin && ${MAKE} install
386 cd ${.CURDIR}/sbin && ${MAKE} install
387 cd ${.CURDIR}/libexec && ${MAKE} install
388 cd ${.CURDIR}/usr.bin && ${MAKE} install
389 cd ${.CURDIR}/usr.sbin && ${MAKE} install
390 cd ${.CURDIR}/gnu/libexec && ${MAKE} install
391 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} install
392 cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} install
393#.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT)
394# cd ${.CURDIR}/kerberosIV && ${MAKE} installmost
395#.endif
396#.if !defined(NOSECURE) && !defined(NOCRYPT)
397# cd ${.CURDIR}/secure && ${MAKE} installmost
398#.endif
399
400#
401# ------------------------------------------------------------------------
402#
403# From here onwards are utility targets used by the 'make world' and
404# related targets. If your 'world' breaks, you may like to try to fix
405# the problem and manually run the following targets to attempt to
406# complete the build. Beware, this is *not* guaranteed to work, you
407# need to have a pretty good grip on the current state of the system
408# to attempt to manually finish it. If in doubt, 'make world' again.
409#
410
411#
412# heirarchy - ensure that all the needed directories are present
413#
414hierarchy:
415 cd ${.CURDIR}/etc && ${MAKE} distrib-dirs
416
417#
418# bootstrap - [re]build tools needed to run the actual build, this includes
419# tools needed by 'make depend', as some tools are needed to generate source
420# for the dependency information to be gathered from.
421#
422bootstrap:
423.if defined(DESTDIR)
424 rm -f ${DESTDIR}/usr/src/sys
425 ln -s ${.CURDIR}/sys ${DESTDIR}/usr/src
426 cd ${.CURDIR}/include && find -dx . | cpio -dump ${DESTDIR}/usr/include
427 cd ${.CURDIR}/include && make symlinks
428.endif
429 cd ${.CURDIR}/usr.bin/make && ${MAKE} depend && \
430 ${MAKE} ${MK_FLAGS} all && \
431 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
432 cd ${.CURDIR}/usr.bin/xinstall && ${MAKE} depend && \
433 ${MAKE} ${MK_FLAGS} all && \
434 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
435 cd ${.CURDIR}/usr.bin/lex && ${MAKE} bootstrap && ${MAKE} depend && \
436 ${MAKE} ${MK_FLAGS} -DNOLIB all && \
437 ${MAKE} ${MK_FLAGS} -DNOLIB -B install ${CLEANDIR}
438.if !defined(NOOBJDIR)
439 cd ${.CURDIR}/usr.bin/lex && ${MAKE} obj
440.endif
441
442#
443# include-tools - generally the same as 'bootstrap', except that it's for
444# things that are specifically needed to generate include files.
445#
446# XXX should be merged with bootstrap, it's not worth keeeping them separate.
447# Well, maybe it is now. We force 'cleandepend' here to avoid dependencies
448# on cleaned away headers in ${WORLDTMP}.
449#
450include-tools:
451 cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} -B cleandepend depend && \
452 ${MAKE} ${MK_FLAGS} all && \
453 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
454
455#
456# includes - possibly generate and install the include files.
457#
458includes:
459.if defined(CLOBBER)
460 rm -rf ${DESTDIR}/usr/include/*
461 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
462 -p ${DESTDIR}/usr/include
463.endif
464 cd ${.CURDIR}/include && ${MAKE} -B all install
465 cd ${.CURDIR}/gnu/include && ${MAKE} install
466 cd ${.CURDIR}/gnu/lib/libmp && ${MAKE} beforeinstall
467 cd ${.CURDIR}/gnu/lib/libobjc && ${MAKE} beforeinstall
468 cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall
469 cd ${.CURDIR}/gnu/lib/libregex && ${MAKE} beforeinstall
470 cd ${.CURDIR}/gnu/lib/libstdc++ && ${MAKE} beforeinstall
471 cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
472 cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall
473 cd ${.CURDIR}/gnu/lib/libgmp && ${MAKE} beforeinstall
474.if exists(secure) && !defined(NOCRYPT)
475 cd ${.CURDIR}/secure/lib/libdes && ${MAKE} beforeinstall
476.endif
477.if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
478 cd ${.CURDIR}/kerberosIV/lib/libacl && ${MAKE} beforeinstall
479 cd ${.CURDIR}/kerberosIV/lib/libkadm && ${MAKE} beforeinstall
480 cd ${.CURDIR}/kerberosIV/lib/libkafs && ${MAKE} beforeinstall
481 cd ${.CURDIR}/kerberosIV/lib/libkdb && ${MAKE} beforeinstall
482 cd ${.CURDIR}/kerberosIV/lib/libkrb && ${MAKE} beforeinstall
483 cd ${.CURDIR}/kerberosIV/lib/libtelnet && ${MAKE} beforeinstall
484.else
485 cd ${.CURDIR}/lib/libtelnet && ${MAKE} beforeinstall
486.endif
11# Make command line options:
12# -DCLOBBER will remove /usr/include
13# -DMAKE_KERBEROS4 to build KerberosIV
14# -DALLLANG to build documentation for all languages
15# (where available -- see share/doc/Makefile)
16#
17# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
18# -DNOCLEAN do not clean at all
19# -DNOCRYPT will prevent building of crypt versions
20# -DNOLKM do not build loadable kernel modules
21# -DNOOBJDIR do not run ``${MAKE} obj''
22# -DNOPROFILE do not build profiled libraries
23# -DNOSECURE do not go into secure subdir
24# -DNOGAMES do not go into games subdir
25# -DNOSHARE do not go into share subdir
26# -DNOINFO do not make or install info files
27# -DNOLIBC_R do not build libc_r.
28# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
29
30#
31# The intended user-driven targets are:
32# buildworld - rebuild *everything*, including glue to help do upgrades
33# installworld- install everything built by "buildworld"
34# world - buildworld + installworld
35# update - convenient way to update your source tree (eg: sup/cvs)
36# most - build user commands, no libraries or include files
37# installmost - install user commands, no libraries or include files
38#
39# Standard targets (not defined here) are documented in the makefiles in
40# /usr/share/mk. These include:
41# obj depend all install clean cleandepend cleanobj
42
43.if (!make(world)) && (!make(buildworld)) && (!make(installworld))
44.MAKEFLAGS:= ${.MAKEFLAGS} -m ${.CURDIR}/share/mk
45.endif
46
47# Put initial settings here.
48SUBDIR=
49
50# We must do share/info early so that installation of info `dir'
51# entries works correctly. Do it first since it is less likely to
52# grow dependencies on include and lib than vice versa.
53.if exists(share/info)
54SUBDIR+= share/info
55.endif
56
57# We must do include and lib early so that the perl *.ph generation
58# works correctly as it uses the header files installed by this.
59.if exists(include)
60SUBDIR+= include
61.endif
62.if exists(lib)
63SUBDIR+= lib
64.endif
65
66.if exists(bin)
67SUBDIR+= bin
68.endif
69.if exists(games) && !defined(NOGAMES)
70SUBDIR+= games
71.endif
72.if exists(gnu)
73SUBDIR+= gnu
74.endif
75.if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
76SUBDIR+= kerberosIV
77.endif
78.if exists(libexec)
79SUBDIR+= libexec
80.endif
81.if exists(sbin)
82SUBDIR+= sbin
83.endif
84.if exists(share) && !defined(NOSHARE)
85SUBDIR+= share
86.endif
87.if exists(sys)
88SUBDIR+= sys
89.endif
90.if exists(usr.bin)
91SUBDIR+= usr.bin
92.endif
93.if exists(usr.sbin)
94SUBDIR+= usr.sbin
95.endif
96.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
97SUBDIR+= secure
98.endif
99.if exists(lkm) && !defined(NOLKM)
100SUBDIR+= lkm
101.endif
102
103# etc must be last for "distribute" to work
104.if exists(etc) && make(distribute)
105SUBDIR+= etc
106.endif
107
108# These are last, since it is nice to at least get the base system
109# rebuilt before you do them.
110.if defined(LOCAL_DIRS)
111.for _DIR in ${LOCAL_DIRS}
112.if exists(${_DIR}) & exists(${_DIR}/Makefile)
113SUBDIR+= ${_DIR}
114.endif
115.endfor
116.endif
117
118# Handle -DNOOBJDIR, -DNOCLEAN and -DNOCLEANDIR
119.if defined(NOOBJDIR)
120OBJDIR=
121.else
122OBJDIR= obj
123.endif
124
125.if defined(NOCLEAN)
126CLEANDIR=
127.else
128.if defined(NOCLEANDIR)
129CLEANDIR= clean
130.else
131CLEANDIR= cleandir
132.endif
133.endif
134
135SUP?= sup
136SUPFLAGS?= -v
137
138#
139# While building tools for bootstrapping, we dont need to waste time on
140# profiled libraries or man pages. This speeds things up somewhat.
141#
142MK_FLAGS= -DNOINFO -DNOMAN -DNOPROFILE
143
144#
145# world
146#
147# Attempt to rebuild and reinstall *everything*, with reasonable chance of
148# success, regardless of how old your existing system is.
149#
150# >> Beware, it overwrites the local build environment! <<
151#
152world:
153 @echo "--------------------------------------------------------------"
154 @echo "make world started on `LC_TIME=C date`"
155 @echo "--------------------------------------------------------------"
156.if target(pre-world)
157 @echo
158 @echo "--------------------------------------------------------------"
159 @echo " Making 'pre-world' target"
160 @echo "--------------------------------------------------------------"
161 cd ${.CURDIR} && ${MAKE} pre-world
162.endif
163 cd ${.CURDIR} && ${MAKE} buildworld
164 cd ${.CURDIR} && ${MAKE} -B installworld
165.if target(post-world)
166 @echo
167 @echo "--------------------------------------------------------------"
168 @echo " Making 'post-world' target"
169 @echo "--------------------------------------------------------------"
170 cd ${.CURDIR} && ${MAKE} post-world
171.endif
172 @echo
173 @echo "--------------------------------------------------------------"
174 @echo "make world completed on `LC_TIME=C date`"
175 @echo "--------------------------------------------------------------"
176
177.if defined(MAKEOBJDIRPREFIX)
178WORLDTMP= ${MAKEOBJDIRPREFIX}${.CURDIR}/tmp
179.else
180WORLDTMP= /usr/obj${.CURDIR}/tmp
181.endif
182STRICTTMPPATH= ${WORLDTMP}/sbin:${WORLDTMP}/usr/sbin:${WORLDTMP}/bin:${WORLDTMP}/usr/bin
183TMPPATH= ${STRICTTMPPATH}:${PATH}
184
185# XXX COMPILER_PATH is needed for finding cc1, ld and as
186# XXX GCC_EXEC_PREFIX is for *crt.o. It is probably unnecssary now
187# tbat LIBRARY_PATH is set. We still can't use -nostdlib, since gcc
188# wouldn't link *crt.o or libgcc if it were used.
189# XXX LD_LIBRARY_PATH is for ld.so. It is also used by ld, although we don't
190# want that - all compile-time library paths should be resolved by gcc.
191# It fails for set[ug]id executables (are any used?).
192COMPILER_ENV= BISON_SIMPLE=${WORLDTMP}/usr/share/misc/bison.simple \
193 COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \
194 GCC_EXEC_PREFIX=${WORLDTMP}/usr/lib/ \
195 LD_LIBRARY_PATH=${WORLDTMP}${SHLIBDIR} \
196 LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib
197
198BMAKEENV= PATH=${TMPPATH} ${COMPILER_ENV} NOEXTRADEPEND=t
199XMAKEENV= PATH=${STRICTTMPPATH} ${COMPILER_ENV} \
200 CC='cc -nostdinc' # XXX -nostdlib
201
202# used to compile and install 'make' in temporary build tree
203IBMAKE= ${BMAKEENV} ${MAKE} DESTDIR=${WORLDTMP}
204# bootstrap make
205BMAKE= ${BMAKEENV} ${WORLDTMP}/usr/bin/${MAKE} DESTDIR=${WORLDTMP}
206# cross make used for compilation
207XMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/${MAKE} DESTDIR=${WORLDTMP}
208# cross make used for final installation
209IXMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/${MAKE}
210
211#
212# buildworld
213#
214# Attempt to rebuild the entire system, with reasonable chance of
215# success, regardless of how old your existing system is.
216#
217buildworld:
218.if !defined(NOCLEAN)
219 @echo
220 @echo "--------------------------------------------------------------"
221 @echo " Cleaning up the temporary build tree"
222 @echo "--------------------------------------------------------------"
223 mkdir -p ${WORLDTMP}
224 chflags -R noschg ${WORLDTMP}/
225 rm -rf ${WORLDTMP}
226.endif
227 @echo
228 @echo "--------------------------------------------------------------"
229 @echo " Making make"
230 @echo "--------------------------------------------------------------"
231 mkdir -p ${WORLDTMP}/usr/bin
232.if !defined(NOCLEAN) || !defined(NOOBJDIR)
233 cd ${.CURDIR}/usr.bin/make && \
234 ${IBMAKE} -I${.CURDIR}/share/mk ${CLEANDIR} ${OBJDIR}
235.endif
236 cd ${.CURDIR}/usr.bin/make && \
237 ${IBMAKE} -I${.CURDIR}/share/mk depend && \
238 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} all && \
239 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} install && \
240 ${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} clean cleandepend
241 @echo
242 @echo "--------------------------------------------------------------"
243 @echo " Making hierarchy"
244 @echo "--------------------------------------------------------------"
245 cd ${.CURDIR} && ${BMAKE} hierarchy
246.if !defined(NOCLEAN)
247 @echo
248 @echo "--------------------------------------------------------------"
249 @echo " Cleaning up the obj tree"
250 @echo "--------------------------------------------------------------"
251 cd ${.CURDIR} && ${BMAKE} par-${CLEANDIR}
252.endif
253.if !defined(NOOBJDIR)
254 @echo
255 @echo "--------------------------------------------------------------"
256 @echo " Rebuilding the obj tree"
257 @echo "--------------------------------------------------------------"
258 cd ${.CURDIR} && ${BMAKE} par-obj
259.endif
260 @echo
261 @echo "--------------------------------------------------------------"
262 @echo " Rebuilding bootstrap tools"
263 @echo "--------------------------------------------------------------"
264 cd ${.CURDIR} && ${BMAKE} bootstrap
265 @echo
266 @echo "--------------------------------------------------------------"
267 @echo " Rebuilding tools necessary to build the include files"
268 @echo "--------------------------------------------------------------"
269 cd ${.CURDIR} && ${BMAKE} include-tools
270 @echo
271 @echo "--------------------------------------------------------------"
272 @echo " Rebuilding /usr/include"
273 @echo "--------------------------------------------------------------"
274 cd ${.CURDIR} && SHARED=symlinks ${BMAKE} includes
275 @echo
276 @echo "--------------------------------------------------------------"
277 @echo " Rebuilding tools needed to build the libraries"
278 @echo "--------------------------------------------------------------"
279 cd ${.CURDIR} && ${BMAKE} lib-tools
280 @echo
281 @echo "--------------------------------------------------------------"
282 @echo " Rebuilding /usr/lib"
283 @echo "--------------------------------------------------------------"
284 cd ${.CURDIR} && ${BMAKE} libraries
285 @echo
286 @echo "--------------------------------------------------------------"
287 @echo " Rebuilding all other tools needed to build the world"
288 @echo "--------------------------------------------------------------"
289 cd ${.CURDIR} && ${BMAKE} build-tools
290 @echo
291 @echo "--------------------------------------------------------------"
292 @echo " Rebuilding dependencies"
293 @echo "--------------------------------------------------------------"
294 cd ${.CURDIR} && ${XMAKE} par-depend
295 @echo
296 @echo "--------------------------------------------------------------"
297 @echo " Building everything.."
298 @echo "--------------------------------------------------------------"
299 cd ${.CURDIR} && ${XMAKE} all
300
301#
302# installworld
303#
304# Installs everything compiled by a 'buildworld'.
305#
306installworld:
307 cd ${.CURDIR} && ${IXMAKE} reinstall
308
309#
310# reinstall
311#
312# If you have a build server, you can NFS mount the source and obj directories
313# and do a 'make reinstall' on the *client* to install new binaries from the
314# most recent server build.
315#
316reinstall:
317 @echo "--------------------------------------------------------------"
318 @echo " Making hierarchy"
319 @echo "--------------------------------------------------------------"
320 cd ${.CURDIR} && ${MAKE} hierarchy
321 @echo
322 @echo "--------------------------------------------------------------"
323 @echo " Installing everything.."
324 @echo "--------------------------------------------------------------"
325 cd ${.CURDIR} && ${MAKE} install
326 @echo
327 @echo "--------------------------------------------------------------"
328 @echo " Rebuilding man page indexes"
329 @echo "--------------------------------------------------------------"
330 cd ${.CURDIR}/share/man && ${MAKE} makedb
331
332#
333# update
334#
335# Update the source tree, by running sup and/or running cvs to update to the
336# latest copy.
337#
338update:
339.if defined(SUP_UPDATE)
340 @echo "--------------------------------------------------------------"
341 @echo "Running sup"
342 @echo "--------------------------------------------------------------"
343 @${SUP} ${SUPFLAGS} ${SUPFILE}
344.if defined(SUPFILE1)
345 @${SUP} ${SUPFLAGS} ${SUPFILE1}
346.endif
347.if defined(SUPFILE2)
348 @${SUP} ${SUPFLAGS} ${SUPFILE2}
349.endif
350.endif
351.if defined(CVS_UPDATE)
352 @echo "--------------------------------------------------------------"
353 @echo "Updating /usr/src from cvs repository" ${CVSROOT}
354 @echo "--------------------------------------------------------------"
355 cd ${.CURDIR} && cvs -q update -P -d
356.endif
357
358#
359# most
360#
361# Build most of the user binaries on the existing system libs and includes.
362#
363most:
364 @echo "--------------------------------------------------------------"
365 @echo " Building programs only"
366 @echo "--------------------------------------------------------------"
367 cd ${.CURDIR}/bin && ${MAKE} all
368 cd ${.CURDIR}/sbin && ${MAKE} all
369 cd ${.CURDIR}/libexec && ${MAKE} all
370 cd ${.CURDIR}/usr.bin && ${MAKE} all
371 cd ${.CURDIR}/usr.sbin && ${MAKE} all
372 cd ${.CURDIR}/gnu/libexec && ${MAKE} all
373 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} all
374 cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} all
375#.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT)
376# cd ${.CURDIR}/kerberosIV && ${MAKE} most
377#.endif
378#.if !defined(NOSECURE) && !defined(NOCRYPT)
379# cd ${.CURDIR}/secure && ${MAKE} most
380#.endif
381
382#
383# installmost
384#
385# Install the binaries built by the 'most' target. This does not include
386# libraries or include files.
387#
388installmost:
389 @echo "--------------------------------------------------------------"
390 @echo " Installing programs only"
391 @echo "--------------------------------------------------------------"
392 cd ${.CURDIR}/bin && ${MAKE} install
393 cd ${.CURDIR}/sbin && ${MAKE} install
394 cd ${.CURDIR}/libexec && ${MAKE} install
395 cd ${.CURDIR}/usr.bin && ${MAKE} install
396 cd ${.CURDIR}/usr.sbin && ${MAKE} install
397 cd ${.CURDIR}/gnu/libexec && ${MAKE} install
398 cd ${.CURDIR}/gnu/usr.bin && ${MAKE} install
399 cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} install
400#.if defined(MAKE_KERBEROS4) && !defined(NOCRYPT)
401# cd ${.CURDIR}/kerberosIV && ${MAKE} installmost
402#.endif
403#.if !defined(NOSECURE) && !defined(NOCRYPT)
404# cd ${.CURDIR}/secure && ${MAKE} installmost
405#.endif
406
407#
408# ------------------------------------------------------------------------
409#
410# From here onwards are utility targets used by the 'make world' and
411# related targets. If your 'world' breaks, you may like to try to fix
412# the problem and manually run the following targets to attempt to
413# complete the build. Beware, this is *not* guaranteed to work, you
414# need to have a pretty good grip on the current state of the system
415# to attempt to manually finish it. If in doubt, 'make world' again.
416#
417
418#
419# heirarchy - ensure that all the needed directories are present
420#
421hierarchy:
422 cd ${.CURDIR}/etc && ${MAKE} distrib-dirs
423
424#
425# bootstrap - [re]build tools needed to run the actual build, this includes
426# tools needed by 'make depend', as some tools are needed to generate source
427# for the dependency information to be gathered from.
428#
429bootstrap:
430.if defined(DESTDIR)
431 rm -f ${DESTDIR}/usr/src/sys
432 ln -s ${.CURDIR}/sys ${DESTDIR}/usr/src
433 cd ${.CURDIR}/include && find -dx . | cpio -dump ${DESTDIR}/usr/include
434 cd ${.CURDIR}/include && make symlinks
435.endif
436 cd ${.CURDIR}/usr.bin/make && ${MAKE} depend && \
437 ${MAKE} ${MK_FLAGS} all && \
438 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
439 cd ${.CURDIR}/usr.bin/xinstall && ${MAKE} depend && \
440 ${MAKE} ${MK_FLAGS} all && \
441 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
442 cd ${.CURDIR}/usr.bin/lex && ${MAKE} bootstrap && ${MAKE} depend && \
443 ${MAKE} ${MK_FLAGS} -DNOLIB all && \
444 ${MAKE} ${MK_FLAGS} -DNOLIB -B install ${CLEANDIR}
445.if !defined(NOOBJDIR)
446 cd ${.CURDIR}/usr.bin/lex && ${MAKE} obj
447.endif
448
449#
450# include-tools - generally the same as 'bootstrap', except that it's for
451# things that are specifically needed to generate include files.
452#
453# XXX should be merged with bootstrap, it's not worth keeeping them separate.
454# Well, maybe it is now. We force 'cleandepend' here to avoid dependencies
455# on cleaned away headers in ${WORLDTMP}.
456#
457include-tools:
458 cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} -B cleandepend depend && \
459 ${MAKE} ${MK_FLAGS} all && \
460 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
461
462#
463# includes - possibly generate and install the include files.
464#
465includes:
466.if defined(CLOBBER)
467 rm -rf ${DESTDIR}/usr/include/*
468 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
469 -p ${DESTDIR}/usr/include
470.endif
471 cd ${.CURDIR}/include && ${MAKE} -B all install
472 cd ${.CURDIR}/gnu/include && ${MAKE} install
473 cd ${.CURDIR}/gnu/lib/libmp && ${MAKE} beforeinstall
474 cd ${.CURDIR}/gnu/lib/libobjc && ${MAKE} beforeinstall
475 cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall
476 cd ${.CURDIR}/gnu/lib/libregex && ${MAKE} beforeinstall
477 cd ${.CURDIR}/gnu/lib/libstdc++ && ${MAKE} beforeinstall
478 cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
479 cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall
480 cd ${.CURDIR}/gnu/lib/libgmp && ${MAKE} beforeinstall
481.if exists(secure) && !defined(NOCRYPT)
482 cd ${.CURDIR}/secure/lib/libdes && ${MAKE} beforeinstall
483.endif
484.if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
485 cd ${.CURDIR}/kerberosIV/lib/libacl && ${MAKE} beforeinstall
486 cd ${.CURDIR}/kerberosIV/lib/libkadm && ${MAKE} beforeinstall
487 cd ${.CURDIR}/kerberosIV/lib/libkafs && ${MAKE} beforeinstall
488 cd ${.CURDIR}/kerberosIV/lib/libkdb && ${MAKE} beforeinstall
489 cd ${.CURDIR}/kerberosIV/lib/libkrb && ${MAKE} beforeinstall
490 cd ${.CURDIR}/kerberosIV/lib/libtelnet && ${MAKE} beforeinstall
491.else
492 cd ${.CURDIR}/lib/libtelnet && ${MAKE} beforeinstall
493.endif
487 cd ${.CURDIR}/lib/csu/i386 && ${MAKE} beforeinstall
494.if exists(${.CURDIR}/lib/csu/${MACHINE})
495 cd ${.CURDIR}/lib/csu/${MACHINE} && ${MAKE} beforeinstall
496.endif
488 cd ${.CURDIR}/lib/libalias && ${MAKE} beforeinstall
489 cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall
490 cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall
491 cd ${.CURDIR}/lib/libdisk && ${MAKE} beforeinstall
492 cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall
493 cd ${.CURDIR}/lib/libftpio && ${MAKE} beforeinstall
494 cd ${.CURDIR}/lib/libmd && ${MAKE} beforeinstall
495 cd ${.CURDIR}/lib/libmytinfo && ${MAKE} beforeinstall
496 cd ${.CURDIR}/lib/libncurses && ${MAKE} beforeinstall
497.if !defined(WANT_CSRG_LIBM)
498 cd ${.CURDIR}/lib/msun && ${MAKE} beforeinstall
499.endif
500 cd ${.CURDIR}/lib/libopie && ${MAKE} beforeinstall
501 cd ${.CURDIR}/lib/libpcap && ${MAKE} beforeinstall
502 cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall
503 cd ${.CURDIR}/lib/libskey && ${MAKE} beforeinstall
504.if !defined(NOTCL) && exists (${.CURDIR}/contrib/tcl) && \
505 exists(${.CURDIR}/usr.bin/tclsh) && exists (${.CURDIR}/lib/libtcl)
506 cd ${.CURDIR}/lib/libtcl && ${MAKE} installhdrs
507.endif
508 cd ${.CURDIR}/lib/libtermcap && ${MAKE} beforeinstall
509 cd ${.CURDIR}/lib/libcom_err && ${MAKE} beforeinstall
510 cd ${.CURDIR}/lib/libss && ${MAKE} beforeinstall
511 cd ${.CURDIR}/lib/libscsi && ${MAKE} beforeinstall
512 cd ${.CURDIR}/lib/libutil && ${MAKE} beforeinstall
513 cd ${.CURDIR}/lib/libvgl && ${MAKE} beforeinstall
514 cd ${.CURDIR}/lib/libz && ${MAKE} beforeinstall
515 cd ${.CURDIR}/usr.bin/f2c && ${MAKE} beforeinstall
516 cd ${.CURDIR}/usr.bin/lex && ${MAKE} beforeinstall
517
518#
519# lib-tools - build tools to compile and install the libraries.
520#
521# XXX gperf is required for cc
522# XXX a new ld and tsort is required for cc
523lib-tools:
524.for d in \
525 gnu/usr.bin/gperf \
526 gnu/usr.bin/ld \
527 usr.bin/tsort \
528 gnu/usr.bin/as \
529 gnu/usr.bin/bison \
530 gnu/usr.bin/cc \
531 usr.bin/ar \
532 usr.bin/compile_et \
533 usr.bin/lex/lib \
534 usr.bin/mk_cmds \
535 usr.bin/nm \
536 usr.bin/ranlib \
537 usr.bin/uudecode
538 cd ${.CURDIR}/$d && ${MAKE} depend && \
539 ${MAKE} ${MK_FLAGS} all && \
540 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
541.endfor
542
543#
544# libraries - build and install the libraries
545#
546libraries:
497 cd ${.CURDIR}/lib/libalias && ${MAKE} beforeinstall
498 cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall
499 cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall
500 cd ${.CURDIR}/lib/libdisk && ${MAKE} beforeinstall
501 cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall
502 cd ${.CURDIR}/lib/libftpio && ${MAKE} beforeinstall
503 cd ${.CURDIR}/lib/libmd && ${MAKE} beforeinstall
504 cd ${.CURDIR}/lib/libmytinfo && ${MAKE} beforeinstall
505 cd ${.CURDIR}/lib/libncurses && ${MAKE} beforeinstall
506.if !defined(WANT_CSRG_LIBM)
507 cd ${.CURDIR}/lib/msun && ${MAKE} beforeinstall
508.endif
509 cd ${.CURDIR}/lib/libopie && ${MAKE} beforeinstall
510 cd ${.CURDIR}/lib/libpcap && ${MAKE} beforeinstall
511 cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall
512 cd ${.CURDIR}/lib/libskey && ${MAKE} beforeinstall
513.if !defined(NOTCL) && exists (${.CURDIR}/contrib/tcl) && \
514 exists(${.CURDIR}/usr.bin/tclsh) && exists (${.CURDIR}/lib/libtcl)
515 cd ${.CURDIR}/lib/libtcl && ${MAKE} installhdrs
516.endif
517 cd ${.CURDIR}/lib/libtermcap && ${MAKE} beforeinstall
518 cd ${.CURDIR}/lib/libcom_err && ${MAKE} beforeinstall
519 cd ${.CURDIR}/lib/libss && ${MAKE} beforeinstall
520 cd ${.CURDIR}/lib/libscsi && ${MAKE} beforeinstall
521 cd ${.CURDIR}/lib/libutil && ${MAKE} beforeinstall
522 cd ${.CURDIR}/lib/libvgl && ${MAKE} beforeinstall
523 cd ${.CURDIR}/lib/libz && ${MAKE} beforeinstall
524 cd ${.CURDIR}/usr.bin/f2c && ${MAKE} beforeinstall
525 cd ${.CURDIR}/usr.bin/lex && ${MAKE} beforeinstall
526
527#
528# lib-tools - build tools to compile and install the libraries.
529#
530# XXX gperf is required for cc
531# XXX a new ld and tsort is required for cc
532lib-tools:
533.for d in \
534 gnu/usr.bin/gperf \
535 gnu/usr.bin/ld \
536 usr.bin/tsort \
537 gnu/usr.bin/as \
538 gnu/usr.bin/bison \
539 gnu/usr.bin/cc \
540 usr.bin/ar \
541 usr.bin/compile_et \
542 usr.bin/lex/lib \
543 usr.bin/mk_cmds \
544 usr.bin/nm \
545 usr.bin/ranlib \
546 usr.bin/uudecode
547 cd ${.CURDIR}/$d && ${MAKE} depend && \
548 ${MAKE} ${MK_FLAGS} all && \
549 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
550.endfor
551
552#
553# libraries - build and install the libraries
554#
555libraries:
547.if exists(lib/csu/i386)
548 cd ${.CURDIR}/lib/csu/i386 && ${MAKE} depend && \
556.if exists(lib/csu/${MACHINE})
557 cd ${.CURDIR}/lib/csu/${MACHINE} && ${MAKE} depend && \
549 ${MAKE} ${MK_FLAGS} all && \
550 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
551.endif
552.if exists(lib/libcompat)
553 cd ${.CURDIR}/lib/libcompat && ${MAKE} depend && \
554 ${MAKE} ${MK_FLAGS} all && \
555 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
556.endif
557.if exists(lib/libncurses)
558 cd ${.CURDIR}/lib/libncurses && ${MAKE} depend && \
559 ${MAKE} ${MK_FLAGS} all && \
560 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
561.endif
562.if exists(lib/libtermcap)
563 cd ${.CURDIR}/lib/libtermcap && ${MAKE} depend && \
564 ${MAKE} ${MK_FLAGS} all && \
565 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
566.endif
567.if exists(gnu)
568 cd ${.CURDIR}/gnu/lib && ${MAKE} depend && \
569 ${MAKE} ${MK_FLAGS} all && \
570 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
571.endif
572.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
573 cd ${.CURDIR}/secure/lib && ${MAKE} depend && \
574 ${MAKE} ${MK_FLAGS} all && \
575 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
576.endif
577.if exists(lib)
578 cd ${.CURDIR}/lib && ${MAKE} depend && \
579 ${MAKE} ${MK_FLAGS} all && \
580 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
581.endif
582.if exists(usr.bin/lex/lib)
583 cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
584 ${MAKE} ${MK_FLAGS} all && \
585 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
586.endif
587.if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
588 cd ${.CURDIR}/kerberosIV/lib && ${MAKE} depend && \
589 ${MAKE} ${MK_FLAGS} all && \
590 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
591.endif
592.if exists(usr.sbin/pcvt/keycap)
593 cd ${.CURDIR}/usr.sbin/pcvt/keycap && ${MAKE} depend && \
594 ${MAKE} ${MK_FLAGS} all && \
595 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
596.endif
597
598#
599# build-tools - build and install any other tools needed to complete the
600# compile and install.
601# ifdef stale
602# bc and cpp are required to build groff. Otherwise, the order here is
603# mostly historical, i.e., bogus.
604# chmod is used to build gcc's tmpmultilib[2] at obscure times.
605# endif stale
606# XXX uname is a bug - the target should not depend on the host.
607#
608build-tools:
609.for d in \
610 bin/cat \
611 bin/chmod \
612 bin/cp \
613 bin/date \
614 bin/dd \
615 bin/echo \
616 bin/expr \
617 bin/hostname \
618 bin/ln \
619 bin/ls \
620 bin/mkdir \
621 bin/mv \
622 bin/rm \
623 bin/sh \
624 bin/test \
625 gnu/usr.bin/awk \
626 gnu/usr.bin/bc \
627 gnu/usr.bin/grep \
628 gnu/usr.bin/groff \
629 gnu/usr.bin/gzip \
630 gnu/usr.bin/man/makewhatis \
631 gnu/usr.bin/sort \
632 gnu/usr.bin/texinfo \
633 share/info \
634 usr.bin/basename \
635 usr.bin/cap_mkdb \
636 usr.bin/chflags \
637 usr.bin/cmp \
638 usr.bin/col \
639 usr.bin/cpp \
640 usr.bin/expand \
641 usr.bin/file2c \
642 usr.bin/find \
643 usr.bin/gencat \
644 usr.bin/lorder \
645 usr.bin/m4 \
646 usr.bin/mkdep \
647 usr.bin/paste \
648 usr.bin/sed \
649 usr.bin/size \
650 usr.bin/soelim \
651 usr.bin/strip \
652 usr.bin/symorder \
653 usr.bin/touch \
654 usr.bin/tr \
655 usr.bin/true \
656 usr.bin/uname \
657 usr.bin/uuencode \
658 usr.bin/vgrind \
659 usr.bin/vi \
660 usr.bin/wc \
661 usr.bin/yacc \
662 usr.sbin/chown \
663 usr.sbin/mtree \
664 usr.sbin/zic
665 cd ${.CURDIR}/$d && ${MAKE} depend && \
666 ${MAKE} ${MK_FLAGS} all && \
667 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
668.endfor
669
670.for __target in clean cleandir obj depend
671.for entry in ${SUBDIR}
672${entry}.${__target}__D: .PHONY
673 if test -d ${.CURDIR}/${entry}.${MACHINE}; then \
674 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE}"; \
675 edir=${entry}.${MACHINE}; \
676 cd ${.CURDIR}/$${edir}; \
677 else \
678 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
679 edir=${entry}; \
680 cd ${.CURDIR}/$${edir}; \
681 fi; \
682 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
683.endfor
684par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
685.endfor
686
558 ${MAKE} ${MK_FLAGS} all && \
559 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
560.endif
561.if exists(lib/libcompat)
562 cd ${.CURDIR}/lib/libcompat && ${MAKE} depend && \
563 ${MAKE} ${MK_FLAGS} all && \
564 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
565.endif
566.if exists(lib/libncurses)
567 cd ${.CURDIR}/lib/libncurses && ${MAKE} depend && \
568 ${MAKE} ${MK_FLAGS} all && \
569 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
570.endif
571.if exists(lib/libtermcap)
572 cd ${.CURDIR}/lib/libtermcap && ${MAKE} depend && \
573 ${MAKE} ${MK_FLAGS} all && \
574 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
575.endif
576.if exists(gnu)
577 cd ${.CURDIR}/gnu/lib && ${MAKE} depend && \
578 ${MAKE} ${MK_FLAGS} all && \
579 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
580.endif
581.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
582 cd ${.CURDIR}/secure/lib && ${MAKE} depend && \
583 ${MAKE} ${MK_FLAGS} all && \
584 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
585.endif
586.if exists(lib)
587 cd ${.CURDIR}/lib && ${MAKE} depend && \
588 ${MAKE} ${MK_FLAGS} all && \
589 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
590.endif
591.if exists(usr.bin/lex/lib)
592 cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
593 ${MAKE} ${MK_FLAGS} all && \
594 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
595.endif
596.if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4)
597 cd ${.CURDIR}/kerberosIV/lib && ${MAKE} depend && \
598 ${MAKE} ${MK_FLAGS} all && \
599 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
600.endif
601.if exists(usr.sbin/pcvt/keycap)
602 cd ${.CURDIR}/usr.sbin/pcvt/keycap && ${MAKE} depend && \
603 ${MAKE} ${MK_FLAGS} all && \
604 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
605.endif
606
607#
608# build-tools - build and install any other tools needed to complete the
609# compile and install.
610# ifdef stale
611# bc and cpp are required to build groff. Otherwise, the order here is
612# mostly historical, i.e., bogus.
613# chmod is used to build gcc's tmpmultilib[2] at obscure times.
614# endif stale
615# XXX uname is a bug - the target should not depend on the host.
616#
617build-tools:
618.for d in \
619 bin/cat \
620 bin/chmod \
621 bin/cp \
622 bin/date \
623 bin/dd \
624 bin/echo \
625 bin/expr \
626 bin/hostname \
627 bin/ln \
628 bin/ls \
629 bin/mkdir \
630 bin/mv \
631 bin/rm \
632 bin/sh \
633 bin/test \
634 gnu/usr.bin/awk \
635 gnu/usr.bin/bc \
636 gnu/usr.bin/grep \
637 gnu/usr.bin/groff \
638 gnu/usr.bin/gzip \
639 gnu/usr.bin/man/makewhatis \
640 gnu/usr.bin/sort \
641 gnu/usr.bin/texinfo \
642 share/info \
643 usr.bin/basename \
644 usr.bin/cap_mkdb \
645 usr.bin/chflags \
646 usr.bin/cmp \
647 usr.bin/col \
648 usr.bin/cpp \
649 usr.bin/expand \
650 usr.bin/file2c \
651 usr.bin/find \
652 usr.bin/gencat \
653 usr.bin/lorder \
654 usr.bin/m4 \
655 usr.bin/mkdep \
656 usr.bin/paste \
657 usr.bin/sed \
658 usr.bin/size \
659 usr.bin/soelim \
660 usr.bin/strip \
661 usr.bin/symorder \
662 usr.bin/touch \
663 usr.bin/tr \
664 usr.bin/true \
665 usr.bin/uname \
666 usr.bin/uuencode \
667 usr.bin/vgrind \
668 usr.bin/vi \
669 usr.bin/wc \
670 usr.bin/yacc \
671 usr.sbin/chown \
672 usr.sbin/mtree \
673 usr.sbin/zic
674 cd ${.CURDIR}/$d && ${MAKE} depend && \
675 ${MAKE} ${MK_FLAGS} all && \
676 ${MAKE} ${MK_FLAGS} -B install ${CLEANDIR} ${OBJDIR}
677.endfor
678
679.for __target in clean cleandir obj depend
680.for entry in ${SUBDIR}
681${entry}.${__target}__D: .PHONY
682 if test -d ${.CURDIR}/${entry}.${MACHINE}; then \
683 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE}"; \
684 edir=${entry}.${MACHINE}; \
685 cd ${.CURDIR}/$${edir}; \
686 else \
687 ${ECHODIR} "===> ${DIRPRFX}${entry}"; \
688 edir=${entry}; \
689 cd ${.CURDIR}/$${edir}; \
690 fi; \
691 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
692.endfor
693par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
694.endfor
695
696.endif
697
687.include <bsd.subdir.mk>
698.include <bsd.subdir.mk>