Makefile revision 1.280 1 1.280 skrll # $NetBSD: Makefile,v 1.280 2010/11/28 18:40:54 skrll 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.280 skrll # external/bsd/pcc/crtstuff (if necessary) and
91 1.280 skrll # external/bsd/pcc/libpcc.
92 1.186 thorpej # do-lib-libc: builds and installs prerequisites from lib/libc.
93 1.143 tv # do-lib: builds and installs prerequisites from lib.
94 1.143 tv # do-gnu-lib: builds and installs prerequisites from gnu/lib.
95 1.253 lukem # do-external-lib: builds and installs prerequisites from external/lib.
96 1.274 pooka # do-sys-rump-dev-lib: builds and installs prerequisites from sys/rump/dev/lib
97 1.259 pooka # do-sys-rump-fs-lib: builds and installs prerequisites from sys/rump/fs/lib
98 1.277 pooka # do-sys-rump-kern-lib: builds and installs prereq. from sys/rump/kern/lib
99 1.259 pooka # do-sys-rump-net-lib: builds and installs prerequisites from sys/rump/net/lib
100 1.265 pooka # do-sys-modules: builds and installs kernel modules (used by rump binaries)
101 1.189 itohy # do-ld.so: builds and installs prerequisites from libexec/ld.*_so.
102 1.262 mrg # do-compat-lib-csu: builds and installs prerequisites from compat/lib/csu
103 1.262 mrg # if ${MKCOMPAT} != "no".
104 1.262 mrg # do-compat-libgcc: builds and installs prerequisites from
105 1.262 mrg # compat/gnu/lib/crtstuff${LIBGCC_EXT} (if necessary) and
106 1.262 mrg # compat/gnu/lib/libgcc${LIBGCC_EXT} if ${MKCOMPAT} != "no".
107 1.262 mrg # do-compat-lib-libc: builds and installs prerequisites from compat/lib/libc
108 1.262 mrg # if ${MKCOMPAT} != "no".
109 1.137 tv # do-build: builds and installs the entire system.
110 1.263 mrg # do-x11: builds and installs X11 if ${MKX11} != "no"; either
111 1.263 mrg # X11R7 from src/external/mit/xorg if ${X11FLAVOUR} == "Xorg"
112 1.263 mrg # or X11R6 from src/x11
113 1.275 uebayasi # do-extsrc: builds and installs extsrc if ${MKEXTSRC} != "no".
114 1.222 lukem # do-obsolete: installs the obsolete sets (for the postinstall-* targets).
115 1.193 lukem #
116 1.32 cgd
117 1.146 tv .if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == ""
118 1.146 tv .MAKEFLAGS: -m ${.CURDIR}/share/mk
119 1.146 tv .endif
120 1.163 tv
121 1.193 lukem #
122 1.163 tv # If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
123 1.163 tv # not be the top level objdir, because "make obj" can happen in the *middle*
124 1.163 tv # of "make build" (long after <bsd.own.mk> is calculated it). So, pre-set
125 1.163 tv # _SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}.
126 1.193 lukem #
127 1.163 tv _SRC_TOP_OBJ_=
128 1.148 jmc
129 1.146 tv .include <bsd.own.mk>
130 1.4 cgd
131 1.193 lukem #
132 1.137 tv # Sanity check: make sure that "make build" is not invoked simultaneously
133 1.137 tv # with a standard recursive target.
134 1.193 lukem #
135 1.137 tv
136 1.137 tv .if make(build) || make(release) || make(snapshot)
137 1.137 tv .for targ in ${TARGETS:Nobj:Ncleandir}
138 1.137 tv .if make(${targ}) && !target(.BEGIN)
139 1.137 tv .BEGIN:
140 1.137 tv @echo 'BUILD ABORTED: "make build" and "make ${targ}" are mutually exclusive.'
141 1.137 tv @false
142 1.137 tv .endif
143 1.137 tv .endfor
144 1.137 tv .endif
145 1.58 tv
146 1.261 apb #
147 1.261 apb # _SUBDIR is used to set SUBDIR, after removing directories that have
148 1.261 apb # BUILD_${dir}=no, or that have no ${dir}/Makefile.
149 1.261 apb #
150 1.271 christos _SUBDIR= tools lib include gnu external crypto/external bin games
151 1.271 christos _SUBDIR+= libexec sbin usr.bin
152 1.262 mrg _SUBDIR+= usr.sbin share rescue sys etc tests compat .WAIT distrib regress
153 1.105 assar
154 1.137 tv .for dir in ${_SUBDIR}
155 1.261 apb .if "${dir}" == ".WAIT" \
156 1.261 apb || (${BUILD_${dir}:Uyes} != "no" && exists(${dir}/Makefile))
157 1.137 tv SUBDIR+= ${dir}
158 1.36 explorer .endif
159 1.137 tv .endfor
160 1.21 cgd
161 1.13 brezak .if exists(regress)
162 1.242 dsl regression-tests: .PHONY .MAKE
163 1.10 cgd @echo Running regression tests...
164 1.232 lukem ${MAKEDIRTARGET} regress regress
165 1.13 brezak .endif
166 1.20 cgd
167 1.214 lukem .if ${MKUNPRIVED} != "no"
168 1.179 thorpej NOPOSTINSTALL= # defined
169 1.179 thorpej .endif
170 1.179 thorpej
171 1.242 dsl afterinstall: .PHONY .MAKE
172 1.137 tv .if ${MKMAN} != "no"
173 1.232 lukem ${MAKEDIRTARGET} share/man makedb
174 1.137 tv .endif
175 1.214 lukem .if (${MKUNPRIVED} != "no" && ${MKINFO} != "no")
176 1.232 lukem ${MAKEDIRTARGET} gnu/usr.bin/texinfo/install-info infodir-meta
177 1.176 lukem .endif
178 1.179 thorpej .if !defined(NOPOSTINSTALL)
179 1.232 lukem ${MAKEDIRTARGET} . postinstall-check
180 1.159 perry .endif
181 1.170 lukem
182 1.239 lukem _POSTINSTALL= ${.CURDIR}/usr.sbin/postinstall/postinstall
183 1.239 lukem
184 1.228 lukem postinstall-check: .PHONY
185 1.169 lukem @echo " === Post installation checks ==="
186 1.268 sketch AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi
187 1.171 lukem @echo " ================================"
188 1.171 lukem
189 1.228 lukem postinstall-fix: .NOTMAIN .PHONY
190 1.171 lukem @echo " === Post installation fixes ==="
191 1.268 sketch AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix
192 1.212 lukem @echo " ==============================="
193 1.212 lukem
194 1.228 lukem postinstall-fix-obsolete: .NOTMAIN .PHONY
195 1.212 lukem @echo " === Removing obsolete files ==="
196 1.268 sketch AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix obsolete
197 1.212 lukem @echo " ==============================="
198 1.169 lukem
199 1.108 erh
200 1.193 lukem #
201 1.137 tv # Targets (in order!) called by "make build".
202 1.193 lukem #
203 1.256 gmcgarry .if defined(HAVE_GCC)
204 1.245 mrg .if ${HAVE_GCC} == "3"
205 1.220 mrg LIBGCC_EXT=3
206 1.245 mrg .else
207 1.244 mrg LIBGCC_EXT=4
208 1.220 mrg .endif
209 1.256 gmcgarry .endif
210 1.123 mrg
211 1.156 tv BUILDTARGETS+= check-tools
212 1.214 lukem .if ${MKUPDATE} == "no" && !defined(NOCLEANDIR)
213 1.155 tv BUILDTARGETS+= cleandir
214 1.155 tv .endif
215 1.261 apb .if ${MKOBJDIRS} != "no"
216 1.261 apb BUILDTARGETS+= do-top-obj
217 1.261 apb .endif
218 1.261 apb .if ${USETOOLS} == "yes" # {
219 1.149 tv .if ${MKOBJDIRS} != "no"
220 1.260 apb BUILDTARGETS+= do-tools-obj
221 1.123 mrg .endif
222 1.152 tv BUILDTARGETS+= do-tools
223 1.261 apb .endif # USETOOLS # }
224 1.260 apb .if ${MKOBJDIRS} != "no"
225 1.260 apb BUILDTARGETS+= obj
226 1.260 apb .endif
227 1.270 apb BUILDTARGETS+= clean_METALOG
228 1.137 tv .if !defined(NODISTRIBDIRS)
229 1.137 tv BUILDTARGETS+= do-distrib-dirs
230 1.131 tv .endif
231 1.137 tv .if !defined(NOINCLUDES)
232 1.137 tv BUILDTARGETS+= includes
233 1.131 tv .endif
234 1.202 thorpej BUILDTARGETS+= do-tools-compat
235 1.231 skrll BUILDTARGETS+= do-lib-csu
236 1.207 drochner .if ${MKGCC} != "no"
237 1.249 lukem BUILDTARGETS+= do-libgcc
238 1.207 drochner .endif
239 1.256 gmcgarry .if ${MKPCC} != "no"
240 1.256 gmcgarry BUILDTARGET+= do-libpcc
241 1.256 gmcgarry .endif
242 1.231 skrll BUILDTARGETS+= do-lib-libc
243 1.253 lukem BUILDTARGETS+= do-lib do-gnu-lib do-external-lib
244 1.273 dyoung .if (${MACHINE} != "evbppc") && ${MKKMOD} != "no"
245 1.265 pooka BUILDTARGETS+= do-sys-modules
246 1.265 pooka .endif
247 1.277 pooka BUILDTARGETS+= do-sys-rump-dev-lib do-sys-rump-fs-lib
248 1.277 pooka BUILDTARGETS+= do-sys-rump-kern-lib do-sys-rump-net-lib
249 1.262 mrg .if ${MKCOMPAT} != "no"
250 1.262 mrg BUILDTARGETS+= do-compat-lib-csu
251 1.262 mrg BUILDTARGETS+= do-compat-libgcc
252 1.262 mrg BUILDTARGETS+= do-compat-lib-libc
253 1.262 mrg .endif
254 1.224 lukem BUILDTARGETS+= do-ld.so
255 1.224 lukem BUILDTARGETS+= do-build
256 1.263 mrg .if ${MKX11} != "no"
257 1.227 lukem BUILDTARGETS+= do-x11
258 1.227 lukem .endif
259 1.275 uebayasi .if ${MKEXTSRC} != "no"
260 1.275 uebayasi BUILDTARGETS+= do-extsrc
261 1.275 uebayasi .endif
262 1.200 lukem BUILDTARGETS+= do-obsolete
263 1.131 tv
264 1.193 lukem #
265 1.137 tv # Enforce proper ordering of some rules.
266 1.193 lukem #
267 1.123 mrg
268 1.137 tv .ORDER: ${BUILDTARGETS}
269 1.228 lukem includes-lib: .PHONY includes-include includes-sys
270 1.228 lukem includes-gnu: .PHONY includes-lib
271 1.123 mrg
272 1.193 lukem #
273 1.137 tv # Build the system and install into DESTDIR.
274 1.193 lukem #
275 1.123 mrg
276 1.191 lukem START_TIME!= date
277 1.191 lukem
278 1.242 dsl build: .PHONY .MAKE
279 1.137 tv .if defined(BUILD_DONE)
280 1.137 tv @echo "Build already installed into ${DESTDIR}"
281 1.137 tv .else
282 1.191 lukem @echo "Build started at: ${START_TIME}"
283 1.145 tv .for tgt in ${BUILDTARGETS}
284 1.232 lukem ${MAKEDIRTARGET} . ${tgt}
285 1.145 tv .endfor
286 1.232 lukem ${MAKEDIRTARGET} etc install-etc-release
287 1.191 lukem @echo "Build started at: ${START_TIME}"
288 1.172 bjh21 @printf "Build finished at: " && date
289 1.71 mycroft .endif
290 1.160 thorpej
291 1.193 lukem #
292 1.160 thorpej # Build a full distribution, but not a release (i.e. no sets into
293 1.193 lukem # ${RELEASEDIR}). "buildworld" enforces a build to ${DESTDIR} != /
294 1.193 lukem #
295 1.160 thorpej
296 1.242 dsl distribution buildworld: .PHONY .MAKE
297 1.194 lukem .if make(buildworld) && \
298 1.194 lukem (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
299 1.193 lukem @echo "Won't make ${.TARGET} with DESTDIR=/"
300 1.193 lukem @false
301 1.193 lukem .endif
302 1.232 lukem ${MAKEDIRTARGET} . build NOPOSTINSTALL=1
303 1.232 lukem ${MAKEDIRTARGET} etc distribution INSTALL_DONE=1
304 1.181 thorpej .if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/"
305 1.232 lukem ${MAKEDIRTARGET} . postinstall-fix-obsolete
306 1.232 lukem ${MAKEDIRTARGET} distrib/sets checkflist
307 1.181 thorpej .endif
308 1.192 lukem @echo "make ${.TARGET} started at: ${START_TIME}"
309 1.185 lukem @printf "make ${.TARGET} finished at: " && date
310 1.123 mrg
311 1.193 lukem #
312 1.193 lukem # Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/')
313 1.193 lukem # If installing to /, ensures that the host's operating system is NetBSD and
314 1.193 lukem # the host's `uname -m` == ${MACHINE}.
315 1.193 lukem #
316 1.193 lukem
317 1.193 lukem HOST_UNAME_S!= uname -s
318 1.193 lukem HOST_UNAME_M!= uname -m
319 1.193 lukem
320 1.242 dsl installworld: .PHONY .MAKE
321 1.194 lukem .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
322 1.193 lukem @echo "Can't make ${.TARGET} to DESTDIR=/"
323 1.193 lukem @false
324 1.193 lukem .endif
325 1.193 lukem .if !defined(INSTALLWORLDDIR) || \
326 1.193 lukem ${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/"
327 1.193 lukem .if (${HOST_UNAME_S} != "NetBSD")
328 1.193 lukem @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/"
329 1.193 lukem @false
330 1.193 lukem .endif
331 1.193 lukem .if (${HOST_UNAME_M} != ${MACHINE})
332 1.193 lukem @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/"
333 1.193 lukem @false
334 1.193 lukem .endif
335 1.193 lukem .endif
336 1.232 lukem ${MAKEDIRTARGET} distrib/sets installsets \
337 1.232 lukem INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=
338 1.232 lukem ${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR}
339 1.193 lukem @echo "make ${.TARGET} started at: ${START_TIME}"
340 1.193 lukem @printf "make ${.TARGET} finished at: " && date
341 1.199 lukem
342 1.199 lukem #
343 1.206 lukem # Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR
344 1.199 lukem #
345 1.199 lukem
346 1.241 apb .for tgt in sets sourcesets syspkgs
347 1.242 dsl ${tgt}: .PHONY .MAKE
348 1.232 lukem ${MAKEDIRTARGET} distrib/sets ${tgt}
349 1.206 lukem .endfor
350 1.193 lukem
351 1.193 lukem #
352 1.240 lukem # Build a release or snapshot (implies "make distribution"). Note that
353 1.181 thorpej # in this case, the set lists will be checked before the tar files
354 1.181 thorpej # are made.
355 1.193 lukem #
356 1.123 mrg
357 1.242 dsl release snapshot: .PHONY .MAKE
358 1.240 lukem ${MAKEDIRTARGET} . distribution
359 1.240 lukem ${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1
360 1.192 lukem @echo "make ${.TARGET} started at: ${START_TIME}"
361 1.185 lukem @printf "make ${.TARGET} finished at: " && date
362 1.123 mrg
363 1.193 lukem #
364 1.243 apb # Create a CD-ROM image.
365 1.243 apb #
366 1.243 apb
367 1.243 apb iso-image: .PHONY
368 1.247 bouyer ${MAKEDIRTARGET} distrib iso_image
369 1.243 apb ${MAKEDIRTARGET} etc iso-image
370 1.243 apb @echo "make ${.TARGET} started at: ${START_TIME}"
371 1.243 apb @printf "make ${.TARGET} finished at: " && date
372 1.243 apb
373 1.248 jnemeth iso-image-source: .PHONY
374 1.248 jnemeth ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true
375 1.248 jnemeth ${MAKEDIRTARGET} etc iso-image
376 1.248 jnemeth @echo "make ${.TARGET} started at: ${START_TIME}"
377 1.248 jnemeth @printf "make ${.TARGET} finished at: " && date
378 1.248 jnemeth
379 1.243 apb #
380 1.137 tv # Special components of the "make build" process.
381 1.193 lukem #
382 1.156 tv
383 1.228 lukem check-tools: .PHONY
384 1.223 lukem .if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN)
385 1.187 thorpej @echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.'
386 1.187 thorpej @echo '*** May result in a failed build or corrupt binaries!'
387 1.187 thorpej .elif defined(EXTERNAL_TOOLCHAIN)
388 1.187 thorpej @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.'
389 1.156 tv .endif
390 1.173 sommerfe .if defined(NBUILDJOBS)
391 1.173 sommerfe @echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!'
392 1.173 sommerfe .endif
393 1.123 mrg
394 1.270 apb # Delete or sanitise a leftover METALOG from a previous build.
395 1.270 apb clean_METALOG: .PHONY .MAKE
396 1.270 apb .if ${MKUPDATE} != "no"
397 1.270 apb ${MAKEDIRTARGET} distrib/sets clean_METALOG
398 1.270 apb .endif
399 1.270 apb
400 1.242 dsl do-distrib-dirs: .PHONY .MAKE
401 1.147 jmc .if !defined(DESTDIR) || ${DESTDIR} == ""
402 1.232 lukem ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/
403 1.147 jmc .else
404 1.232 lukem ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR}
405 1.147 jmc .endif
406 1.190 lukem
407 1.190 lukem .for targ in cleandir obj includes
408 1.228 lukem do-${targ}: .PHONY ${targ}
409 1.190 lukem @true
410 1.190 lukem .endfor
411 1.123 mrg
412 1.256 gmcgarry .if defined(HAVE_GCC)
413 1.280 skrll .if ${USE_COMPILERCRTSTUFF} == "yes"
414 1.256 gmcgarry BUILD_CC_LIB= gnu/lib/crtstuff${LIBGCC_EXT}
415 1.280 skrll .endif
416 1.256 gmcgarry BUILD_CC_LIB+= gnu/lib/libgcc${LIBGCC_EXT}
417 1.256 gmcgarry .elif defined(HAVE_PCC)
418 1.256 gmcgarry BUILD_CC_LIB+= external/bsd/pcc/crtstuff
419 1.256 gmcgarry BUILD_CC_LIB+= external/bsd/pcc/libpcc
420 1.256 gmcgarry .endif
421 1.256 gmcgarry
422 1.279 plunky .for dir in tools tools/compat lib/csu ${BUILD_CC_LIB} lib/libc lib gnu/lib external/lib crypto/external/lib sys/rump/dev/lib sys/rump/fs/lib sys/rump/kern/lib sys/rump/net/lib sys/modules
423 1.242 dsl do-${dir:S/\//-/g}: .PHONY .MAKE
424 1.137 tv .for targ in dependall install
425 1.232 lukem ${MAKEDIRTARGET} ${dir} ${targ}
426 1.137 tv .endfor
427 1.184 lukem .endfor
428 1.184 lukem
429 1.276 mrg .if ${MKCOMPAT} != "no"
430 1.276 mrg COMPAT_SUBDIR_LIST=lib/csu ${BUILD_CC_LIB} lib/libc
431 1.276 mrg .for dir in ${COMPAT_SUBDIR_LIST}
432 1.276 mrg do-compat-${dir:S/\//-/g}: .PHONY .MAKE
433 1.276 mrg .for targ in obj dependall install
434 1.276 mrg ${MAKEDIRTARGET} compat ${targ} BOOTSTRAP_SUBDIRS="../../../${dir}"
435 1.276 mrg .endfor
436 1.276 mrg .endfor
437 1.276 mrg .endif
438 1.276 mrg
439 1.261 apb do-top-obj: .PHONY .MAKE
440 1.261 apb ${MAKEDIRTARGET} . obj NOSUBDIR=
441 1.261 apb
442 1.260 apb do-tools-obj: .PHONY .MAKE
443 1.260 apb ${MAKEDIRTARGET} tools obj
444 1.260 apb
445 1.249 lukem do-libgcc: .PHONY .MAKE
446 1.256 gmcgarry .if defined(HAVE_GCC)
447 1.249 lukem .if ${MKGCC} != "no"
448 1.280 skrll .if ${USE_COMPILERCRTSTUFF} == "yes"
449 1.249 lukem .if (${HAVE_GCC} == "3" || ${HAVE_GCC} == "4")
450 1.249 lukem ${MAKEDIRTARGET} . do-gnu-lib-crtstuff${LIBGCC_EXT}
451 1.249 lukem .endif
452 1.280 skrll .endif
453 1.249 lukem ${MAKEDIRTARGET} . do-gnu-lib-libgcc${LIBGCC_EXT}
454 1.249 lukem .endif
455 1.256 gmcgarry .endif
456 1.256 gmcgarry
457 1.262 mrg do-compat-libgcc: .PHONY .MAKE
458 1.262 mrg .if defined(HAVE_GCC)
459 1.262 mrg .if ${MKGCC} != "no"
460 1.280 skrll .if ${USE_COMPILERCRTSTUFF} == "yes"
461 1.262 mrg ${MAKEDIRTARGET} . do-compat-gnu-lib-crtstuff${LIBGCC_EXT}
462 1.280 skrll .endif
463 1.262 mrg ${MAKEDIRTARGET} . do-compat-gnu-lib-libgcc${LIBGCC_EXT}
464 1.262 mrg .endif
465 1.262 mrg .endif
466 1.262 mrg
467 1.256 gmcgarry do-libpcc: .PHONY .MAKE
468 1.256 gmcgarry .if defined(HAVE_PCC)
469 1.256 gmcgarry .if ${MKPCC} != "no"
470 1.280 skrll .if ${USE_COMPILERCRTSTUFF} == "yes"
471 1.256 gmcgarry ${MAKEDIRTARGET} . do-pcc-lib-crtstuff
472 1.280 skrll .endif
473 1.256 gmcgarry ${MAKEDIRTARGET} . do-pcc-lib-libpcc
474 1.256 gmcgarry .endif
475 1.256 gmcgarry .endif
476 1.249 lukem
477 1.242 dsl do-ld.so: .PHONY .MAKE
478 1.184 lukem .for targ in dependall install
479 1.232 lukem ${MAKEDIRTARGET} libexec/ld.elf_so ${targ}
480 1.137 tv .endfor
481 1.143 tv
482 1.242 dsl do-build: .PHONY .MAKE
483 1.154 tv .for targ in dependall install
484 1.232 lukem ${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no
485 1.154 tv .endfor
486 1.200 lukem
487 1.242 dsl do-x11: .PHONY .MAKE
488 1.263 mrg .if ${MKX11} != "no"
489 1.263 mrg .if ${X11FLAVOUR} == "Xorg"
490 1.254 mrg ${MAKEDIRTARGET} external/mit/xorg build
491 1.263 mrg .else
492 1.257 lukem ${MAKEDIRTARGET} x11 build
493 1.263 mrg .endif
494 1.254 mrg .else
495 1.263 mrg @echo "MKX11 is not enabled"
496 1.257 lukem @false
497 1.254 mrg .endif
498 1.227 lukem
499 1.275 uebayasi do-extsrc: .PHONY .MAKE
500 1.275 uebayasi .if ${MKEXTSRC} != "no"
501 1.275 uebayasi ${MAKEDIRTARGET} extsrc build
502 1.275 uebayasi .else
503 1.275 uebayasi @echo "MKEXTSRC is not enabled"
504 1.275 uebayasi @false
505 1.275 uebayasi .endif
506 1.275 uebayasi
507 1.242 dsl do-obsolete: .PHONY .MAKE
508 1.232 lukem ${MAKEDIRTARGET} etc install-obsolete-lists
509 1.87 cjs
510 1.193 lukem #
511 1.137 tv # Speedup stubs for some subtrees that don't need to run these rules.
512 1.137 tv # (Tells <bsd.subdir.mk> not to recurse for them.)
513 1.193 lukem #
514 1.129 tv
515 1.152 tv .for dir in bin etc distrib games libexec regress sbin usr.sbin tools
516 1.228 lukem includes-${dir}: .PHONY
517 1.152 tv @true
518 1.152 tv .endfor
519 1.152 tv .for dir in etc distrib regress
520 1.228 lukem install-${dir}: .PHONY
521 1.152 tv @true
522 1.152 tv .endfor
523 1.152 tv
524 1.193 lukem #
525 1.152 tv # XXX this needs to change when distrib Makefiles are recursion compliant
526 1.193 lukem # XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first...
527 1.193 lukem #
528 1.228 lukem dependall-distrib depend-distrib all-distrib: .PHONY
529 1.136 nathanw @true
530 1.130 tv
531 1.211 lukem .include <bsd.sys.mk>
532 1.151 tv .include <bsd.obj.mk>
533 1.209 lukem .include <bsd.kernobj.mk>
534 1.146 tv .include <bsd.subdir.mk>
535 1.144 tv
536 1.228 lukem build-docs: .PHONY ${.CURDIR}/BUILDING
537 1.188 lukem ${.CURDIR}/BUILDING: doc/BUILDING.mdoc
538 1.230 lukem ${_MKMSG_CREATE} ${.TARGET}
539 1.216 lukem ${TOOL_GROFF} -mdoc -Tascii -P-bou $> >$@
540 1.209 lukem
541 1.209 lukem
542 1.209 lukem #
543 1.209 lukem # Display current make(1) parameters
544 1.209 lukem #
545 1.242 dsl params: .PHONY .MAKE
546 1.232 lukem ${MAKEDIRTARGET} etc params
547