Makefile revision 1.262 1 1.262 mrg # $NetBSD: Makefile,v 1.262 2008/10/27 22:32:51 mrg Exp $
2 1.95 cjs
3 1.193 lukem #
4 1.95 cjs # This is the top-level makefile for building NetBSD. For an outline of
5 1.95 cjs # how to build a snapshot or release, as well as other release engineering
6 1.221 salo # information, see http://www.NetBSD.org/developers/releng/index.html
7 1.95 cjs #
8 1.95 cjs # Not everything you can set or do is documented in this makefile. In
9 1.95 cjs # particular, you should review the files in /usr/share/mk (especially
10 1.95 cjs # bsd.README) for general information on building programs and writing
11 1.95 cjs # Makefiles within this structure, and see the comments in src/etc/Makefile
12 1.95 cjs # for further information on installation and release set options.
13 1.95 cjs #
14 1.95 cjs # Variables listed below can be set on the make command line (highest
15 1.95 cjs # priority), in /etc/mk.conf (middle priority), or in the environment
16 1.95 cjs # (lowest priority).
17 1.95 cjs #
18 1.95 cjs # Variables:
19 1.101 sommerfe # DESTDIR is the target directory for installation of the compiled
20 1.101 sommerfe # software. It defaults to /. Note that programs are built against
21 1.101 sommerfe # libraries installed in DESTDIR.
22 1.214 lukem # MKMAN, if `no', will prevent building of manual pages.
23 1.214 lukem # MKOBJDIRS, if not `no', will build object directories at
24 1.101 sommerfe # an appropriate point in a build.
25 1.214 lukem # MKSHARE, if `no', will prevent building and installing
26 1.95 cjs # anything in /usr/share.
27 1.214 lukem # MKUPDATE, if not `no', will avoid a `make cleandir' at the start of
28 1.178 enami # `make build', as well as having the effects listed in
29 1.178 enami # /usr/share/mk/bsd.README.
30 1.125 mrg # NOCLEANDIR, if defined, will avoid a `make cleandir' at the start
31 1.178 enami # of the `make build'.
32 1.119 toddpw # NOINCLUDES will avoid the `make includes' usually done by `make build'.
33 1.95 cjs #
34 1.214 lukem # See mk.conf(5) for more details.
35 1.214 lukem #
36 1.214 lukem #
37 1.95 cjs # Targets:
38 1.137 tv # build:
39 1.196 lukem # Builds a full release of NetBSD in DESTDIR, except for the
40 1.196 lukem # /etc configuration files.
41 1.196 lukem # If BUILD_DONE is set, this is an empty target.
42 1.196 lukem # distribution:
43 1.196 lukem # Builds a full release of NetBSD in DESTDIR, including the /etc
44 1.196 lukem # configuration files.
45 1.196 lukem # buildworld:
46 1.196 lukem # As per `make distribution', except that it ensures that DESTDIR
47 1.196 lukem # is not the root directory.
48 1.196 lukem # installworld:
49 1.196 lukem # Install the distribution from DESTDIR to INSTALLWORLDDIR (which
50 1.196 lukem # defaults to the root directory). Ensures that INSTALLWORLDDIR
51 1.196 lukem # is the not root directory if cross compiling.
52 1.137 tv # release:
53 1.240 lukem # Does a `make distribution', and then tars up the DESTDIR files
54 1.252 lukem # into ${RELEASEDIR}/${RELEASEMACHINEDIR}, in release(7) format.
55 1.196 lukem # (See etc/Makefile for more information on this.)
56 1.137 tv # regression-tests:
57 1.137 tv # Runs the regression tests in "regress" on this host.
58 1.206 lukem # sets:
59 1.252 lukem # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
60 1.252 lukem # from ${DESTDIR}
61 1.206 lukem # sourcesets:
62 1.206 lukem # Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR}
63 1.241 apb # syspkgs:
64 1.252 lukem # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/syspkgs
65 1.252 lukem # from ${DESTDIR}
66 1.243 apb # iso-image:
67 1.248 jnemeth # Create CD-ROM image in RELEASEDIR/iso.
68 1.243 apb # RELEASEDIR must already have been populated by `make release'
69 1.243 apb # or equivalent.
70 1.248 jnemeth # iso-image-source:
71 1.248 jnemeth # Create CD-ROM image with source in RELEASEDIR/iso.
72 1.248 jnemeth # RELEASEDIR must already have been populated by
73 1.248 jnemeth # `make release sourcesets' or equivalent.
74 1.123 mrg #
75 1.137 tv # Targets invoked by `make build,' in order:
76 1.155 tv # cleandir: cleans the tree.
77 1.261 apb # do-top-obj: creates the top level object directory.
78 1.260 apb # do-tools-obj: creates object directories for the host toolchain.
79 1.260 apb # do-tools: builds host toolchain.
80 1.137 tv # obj: creates object directories.
81 1.208 lukem # do-distrib-dirs: creates the distribution directories.
82 1.208 lukem # includes: installs include files.
83 1.202 thorpej # do-tools-compat: builds the "libnbcompat" library; needed for some
84 1.202 thorpej # random host tool programs in the source tree.
85 1.238 lukem # do-lib-csu: builds and installs prerequisites from lib/csu.
86 1.249 lukem # do-libgcc: builds and installs prerequisites from
87 1.249 lukem # gnu/lib/crtstuff${LIBGCC_EXT} (if necessary) and
88 1.249 lukem # gnu/lib/libgcc${LIBGCC_EXT}.
89 1.256 gmcgarry # do-libpcc: builds and install prerequisites from
90 1.256 gmcgarry # external/bsd/pcc/crtstuff and external/bsd/pcc/libpcc.
91 1.186 thorpej # do-lib-libc: builds and installs prerequisites from lib/libc.
92 1.143 tv # do-lib: builds and installs prerequisites from lib.
93 1.143 tv # do-gnu-lib: builds and installs prerequisites from gnu/lib.
94 1.253 lukem # do-external-lib: builds and installs prerequisites from external/lib.
95 1.259 pooka # do-sys-rump-fs-lib: builds and installs prerequisites from sys/rump/fs/lib
96 1.259 pooka # do-sys-rump-net-lib: builds and installs prerequisites from sys/rump/net/lib
97 1.189 itohy # do-ld.so: builds and installs prerequisites from libexec/ld.*_so.
98 1.262 mrg # do-compat-lib-csu: builds and installs prerequisites from compat/lib/csu
99 1.262 mrg # if ${MKCOMPAT} != "no".
100 1.262 mrg # do-compat-libgcc: builds and installs prerequisites from
101 1.262 mrg # compat/gnu/lib/crtstuff${LIBGCC_EXT} (if necessary) and
102 1.262 mrg # compat/gnu/lib/libgcc${LIBGCC_EXT} if ${MKCOMPAT} != "no".
103 1.262 mrg # do-compat-lib-libc: builds and installs prerequisites from compat/lib/libc
104 1.262 mrg # if ${MKCOMPAT} != "no".
105 1.137 tv # do-build: builds and installs the entire system.
106 1.257 lukem # do-x11: builds and installs X11; either
107 1.258 jnemeth # X11R7 from src/external/mit/xorg if ${MKXORG} != "no"
108 1.257 lukem # or X11R6 from src/x11 if ${MKX11} != "no"
109 1.222 lukem # do-obsolete: installs the obsolete sets (for the postinstall-* targets).
110 1.193 lukem #
111 1.32 cgd
112 1.146 tv .if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == ""
113 1.146 tv .MAKEFLAGS: -m ${.CURDIR}/share/mk
114 1.146 tv .endif
115 1.163 tv
116 1.193 lukem #
117 1.163 tv # If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
118 1.163 tv # not be the top level objdir, because "make obj" can happen in the *middle*
119 1.163 tv # of "make build" (long after <bsd.own.mk> is calculated it). So, pre-set
120 1.163 tv # _SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}.
121 1.193 lukem #
122 1.163 tv _SRC_TOP_OBJ_=
123 1.148 jmc
124 1.146 tv .include <bsd.own.mk>
125 1.4 cgd
126 1.193 lukem #
127 1.137 tv # Sanity check: make sure that "make build" is not invoked simultaneously
128 1.137 tv # with a standard recursive target.
129 1.193 lukem #
130 1.137 tv
131 1.137 tv .if make(build) || make(release) || make(snapshot)
132 1.137 tv .for targ in ${TARGETS:Nobj:Ncleandir}
133 1.137 tv .if make(${targ}) && !target(.BEGIN)
134 1.137 tv .BEGIN:
135 1.137 tv @echo 'BUILD ABORTED: "make build" and "make ${targ}" are mutually exclusive.'
136 1.137 tv @false
137 1.137 tv .endif
138 1.137 tv .endfor
139 1.137 tv .endif
140 1.58 tv
141 1.261 apb #
142 1.261 apb # _SUBDIR is used to set SUBDIR, after removing directories that have
143 1.261 apb # BUILD_${dir}=no, or that have no ${dir}/Makefile.
144 1.261 apb #
145 1.253 lukem _SUBDIR= tools lib include gnu external bin games libexec sbin usr.bin
146 1.262 mrg _SUBDIR+= usr.sbin share rescue sys etc tests compat .WAIT distrib regress
147 1.105 assar
148 1.137 tv .for dir in ${_SUBDIR}
149 1.261 apb .if "${dir}" == ".WAIT" \
150 1.261 apb || (${BUILD_${dir}:Uyes} != "no" && exists(${dir}/Makefile))
151 1.137 tv SUBDIR+= ${dir}
152 1.36 explorer .endif
153 1.137 tv .endfor
154 1.21 cgd
155 1.13 brezak .if exists(regress)
156 1.242 dsl regression-tests: .PHONY .MAKE
157 1.10 cgd @echo Running regression tests...
158 1.232 lukem ${MAKEDIRTARGET} regress regress
159 1.13 brezak .endif
160 1.20 cgd
161 1.214 lukem .if ${MKUNPRIVED} != "no"
162 1.179 thorpej NOPOSTINSTALL= # defined
163 1.179 thorpej .endif
164 1.179 thorpej
165 1.242 dsl afterinstall: .PHONY .MAKE
166 1.137 tv .if ${MKMAN} != "no"
167 1.232 lukem ${MAKEDIRTARGET} share/man makedb
168 1.137 tv .endif
169 1.214 lukem .if (${MKUNPRIVED} != "no" && ${MKINFO} != "no")
170 1.232 lukem ${MAKEDIRTARGET} gnu/usr.bin/texinfo/install-info infodir-meta
171 1.176 lukem .endif
172 1.179 thorpej .if !defined(NOPOSTINSTALL)
173 1.232 lukem ${MAKEDIRTARGET} . postinstall-check
174 1.159 perry .endif
175 1.170 lukem
176 1.239 lukem _POSTINSTALL= ${.CURDIR}/usr.sbin/postinstall/postinstall
177 1.239 lukem
178 1.228 lukem postinstall-check: .PHONY
179 1.169 lukem @echo " === Post installation checks ==="
180 1.250 pavel ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi
181 1.171 lukem @echo " ================================"
182 1.171 lukem
183 1.228 lukem postinstall-fix: .NOTMAIN .PHONY
184 1.171 lukem @echo " === Post installation fixes ==="
185 1.239 lukem ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix
186 1.212 lukem @echo " ==============================="
187 1.212 lukem
188 1.228 lukem postinstall-fix-obsolete: .NOTMAIN .PHONY
189 1.212 lukem @echo " === Removing obsolete files ==="
190 1.239 lukem ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix obsolete
191 1.212 lukem @echo " ==============================="
192 1.169 lukem
193 1.108 erh
194 1.193 lukem #
195 1.137 tv # Targets (in order!) called by "make build".
196 1.193 lukem #
197 1.256 gmcgarry .if defined(HAVE_GCC)
198 1.245 mrg .if ${HAVE_GCC} == "3"
199 1.220 mrg LIBGCC_EXT=3
200 1.245 mrg .else
201 1.244 mrg LIBGCC_EXT=4
202 1.220 mrg .endif
203 1.256 gmcgarry .endif
204 1.123 mrg
205 1.156 tv BUILDTARGETS+= check-tools
206 1.214 lukem .if ${MKUPDATE} == "no" && !defined(NOCLEANDIR)
207 1.155 tv BUILDTARGETS+= cleandir
208 1.155 tv .endif
209 1.261 apb .if ${MKOBJDIRS} != "no"
210 1.261 apb BUILDTARGETS+= do-top-obj
211 1.261 apb .endif
212 1.261 apb .if ${USETOOLS} == "yes" # {
213 1.149 tv .if ${MKOBJDIRS} != "no"
214 1.260 apb BUILDTARGETS+= do-tools-obj
215 1.123 mrg .endif
216 1.152 tv BUILDTARGETS+= do-tools
217 1.261 apb .endif # USETOOLS # }
218 1.260 apb .if ${MKOBJDIRS} != "no"
219 1.260 apb BUILDTARGETS+= obj
220 1.260 apb .endif
221 1.137 tv .if !defined(NODISTRIBDIRS)
222 1.137 tv BUILDTARGETS+= do-distrib-dirs
223 1.131 tv .endif
224 1.137 tv .if !defined(NOINCLUDES)
225 1.137 tv BUILDTARGETS+= includes
226 1.131 tv .endif
227 1.202 thorpej BUILDTARGETS+= do-tools-compat
228 1.231 skrll BUILDTARGETS+= do-lib-csu
229 1.207 drochner .if ${MKGCC} != "no"
230 1.249 lukem BUILDTARGETS+= do-libgcc
231 1.207 drochner .endif
232 1.256 gmcgarry .if ${MKPCC} != "no"
233 1.256 gmcgarry BUILDTARGET+= do-libpcc
234 1.256 gmcgarry .endif
235 1.231 skrll BUILDTARGETS+= do-lib-libc
236 1.253 lukem BUILDTARGETS+= do-lib do-gnu-lib do-external-lib
237 1.259 pooka BUILDTARGETS+= do-sys-rump-fs-lib do-sys-rump-net-lib
238 1.262 mrg .if ${MKCOMPAT} != "no"
239 1.262 mrg BUILDTARGETS+= do-compat-lib-csu
240 1.262 mrg BUILDTARGETS+= do-compat-libgcc
241 1.262 mrg BUILDTARGETS+= do-compat-lib-libc
242 1.262 mrg .endif
243 1.224 lukem BUILDTARGETS+= do-ld.so
244 1.224 lukem BUILDTARGETS+= do-build
245 1.257 lukem .if ${MKX11} != "no" || ${MKXORG} != "no"
246 1.227 lukem BUILDTARGETS+= do-x11
247 1.227 lukem .endif
248 1.200 lukem BUILDTARGETS+= do-obsolete
249 1.131 tv
250 1.193 lukem #
251 1.137 tv # Enforce proper ordering of some rules.
252 1.193 lukem #
253 1.123 mrg
254 1.137 tv .ORDER: ${BUILDTARGETS}
255 1.228 lukem includes-lib: .PHONY includes-include includes-sys
256 1.228 lukem includes-gnu: .PHONY includes-lib
257 1.123 mrg
258 1.193 lukem #
259 1.137 tv # Build the system and install into DESTDIR.
260 1.193 lukem #
261 1.123 mrg
262 1.191 lukem START_TIME!= date
263 1.191 lukem
264 1.242 dsl build: .PHONY .MAKE
265 1.137 tv .if defined(BUILD_DONE)
266 1.137 tv @echo "Build already installed into ${DESTDIR}"
267 1.137 tv .else
268 1.191 lukem @echo "Build started at: ${START_TIME}"
269 1.145 tv .for tgt in ${BUILDTARGETS}
270 1.232 lukem ${MAKEDIRTARGET} . ${tgt}
271 1.145 tv .endfor
272 1.232 lukem ${MAKEDIRTARGET} etc install-etc-release
273 1.191 lukem @echo "Build started at: ${START_TIME}"
274 1.172 bjh21 @printf "Build finished at: " && date
275 1.71 mycroft .endif
276 1.160 thorpej
277 1.193 lukem #
278 1.160 thorpej # Build a full distribution, but not a release (i.e. no sets into
279 1.193 lukem # ${RELEASEDIR}). "buildworld" enforces a build to ${DESTDIR} != /
280 1.193 lukem #
281 1.160 thorpej
282 1.242 dsl distribution buildworld: .PHONY .MAKE
283 1.194 lukem .if make(buildworld) && \
284 1.194 lukem (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
285 1.193 lukem @echo "Won't make ${.TARGET} with DESTDIR=/"
286 1.193 lukem @false
287 1.193 lukem .endif
288 1.232 lukem ${MAKEDIRTARGET} . build NOPOSTINSTALL=1
289 1.232 lukem ${MAKEDIRTARGET} etc distribution INSTALL_DONE=1
290 1.181 thorpej .if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/"
291 1.232 lukem ${MAKEDIRTARGET} . postinstall-fix-obsolete
292 1.232 lukem ${MAKEDIRTARGET} distrib/sets checkflist
293 1.181 thorpej .endif
294 1.192 lukem @echo "make ${.TARGET} started at: ${START_TIME}"
295 1.185 lukem @printf "make ${.TARGET} finished at: " && date
296 1.123 mrg
297 1.193 lukem #
298 1.193 lukem # Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/')
299 1.193 lukem # If installing to /, ensures that the host's operating system is NetBSD and
300 1.193 lukem # the host's `uname -m` == ${MACHINE}.
301 1.193 lukem #
302 1.193 lukem
303 1.193 lukem HOST_UNAME_S!= uname -s
304 1.193 lukem HOST_UNAME_M!= uname -m
305 1.193 lukem
306 1.242 dsl installworld: .PHONY .MAKE
307 1.194 lukem .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
308 1.193 lukem @echo "Can't make ${.TARGET} to DESTDIR=/"
309 1.193 lukem @false
310 1.193 lukem .endif
311 1.193 lukem .if !defined(INSTALLWORLDDIR) || \
312 1.193 lukem ${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/"
313 1.193 lukem .if (${HOST_UNAME_S} != "NetBSD")
314 1.193 lukem @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/"
315 1.193 lukem @false
316 1.193 lukem .endif
317 1.193 lukem .if (${HOST_UNAME_M} != ${MACHINE})
318 1.193 lukem @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/"
319 1.193 lukem @false
320 1.193 lukem .endif
321 1.193 lukem .endif
322 1.232 lukem ${MAKEDIRTARGET} distrib/sets installsets \
323 1.232 lukem INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=
324 1.232 lukem ${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR}
325 1.193 lukem @echo "make ${.TARGET} started at: ${START_TIME}"
326 1.193 lukem @printf "make ${.TARGET} finished at: " && date
327 1.199 lukem
328 1.199 lukem #
329 1.206 lukem # Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR
330 1.199 lukem #
331 1.199 lukem
332 1.241 apb .for tgt in sets sourcesets syspkgs
333 1.242 dsl ${tgt}: .PHONY .MAKE
334 1.232 lukem ${MAKEDIRTARGET} distrib/sets ${tgt}
335 1.206 lukem .endfor
336 1.193 lukem
337 1.193 lukem #
338 1.240 lukem # Build a release or snapshot (implies "make distribution"). Note that
339 1.181 thorpej # in this case, the set lists will be checked before the tar files
340 1.181 thorpej # are made.
341 1.193 lukem #
342 1.123 mrg
343 1.242 dsl release snapshot: .PHONY .MAKE
344 1.240 lukem ${MAKEDIRTARGET} . distribution
345 1.240 lukem ${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1
346 1.192 lukem @echo "make ${.TARGET} started at: ${START_TIME}"
347 1.185 lukem @printf "make ${.TARGET} finished at: " && date
348 1.123 mrg
349 1.193 lukem #
350 1.243 apb # Create a CD-ROM image.
351 1.243 apb #
352 1.243 apb
353 1.243 apb iso-image: .PHONY
354 1.247 bouyer ${MAKEDIRTARGET} distrib iso_image
355 1.243 apb ${MAKEDIRTARGET} etc iso-image
356 1.243 apb @echo "make ${.TARGET} started at: ${START_TIME}"
357 1.243 apb @printf "make ${.TARGET} finished at: " && date
358 1.243 apb
359 1.248 jnemeth iso-image-source: .PHONY
360 1.248 jnemeth ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true
361 1.248 jnemeth ${MAKEDIRTARGET} etc iso-image
362 1.248 jnemeth @echo "make ${.TARGET} started at: ${START_TIME}"
363 1.248 jnemeth @printf "make ${.TARGET} finished at: " && date
364 1.248 jnemeth
365 1.243 apb #
366 1.137 tv # Special components of the "make build" process.
367 1.193 lukem #
368 1.156 tv
369 1.228 lukem check-tools: .PHONY
370 1.223 lukem .if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN)
371 1.187 thorpej @echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.'
372 1.187 thorpej @echo '*** May result in a failed build or corrupt binaries!'
373 1.187 thorpej .elif defined(EXTERNAL_TOOLCHAIN)
374 1.187 thorpej @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.'
375 1.156 tv .endif
376 1.173 sommerfe .if defined(NBUILDJOBS)
377 1.173 sommerfe @echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!'
378 1.173 sommerfe .endif
379 1.123 mrg
380 1.242 dsl do-distrib-dirs: .PHONY .MAKE
381 1.147 jmc .if !defined(DESTDIR) || ${DESTDIR} == ""
382 1.232 lukem ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/
383 1.147 jmc .else
384 1.232 lukem ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR}
385 1.147 jmc .endif
386 1.190 lukem
387 1.190 lukem .for targ in cleandir obj includes
388 1.228 lukem do-${targ}: .PHONY ${targ}
389 1.190 lukem @true
390 1.190 lukem .endfor
391 1.123 mrg
392 1.256 gmcgarry .if defined(HAVE_GCC)
393 1.256 gmcgarry BUILD_CC_LIB= gnu/lib/crtstuff${LIBGCC_EXT}
394 1.256 gmcgarry BUILD_CC_LIB+= gnu/lib/libgcc${LIBGCC_EXT}
395 1.256 gmcgarry .elif defined(HAVE_PCC)
396 1.256 gmcgarry BUILD_CC_LIB+= external/bsd/pcc/crtstuff
397 1.256 gmcgarry BUILD_CC_LIB+= external/bsd/pcc/libpcc
398 1.256 gmcgarry .endif
399 1.256 gmcgarry
400 1.262 mrg .if ${MKCOMPAT} != "no"
401 1.262 mrg BUILD_COMPAT_LIBS= compat/lib/csu ${BUILD_CC_LIB:S/^/compat\//} compat/lib/libc
402 1.262 mrg .else
403 1.262 mrg BUILD_COMPAT_LIBS=
404 1.262 mrg .endif
405 1.262 mrg
406 1.262 mrg .for dir in tools tools/compat lib/csu ${BUILD_CC_LIB} lib/libc lib/libdes lib gnu/lib external/lib sys/rump/fs/lib sys/rump/net/lib ${BUILD_COMPAT_LIBS}
407 1.242 dsl do-${dir:S/\//-/g}: .PHONY .MAKE
408 1.137 tv .for targ in dependall install
409 1.232 lukem ${MAKEDIRTARGET} ${dir} ${targ}
410 1.137 tv .endfor
411 1.184 lukem .endfor
412 1.184 lukem
413 1.261 apb do-top-obj: .PHONY .MAKE
414 1.261 apb ${MAKEDIRTARGET} . obj NOSUBDIR=
415 1.261 apb
416 1.260 apb do-tools-obj: .PHONY .MAKE
417 1.260 apb ${MAKEDIRTARGET} tools obj
418 1.260 apb
419 1.249 lukem do-libgcc: .PHONY .MAKE
420 1.256 gmcgarry .if defined(HAVE_GCC)
421 1.249 lukem .if ${MKGCC} != "no"
422 1.249 lukem .if (${HAVE_GCC} == "3" || ${HAVE_GCC} == "4")
423 1.249 lukem ${MAKEDIRTARGET} . do-gnu-lib-crtstuff${LIBGCC_EXT}
424 1.249 lukem .endif
425 1.249 lukem ${MAKEDIRTARGET} . do-gnu-lib-libgcc${LIBGCC_EXT}
426 1.249 lukem .endif
427 1.256 gmcgarry .endif
428 1.256 gmcgarry
429 1.262 mrg do-compat-libgcc: .PHONY .MAKE
430 1.262 mrg .if defined(HAVE_GCC)
431 1.262 mrg .if ${MKGCC} != "no"
432 1.262 mrg ${MAKEDIRTARGET} . do-compat-gnu-lib-crtstuff${LIBGCC_EXT}
433 1.262 mrg ${MAKEDIRTARGET} . do-compat-gnu-lib-libgcc${LIBGCC_EXT}
434 1.262 mrg .endif
435 1.262 mrg .endif
436 1.262 mrg
437 1.256 gmcgarry do-libpcc: .PHONY .MAKE
438 1.256 gmcgarry .if defined(HAVE_PCC)
439 1.256 gmcgarry .if ${MKPCC} != "no"
440 1.256 gmcgarry ${MAKEDIRTARGET} . do-pcc-lib-crtstuff
441 1.256 gmcgarry ${MAKEDIRTARGET} . do-pcc-lib-libpcc
442 1.256 gmcgarry .endif
443 1.256 gmcgarry .endif
444 1.249 lukem
445 1.242 dsl do-ld.so: .PHONY .MAKE
446 1.184 lukem .for targ in dependall install
447 1.189 itohy .if (${OBJECT_FMT} == "a.out")
448 1.232 lukem ${MAKEDIRTARGET} libexec/ld.aout_so ${targ}
449 1.189 itohy .endif
450 1.189 itohy .if (${OBJECT_FMT} == "ELF")
451 1.232 lukem ${MAKEDIRTARGET} libexec/ld.elf_so ${targ}
452 1.189 itohy .endif
453 1.137 tv .endfor
454 1.143 tv
455 1.242 dsl do-build: .PHONY .MAKE
456 1.154 tv .for targ in dependall install
457 1.232 lukem ${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no
458 1.154 tv .endfor
459 1.200 lukem
460 1.242 dsl do-x11: .PHONY .MAKE
461 1.254 mrg .if ${MKXORG} != "no"
462 1.254 mrg ${MAKEDIRTARGET} external/mit/xorg build
463 1.257 lukem .elif ${MKX11} != "no"
464 1.257 lukem ${MAKEDIRTARGET} x11 build
465 1.254 mrg .else
466 1.257 lukem @echo "Neither MKX11 or MKXORG is enabled"
467 1.257 lukem @false
468 1.254 mrg .endif
469 1.227 lukem
470 1.242 dsl do-obsolete: .PHONY .MAKE
471 1.232 lukem ${MAKEDIRTARGET} etc install-obsolete-lists
472 1.87 cjs
473 1.193 lukem #
474 1.137 tv # Speedup stubs for some subtrees that don't need to run these rules.
475 1.137 tv # (Tells <bsd.subdir.mk> not to recurse for them.)
476 1.193 lukem #
477 1.129 tv
478 1.152 tv .for dir in bin etc distrib games libexec regress sbin usr.sbin tools
479 1.228 lukem includes-${dir}: .PHONY
480 1.152 tv @true
481 1.152 tv .endfor
482 1.152 tv .for dir in etc distrib regress
483 1.228 lukem install-${dir}: .PHONY
484 1.152 tv @true
485 1.152 tv .endfor
486 1.152 tv
487 1.193 lukem #
488 1.152 tv # XXX this needs to change when distrib Makefiles are recursion compliant
489 1.193 lukem # XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first...
490 1.193 lukem #
491 1.228 lukem dependall-distrib depend-distrib all-distrib: .PHONY
492 1.136 nathanw @true
493 1.130 tv
494 1.211 lukem .include <bsd.sys.mk>
495 1.151 tv .include <bsd.obj.mk>
496 1.209 lukem .include <bsd.kernobj.mk>
497 1.146 tv .include <bsd.subdir.mk>
498 1.144 tv
499 1.228 lukem build-docs: .PHONY ${.CURDIR}/BUILDING
500 1.188 lukem ${.CURDIR}/BUILDING: doc/BUILDING.mdoc
501 1.230 lukem ${_MKMSG_CREATE} ${.TARGET}
502 1.216 lukem ${TOOL_GROFF} -mdoc -Tascii -P-bou $> >$@
503 1.209 lukem
504 1.209 lukem
505 1.209 lukem #
506 1.209 lukem # Display current make(1) parameters
507 1.209 lukem #
508 1.242 dsl params: .PHONY .MAKE
509 1.232 lukem ${MAKEDIRTARGET} etc params
510