Skip to content
Newer
Older
100644 429 lines (375 sloc) 12.6 KB
c51a048 Add the tests.tgz set
jmmv authored
1 # $NetBSD: Makefile,v 1.251 2007/11/12 15:06:45 jmmv Exp $
0737b51 Improve documentation.
cjs authored
2
68a131d * Add two new (experimental) targets:
lukem authored
3 #
0737b51 Improve documentation.
cjs authored
4 # This is the top-level makefile for building NetBSD. For an outline of
5 # how to build a snapshot or release, as well as other release engineering
6552da2 netbsd.org->NetBSD.org
salo authored
6 # information, see http://www.NetBSD.org/developers/releng/index.html
0737b51 Improve documentation.
cjs authored
7 #
8 # Not everything you can set or do is documented in this makefile. In
9 # particular, you should review the files in /usr/share/mk (especially
10 # bsd.README) for general information on building programs and writing
11 # Makefiles within this structure, and see the comments in src/etc/Makefile
12 # for further information on installation and release set options.
13 #
14 # Variables listed below can be set on the make command line (highest
15 # priority), in /etc/mk.conf (middle priority), or in the environment
16 # (lowest priority).
17 #
18 # Variables:
f74fd78 Document MKOBJDIRS here, and sort the variable list in the comments
sommerfeld authored
19 # DESTDIR is the target directory for installation of the compiled
20 # software. It defaults to /. Note that programs are built against
21 # libraries installed in DESTDIR.
4daee47 Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was d…
lukem authored
22 # MKMAN, if `no', will prevent building of manual pages.
23 # MKOBJDIRS, if not `no', will build object directories at
f74fd78 Document MKOBJDIRS here, and sort the variable list in the comments
sommerfeld authored
24 # an appropriate point in a build.
4daee47 Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was d…
lukem authored
25 # MKSHARE, if `no', will prevent building and installing
0737b51 Improve documentation.
cjs authored
26 # anything in /usr/share.
4daee47 Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was d…
lukem authored
27 # MKUPDATE, if not `no', will avoid a `make cleandir' at the start of
4347734 Fix whitespace usage in comment.
enami authored
28 # `make build', as well as having the effects listed in
29 # /usr/share/mk/bsd.README.
62ab463 clarify some variable documentation; from cagney
mrg authored
30 # NOCLEANDIR, if defined, will avoid a `make cleandir' at the start
4347734 Fix whitespace usage in comment.
enami authored
31 # of the `make build'.
035c5bc Document the cool NOCLEANDIR/NOINCLUDES options that somebody added.
toddpw authored
32 # NOINCLUDES will avoid the `make includes' usually done by `make build'.
0737b51 Improve documentation.
cjs authored
33 #
4daee47 Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was d…
lukem authored
34 # See mk.conf(5) for more details.
35 #
36 #
0737b51 Improve documentation.
cjs authored
37 # Targets:
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
38 # build:
ba4ccdc Install release files under "${RELEASEDIR}/${MACHINE}/..." instead of
lukem authored
39 # Builds a full release of NetBSD in DESTDIR, except for the
40 # /etc configuration files.
41 # If BUILD_DONE is set, this is an empty target.
42 # distribution:
43 # Builds a full release of NetBSD in DESTDIR, including the /etc
44 # configuration files.
45 # buildworld:
46 # As per `make distribution', except that it ensures that DESTDIR
47 # is not the root directory.
48 # installworld:
49 # Install the distribution from DESTDIR to INSTALLWORLDDIR (which
50 # defaults to the root directory). Ensures that INSTALLWORLDDIR
51 # is the not root directory if cross compiling.
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
52 # release:
4d11576 Modify "release" to invoke "make distribution" instead of "make build",
lukem authored
53 # Does a `make distribution', and then tars up the DESTDIR files
ba4ccdc Install release files under "${RELEASEDIR}/${MACHINE}/..." instead of
lukem authored
54 # into RELEASEDIR/${MACHINE}, in release(7) format.
55 # (See etc/Makefile for more information on this.)
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
56 # regression-tests:
57 # Runs the regression tests in "regress" on this host.
7677b64 Add "sourcesets" argument/target, which builds source sets into
lukem authored
58 # sets:
59 # Populate ${RELEASEDIR}/${MACHINE}/binary/sets from ${DESTDIR}
60 # sourcesets:
61 # Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR}
574d936 Add a new "syspkgs" target, which simply chains to the "syspkgs" target
apb authored
62 # syspkgs:
63 # Populate ${RELEASEDIR}/${MACHINE}/binary/syspkgs from ${DESTDIR}
ffb1de3 * Add an "iso-image" target in the top level Makefile,
apb authored
64 # iso-image:
71b5d76 Add an iso-image-source option which does the same thing as iso-image…
jnemeth authored
65 # Create CD-ROM image in RELEASEDIR/iso.
ffb1de3 * Add an "iso-image" target in the top level Makefile,
apb authored
66 # RELEASEDIR must already have been populated by `make release'
67 # or equivalent.
71b5d76 Add an iso-image-source option which does the same thing as iso-image…
jnemeth authored
68 # iso-image-source:
69 # Create CD-ROM image with source in RELEASEDIR/iso.
70 # RELEASEDIR must already have been populated by
71 # `make release sourcesets' or equivalent.
080807c fix PR#12832: split `make build' up into these steps (from new the
mrg authored
72 #
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
73 # Targets invoked by `make build,' in order:
74 # cleandir: cleans the tree.
200c6a8 Reverse the order of "make cleandir" and "make obj" back to the way they
tv authored
75 # obj: creates object directories.
f319f65 Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
76 # do-tools: builds host toolchain.
d4d2c94 Put do-make-tools before creating distrib-dirs (as binstall has to be
tv authored
77 # do-distrib-dirs: creates the distribution directories.
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
78 # includes: installs include files.
7813e60 update "targets invoked by make build" to match reality ...
lukem authored
79 # do-tools-compat: builds the "libnbcompat" library; needed for some
80 # random host tool programs in the source tree.
0e6521f correct the comment describing the build order
lukem authored
81 # do-lib-csu: builds and installs prerequisites from lib/csu.
4523b5b Provide 'do-libgcc' to build gnu/lib/crtstuff${LIBGCC_EXT} (if necess…
lukem authored
82 # do-libgcc: builds and installs prerequisites from
83 # gnu/lib/crtstuff${LIBGCC_EXT} (if necessary) and
84 # gnu/lib/libgcc${LIBGCC_EXT}.
0414c13 Add a do-lib-libc target which is processed after do-lib-csu. This
thorpej authored
85 # do-lib-libc: builds and installs prerequisites from lib/libc.
9795940 Re-add intermediate dependall/install targets (do-lib-csu, do-lib,
tv authored
86 # do-lib: builds and installs prerequisites from lib.
87 # do-gnu-lib: builds and installs prerequisites from gnu/lib.
6573b61 MKDYNAMICROOT for a.out
itohy authored
88 # do-ld.so: builds and installs prerequisites from libexec/ld.*_so.
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
89 # do-build: builds and installs the entire system.
3e603ff Implement do-x11, to run "make build" in ./x11/
lukem authored
90 # do-x11: builds and installs X11R6 from src/x11 if ${MKX11} != "no"
07e51a7 fix some comments
lukem authored
91 # do-obsolete: installs the obsolete sets (for the postinstall-* targets).
68a131d * Add two new (experimental) targets:
lukem authored
92 #
2fd3dc7 pull in bsd.own.mk earlier, to get configuration variables.
cgd authored
93
80b70b9 * Always descend into "tools" regardless of USETOOLS setting. Instead,
tv authored
94 .if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == ""
95 .MAKEFLAGS: -m ${.CURDIR}/share/mk
96 .endif
97
68a131d * Add two new (experimental) targets:
lukem authored
98 #
bfba043 If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
tv authored
99 # If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
100 # not be the top level objdir, because "make obj" can happen in the *middle*
101 # of "make build" (long after <bsd.own.mk> is calculated it). So, pre-set
102 # _SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}.
68a131d * Add two new (experimental) targets:
lukem authored
103 #
bfba043 If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
tv authored
104 _SRC_TOP_OBJ_=
105
80b70b9 * Always descend into "tools" regardless of USETOOLS setting. Instead,
tv authored
106 .include <bsd.own.mk>
a445358 change "Id" to "Header" in rcsid, and noted why etc was not in subdirs
cgd authored
107
68a131d * Add two new (experimental) targets:
lukem authored
108 #
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
109 # Sanity check: make sure that "make build" is not invoked simultaneously
110 # with a standard recursive target.
68a131d * Add two new (experimental) targets:
lukem authored
111 #
63a3c7f Fix the rebuild of libgcc:
tv authored
112
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
113 .if make(build) || make(release) || make(snapshot)
114 .for targ in ${TARGETS:Nobj:Ncleandir}
115 .if make(${targ}) && !target(.BEGIN)
116 .BEGIN:
117 @echo 'BUILD ABORTED: "make build" and "make ${targ}" are mutually exclusive.'
118 @false
119 .endif
120 .endfor
a58d7a8 Add a 'NBUILDJOBS' variable which control the number of jobs started in
bouyer authored
121 .endif
122
247c465 Split the _SUBDIR assignment into two assignments so you can do things
simonb authored
123 _SUBDIR= tools lib include gnu bin games libexec sbin usr.bin
c51a048 Add the tests.tgz set
jmmv authored
124 _SUBDIR+= usr.sbin share rescue sys etc tests .WAIT distrib regress
1dee340 allow builds to work if directory games is missing. Closes pr misc/19…
explorer authored
125
68a131d * Add two new (experimental) targets:
lukem authored
126 #
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
127 # Weed out directories that don't exist.
68a131d * Add two new (experimental) targets:
lukem authored
128 #
f5ba3ce make sure include and include/sys are populated before starting to
assar authored
129
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
130 .for dir in ${_SUBDIR}
4b9aeaa don't filter out .WAIT when converting from _SUBDIR to SUBDIR
dbj authored
131 .if ("${dir}" == ".WAIT") || exists(${dir}/Makefile) && (${BUILD_${dir}:Uyes} != "no")
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
132 SUBDIR+= ${dir}
1dee340 allow builds to work if directory games is missing. Closes pr misc/19…
explorer authored
133 .endif
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
134 .endfor
c330d79 allow toplevel makefile to descend into sys
cgd authored
135
72a7b88 Make regress only if directory exists. It can be optional.
brezak authored
136 .if exists(regress)
dd2689d Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
137 regression-tests: .PHONY .MAKE
7e08344 oops, clean that up a bit
cgd authored
138 @echo Running regression tests...
c5a364e Convert lines of the form
lukem authored
139 ${MAKEDIRTARGET} regress regress
1630e06 if not installing man pages, don't remake whatis db
cgd authored
140 .endif
a86f71c add some new targets to DTRT when installing/building
cgd authored
141
4daee47 Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was d…
lukem authored
142 .if ${MKUNPRIVED} != "no"
f58d462 Fix what rev. 1.176 broke, in particular, doing a priv'd build into
thorpej authored
143 NOPOSTINSTALL= # defined
144 .endif
145
dd2689d Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
146 afterinstall: .PHONY .MAKE
d40e55a Add a new target (infodir-meta:) that synthesizes the share/info/dir
perry authored
147 .if ${MKMAN} != "no"
c5a364e Convert lines of the form
lukem authored
148 ${MAKEDIRTARGET} share/man makedb
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
149 .endif
4daee47 Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was d…
lukem authored
150 .if (${MKUNPRIVED} != "no" && ${MKINFO} != "no")
c5a364e Convert lines of the form
lukem authored
151 ${MAKEDIRTARGET} gnu/usr.bin/texinfo/install-info infodir-meta
d40e55a Add a new target (infodir-meta:) that synthesizes the share/info/dir
perry authored
152 .endif
f58d462 Fix what rev. 1.176 broke, in particular, doing a priv'd build into
thorpej authored
153 .if !defined(NOPOSTINSTALL)
c5a364e Convert lines of the form
lukem authored
154 ${MAKEDIRTARGET} . postinstall-check
9f44a83 In afterinstall, only run postinstall check if DESTDIR == / (or equiv…
lukem authored
155 .endif
e0343d8 move postinstall from afterinstall to separate "postinstall-check" ta…
lukem authored
156
3487ffd use usr.sbin/postinstall/postinstall instead of etc/postinstall
lukem authored
157 _POSTINSTALL= ${.CURDIR}/usr.sbin/postinstall/postinstall
158
fc5c130 Apply the .PHONY attribute where appropriate.
lukem authored
159 postinstall-check: .PHONY
ceb0565 run "./etc/postinstall check" in afterinstall:
lukem authored
160 @echo " === Post installation checks ==="
8bb1081 Do not abort on exit code 1 from postinstall check, this is expected.
pavel authored
161 ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi
ceb0565 run "./etc/postinstall check" in afterinstall:
lukem authored
162 @echo " ================================"
163
fc5c130 Apply the .PHONY attribute where appropriate.
lukem authored
164 postinstall-fix: .NOTMAIN .PHONY
a8d4efa we might as well provide a handy "postinstall-fix" target whilst here
lukem authored
165 @echo " === Post installation fixes ==="
3487ffd use usr.sbin/postinstall/postinstall instead of etc/postinstall
lukem authored
166 ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix
0eb2248 Add postinstall-fix-obsolete (to invoke "postinstall fix obsolete" -
lukem authored
167 @echo " ==============================="
168
fc5c130 Apply the .PHONY attribute where appropriate.
lukem authored
169 postinstall-fix-obsolete: .NOTMAIN .PHONY
0eb2248 Add postinstall-fix-obsolete (to invoke "postinstall fix obsolete" -
lukem authored
170 @echo " === Removing obsolete files ==="
3487ffd use usr.sbin/postinstall/postinstall instead of etc/postinstall
lukem authored
171 ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix obsolete
0eb2248 Add postinstall-fix-obsolete (to invoke "postinstall fix obsolete" -
lukem authored
172 @echo " ==============================="
a8d4efa we might as well provide a handy "postinstall-fix" target whilst here
lukem authored
173
d40e55a Add a new target (infodir-meta:) that synthesizes the share/info/dir
perry authored
174
68a131d * Add two new (experimental) targets:
lukem authored
175 #
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
176 # Targets (in order!) called by "make build".
68a131d * Add two new (experimental) targets:
lukem authored
177 #
f2feb00 remove support for building (with) GCC 2.95. also:
mrg authored
178 .if ${HAVE_GCC} == "3"
a554aa0 maybe build gnu/lib/libgcc3 instead of libgcc[2]
mrg authored
179 LIBGCC_EXT=3
180 .else
f2feb00 remove support for building (with) GCC 2.95. also:
mrg authored
181 LIBGCC_EXT=4
a554aa0 maybe build gnu/lib/libgcc3 instead of libgcc[2]
mrg authored
182 .endif
8039d65 If updating from a system which has a /usr/pkg/info/dir, move that to
tv authored
183
8f2ee77 Warn when "make build" is started with USE_NEW_TOOLCHAIN on a platfor…
tv authored
184 BUILDTARGETS+= check-tools
4daee47 Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was d…
lukem authored
185 .if ${MKUPDATE} == "no" && !defined(NOCLEANDIR)
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
186 BUILDTARGETS+= cleandir
d4d2c94 Put do-make-tools before creating distrib-dirs (as binstall has to be
tv authored
187 .endif
200c6a8 Reverse the order of "make cleandir" and "make obj" back to the way they
tv authored
188 .if ${MKOBJDIRS} != "no"
189 BUILDTARGETS+= obj
190 .endif
e80b6f3 Change
tv authored
191 .if ${USETOOLS} == "yes"
f319f65 Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
192 BUILDTARGETS+= do-tools
dec78b7 UPDATING (1.38) says:
mason authored
193 .endif
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
194 .if !defined(NODISTRIBDIRS)
195 BUILDTARGETS+= do-distrib-dirs
d4d2c94 Put do-make-tools before creating distrib-dirs (as binstall has to be
tv authored
196 .endif
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
197 .if !defined(NOINCLUDES)
198 BUILDTARGETS+= includes
d4d2c94 Put do-make-tools before creating distrib-dirs (as binstall has to be
tv authored
199 .endif
b726ac1 Always build tools/compat, so that random host helper programs
thorpej authored
200 BUILDTARGETS+= do-tools-compat
df22423 Be more gcc like in the way we deal with libgcc so that sh3/hppa mill…
skrll authored
201 BUILDTARGETS+= do-lib-csu
1889e8f build libgcc early, if at all
drochner authored
202 .if ${MKGCC} != "no"
4523b5b Provide 'do-libgcc' to build gnu/lib/crtstuff${LIBGCC_EXT} (if necess…
lukem authored
203 BUILDTARGETS+= do-libgcc
1889e8f build libgcc early, if at all
drochner authored
204 .endif
df22423 Be more gcc like in the way we deal with libgcc so that sh3/hppa mill…
skrll authored
205 BUILDTARGETS+= do-lib-libc
1a63075 only build do-lib-libdes if ${MKCRYPTO}!=no
lukem authored
206 BUILDTARGETS+= do-lib do-gnu-lib
207 BUILDTARGETS+= do-ld.so
208 BUILDTARGETS+= do-build
3e603ff Implement do-x11, to run "make build" in ./x11/
lukem authored
209 .if ${MKX11} != "no"
210 BUILDTARGETS+= do-x11
211 .endif
9ec650d all:
lukem authored
212 BUILDTARGETS+= do-obsolete
d4d2c94 Put do-make-tools before creating distrib-dirs (as binstall has to be
tv authored
213
68a131d * Add two new (experimental) targets:
lukem authored
214 #
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
215 # Enforce proper ordering of some rules.
68a131d * Add two new (experimental) targets:
lukem authored
216 #
080807c fix PR#12832: split `make build' up into these steps (from new the
mrg authored
217
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
218 .ORDER: ${BUILDTARGETS}
fc5c130 Apply the .PHONY attribute where appropriate.
lukem authored
219 includes-lib: .PHONY includes-include includes-sys
220 includes-gnu: .PHONY includes-lib
080807c fix PR#12832: split `make build' up into these steps (from new the
mrg authored
221
68a131d * Add two new (experimental) targets:
lukem authored
222 #
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
223 # Build the system and install into DESTDIR.
68a131d * Add two new (experimental) targets:
lukem authored
224 #
c95f25e The final step -- hook src/tools into the main build. If USE_NEW_TOOL…
tv authored
225
14e5273 show the start time at the end of the build as well.
lukem authored
226 START_TIME!= date
227
dd2689d Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
228 build: .PHONY .MAKE
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
229 .if defined(BUILD_DONE)
230 @echo "Build already installed into ${DESTDIR}"
231 .else
14e5273 show the start time at the end of the build as well.
lukem authored
232 @echo "Build started at: ${START_TIME}"
9694162 Work around parallelism lossage, because .ORDER doesn't work yet
tv authored
233 .for tgt in ${BUILDTARGETS}
c5a364e Convert lines of the form
lukem authored
234 ${MAKEDIRTARGET} . ${tgt}
9694162 Work around parallelism lossage, because .ORDER doesn't work yet
tv authored
235 .endfor
c5a364e Convert lines of the form
lukem authored
236 ${MAKEDIRTARGET} etc install-etc-release
14e5273 show the start time at the end of the build as well.
lukem authored
237 @echo "Build started at: ${START_TIME}"
d199a81 Use printf rather than echo -n, since the former works on all POSIX s…
bjh21 authored
238 @printf "Build finished at: " && date
8ec0ae1 Do not build libgcc 3 times.
mycroft authored
239 .endif
080807c fix PR#12832: split `make build' up into these steps (from new the
mrg authored
240
68a131d * Add two new (experimental) targets:
lukem authored
241 #
5fff7ce Add a wrapper for the "distribution" target, similar to the wrapper
thorpej authored
242 # Build a full distribution, but not a release (i.e. no sets into
68a131d * Add two new (experimental) targets:
lukem authored
243 # ${RELEASEDIR}). "buildworld" enforces a build to ${DESTDIR} != /
244 #
5fff7ce Add a wrapper for the "distribution" target, similar to the wrapper
thorpej authored
245
dd2689d Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
246 distribution buildworld: .PHONY .MAKE
8563563 fix DESTDIR checks if !defined(DESTDIR)
lukem authored
247 .if make(buildworld) && \
248 (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
68a131d * Add two new (experimental) targets:
lukem authored
249 @echo "Won't make ${.TARGET} with DESTDIR=/"
250 @false
251 .endif
c5a364e Convert lines of the form
lukem authored
252 ${MAKEDIRTARGET} . build NOPOSTINSTALL=1
253 ${MAKEDIRTARGET} etc distribution INSTALL_DONE=1
333440b After running the body of the "distribution" target, do a "checkflist…
thorpej authored
254 .if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/"
c5a364e Convert lines of the form
lukem authored
255 ${MAKEDIRTARGET} . postinstall-fix-obsolete
256 ${MAKEDIRTARGET} distrib/sets checkflist
333440b After running the body of the "distribution" target, do a "checkflist…
thorpej authored
257 .endif
7d6d7d5 improve previous; show times at end of distribution/release/snapshot …
lukem authored
258 @echo "make ${.TARGET} started at: ${START_TIME}"
eabfc5d print date when make {distribution,release,snapshot} finished
lukem authored
259 @printf "make ${.TARGET} finished at: " && date
5fff7ce Add a wrapper for the "distribution" target, similar to the wrapper
thorpej authored
260
68a131d * Add two new (experimental) targets:
lukem authored
261 #
262 # Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/')
263 # If installing to /, ensures that the host's operating system is NetBSD and
264 # the host's `uname -m` == ${MACHINE}.
265 #
266
267 HOST_UNAME_S!= uname -s
268 HOST_UNAME_M!= uname -m
269
dd2689d Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
270 installworld: .PHONY .MAKE
8563563 fix DESTDIR checks if !defined(DESTDIR)
lukem authored
271 .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
68a131d * Add two new (experimental) targets:
lukem authored
272 @echo "Can't make ${.TARGET} to DESTDIR=/"
273 @false
274 .endif
275 .if !defined(INSTALLWORLDDIR) || \
276 ${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/"
277 .if (${HOST_UNAME_S} != "NetBSD")
278 @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/"
279 @false
280 .endif
281 .if (${HOST_UNAME_M} != ${MACHINE})
282 @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/"
283 @false
284 .endif
285 .endif
c5a364e Convert lines of the form
lukem authored
286 ${MAKEDIRTARGET} distrib/sets installsets \
287 INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=
288 ${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR}
68a131d * Add two new (experimental) targets:
lukem authored
289 @echo "make ${.TARGET} started at: ${START_TIME}"
290 @printf "make ${.TARGET} finished at: " && date
291
292 #
7677b64 Add "sourcesets" argument/target, which builds source sets into
lukem authored
293 # Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR
30a629a - Add "sets" top-level Makefile target and build.sh operation.
lukem authored
294 #
295
574d936 Add a new "syspkgs" target, which simply chains to the "syspkgs" target
apb authored
296 .for tgt in sets sourcesets syspkgs
dd2689d Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
297 ${tgt}: .PHONY .MAKE
c5a364e Convert lines of the form
lukem authored
298 ${MAKEDIRTARGET} distrib/sets ${tgt}
7677b64 Add "sourcesets" argument/target, which builds source sets into
lukem authored
299 .endfor
30a629a - Add "sets" top-level Makefile target and build.sh operation.
lukem authored
300
301 #
4d11576 Modify "release" to invoke "make distribution" instead of "make build",
lukem authored
302 # Build a release or snapshot (implies "make distribution"). Note that
333440b After running the body of the "distribution" target, do a "checkflist…
thorpej authored
303 # in this case, the set lists will be checked before the tar files
304 # are made.
68a131d * Add two new (experimental) targets:
lukem authored
305 #
080807c fix PR#12832: split `make build' up into these steps (from new the
mrg authored
306
dd2689d Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
307 release snapshot: .PHONY .MAKE
4d11576 Modify "release" to invoke "make distribution" instead of "make build",
lukem authored
308 ${MAKEDIRTARGET} . distribution
309 ${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1
7d6d7d5 improve previous; show times at end of distribution/release/snapshot …
lukem authored
310 @echo "make ${.TARGET} started at: ${START_TIME}"
eabfc5d print date when make {distribution,release,snapshot} finished
lukem authored
311 @printf "make ${.TARGET} finished at: " && date
080807c fix PR#12832: split `make build' up into these steps (from new the
mrg authored
312
68a131d * Add two new (experimental) targets:
lukem authored
313 #
ffb1de3 * Add an "iso-image" target in the top level Makefile,
apb authored
314 # Create a CD-ROM image.
315 #
316
317 iso-image: .PHONY
0a87530 Add an iso_image target (iso-image as a target name doesn't play well…
bouyer authored
318 ${MAKEDIRTARGET} distrib iso_image
ffb1de3 * Add an "iso-image" target in the top level Makefile,
apb authored
319 ${MAKEDIRTARGET} etc iso-image
320 @echo "make ${.TARGET} started at: ${START_TIME}"
321 @printf "make ${.TARGET} finished at: " && date
322
71b5d76 Add an iso-image-source option which does the same thing as iso-image…
jnemeth authored
323 iso-image-source: .PHONY
324 ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true
325 ${MAKEDIRTARGET} etc iso-image
326 @echo "make ${.TARGET} started at: ${START_TIME}"
327 @printf "make ${.TARGET} finished at: " && date
328
ffb1de3 * Add an "iso-image" target in the top level Makefile,
apb authored
329 #
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
330 # Special components of the "make build" process.
68a131d * Add two new (experimental) targets:
lukem authored
331 #
080807c fix PR#12832: split `make build' up into these steps (from new the
mrg authored
332
fc5c130 Apply the .PHONY attribute where appropriate.
lukem authored
333 check-tools: .PHONY
d0049d7 Consistently check ${TOOLCHAIN_MISSING} against "no".
lukem authored
334 .if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN)
be7931b * Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
thorpej authored
335 @echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.'
336 @echo '*** May result in a failed build or corrupt binaries!'
337 .elif defined(EXTERNAL_TOOLCHAIN)
338 @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.'
8f2ee77 Warn when "make build" is started with USE_NEW_TOOLCHAIN on a platfor…
tv authored
339 .endif
e20e132 Correct BUGS in BUILDING.mdoc now that most ports are USE_NEW_TOOLCHAIN
sommerfeld authored
340 .if defined(NBUILDJOBS)
341 @echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!'
342 .endif
8f2ee77 Warn when "make build" is started with USE_NEW_TOOLCHAIN on a platfor…
tv authored
343
dd2689d Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
344 do-distrib-dirs: .PHONY .MAKE
643657c Add back logic which forces DESTDIR=/ for the distrib-dirs rule if it…
jmc authored
345 .if !defined(DESTDIR) || ${DESTDIR} == ""
c5a364e Convert lines of the form
lukem authored
346 ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/
643657c Add back logic which forces DESTDIR=/ for the distrib-dirs rule if it…
jmc authored
347 .else
c5a364e Convert lines of the form
lukem authored
348 ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR}
643657c Add back logic which forces DESTDIR=/ for the distrib-dirs rule if it…
jmc authored
349 .endif
080807c fix PR#12832: split `make build' up into these steps (from new the
mrg authored
350
d5fa963 Add do-{target} aliases for: cleandir obj includes
lukem authored
351 .for targ in cleandir obj includes
fc5c130 Apply the .PHONY attribute where appropriate.
lukem authored
352 do-${targ}: .PHONY ${targ}
d5fa963 Add do-{target} aliases for: cleandir obj includes
lukem authored
353 @true
354 .endfor
355
7d9ebae Switch to using GCC's supplied crtbegin / crtend files.
thorpej authored
356 .for dir in tools tools/compat lib/csu gnu/lib/crtstuff${LIBGCC_EXT} gnu/lib/libgcc${LIBGCC_EXT} lib/libc lib/libdes lib gnu/lib
dd2689d Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
357 do-${dir:S/\//-/g}: .PHONY .MAKE
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
358 .for targ in dependall install
c5a364e Convert lines of the form
lukem authored
359 ${MAKEDIRTARGET} ${dir} ${targ}
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
360 .endfor
361 .endfor
9795940 Re-add intermediate dependall/install targets (do-lib-csu, do-lib,
tv authored
362
4523b5b Provide 'do-libgcc' to build gnu/lib/crtstuff${LIBGCC_EXT} (if necess…
lukem authored
363 do-libgcc: .PHONY .MAKE
364 .if ${MKGCC} != "no"
365 .if (${HAVE_GCC} == "3" || ${HAVE_GCC} == "4")
366 ${MAKEDIRTARGET} . do-gnu-lib-crtstuff${LIBGCC_EXT}
367 .endif
368 ${MAKEDIRTARGET} . do-gnu-lib-libgcc${LIBGCC_EXT}
369 .endif
370
dd2689d Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
371 do-ld.so: .PHONY .MAKE
e28725e add "do-ld.elf_so" target, which builds & installs libexec/ld.elf_so.
lukem authored
372 .for targ in dependall install
6573b61 MKDYNAMICROOT for a.out
itohy authored
373 .if (${OBJECT_FMT} == "a.out")
c5a364e Convert lines of the form
lukem authored
374 ${MAKEDIRTARGET} libexec/ld.aout_so ${targ}
6573b61 MKDYNAMICROOT for a.out
itohy authored
375 .endif
376 .if (${OBJECT_FMT} == "ELF")
c5a364e Convert lines of the form
lukem authored
377 ${MAKEDIRTARGET} libexec/ld.elf_so ${targ}
6573b61 MKDYNAMICROOT for a.out
itohy authored
378 .endif
e28725e add "do-ld.elf_so" target, which builds & installs libexec/ld.elf_so.
lukem authored
379 .endfor
380
dd2689d Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
381 do-build: .PHONY .MAKE
2f93f83 Rather than build in `tools' and `lib' twice, build `tools' and `lib'
tv authored
382 .for targ in dependall install
c5a364e Convert lines of the form
lukem authored
383 ${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no
2f93f83 Rather than build in `tools' and `lib' twice, build `tools' and `lib'
tv authored
384 .endfor
a86f71c add some new targets to DTRT when installing/building
cgd authored
385
dd2689d Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
386 do-x11: .PHONY .MAKE
c5a364e Convert lines of the form
lukem authored
387 ${MAKEDIRTARGET} x11 build
3e603ff Implement do-x11, to run "make build" in ./x11/
lukem authored
388
dd2689d Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
389 do-obsolete: .PHONY .MAKE
c5a364e Convert lines of the form
lukem authored
390 ${MAKEDIRTARGET} etc install-obsolete-lists
9ec650d all:
lukem authored
391
68a131d * Add two new (experimental) targets:
lukem authored
392 #
2146a04 Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
393 # Speedup stubs for some subtrees that don't need to run these rules.
394 # (Tells <bsd.subdir.mk> not to recurse for them.)
68a131d * Add two new (experimental) targets:
lukem authored
395 #
eded244 Add release and snapshot targets. (They do the same thing.)
cjs authored
396
f319f65 Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
397 .for dir in bin etc distrib games libexec regress sbin usr.sbin tools
fc5c130 Apply the .PHONY attribute where appropriate.
lukem authored
398 includes-${dir}: .PHONY
f319f65 Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
399 @true
400 .endfor
401 .for dir in etc distrib regress
fc5c130 Apply the .PHONY attribute where appropriate.
lukem authored
402 install-${dir}: .PHONY
f319f65 Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
403 @true
404 .endfor
405
68a131d * Add two new (experimental) targets:
lukem authored
406 #
f319f65 Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
407 # XXX this needs to change when distrib Makefiles are recursion compliant
68a131d * Add two new (experimental) targets:
lukem authored
408 # XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first...
409 #
fc5c130 Apply the .PHONY attribute where appropriate.
lukem authored
410 dependall-distrib depend-distrib all-distrib: .PHONY
27f5b1e Use @true instead of @${TRUE} in includes-foo targets, since there is no
nathanw authored
411 @true
c8301d9 - Remove the include of Makefile.tools; this will be done elsewhere.
tv authored
412
9c3550f Rename a large chunk of the make(1) variables which refer to a
lukem authored
413 .include <bsd.sys.mk>
6f93870 Create an objdir here for storage of timestamps, build-wide data, and so
tv authored
414 .include <bsd.obj.mk>
6e84ec2 Add "params" target, to display the value of various variables.
lukem authored
415 .include <bsd.kernobj.mk>
80b70b9 * Always descend into "tools" regardless of USETOOLS setting. Instead,
tv authored
416 .include <bsd.subdir.mk>
542ae27 Add rules for generating plaintext and HTML versions of the "BUILDING"
tv authored
417
fc5c130 Apply the .PHONY attribute where appropriate.
lukem authored
418 build-docs: .PHONY ${.CURDIR}/BUILDING
35418f5 move BUILDING.mdoc -> doc/BUILDING.mdoc
lukem authored
419 ${.CURDIR}/BUILDING: doc/BUILDING.mdoc
1742381 MAKEVERBOSE support for build-docs
lukem authored
420 ${_MKMSG_CREATE} ${.TARGET}
dbf7b4c redo previous (functionality rollback of 1.213) to retain the style o…
lukem authored
421 ${TOOL_GROFF} -mdoc -Tascii -P-bou $> >$@
6e84ec2 Add "params" target, to display the value of various variables.
lukem authored
422
423
424 #
425 # Display current make(1) parameters
426 #
dd2689d Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
427 params: .PHONY .MAKE
c5a364e Convert lines of the form
lukem authored
428 ${MAKEDIRTARGET} etc params
Something went wrong with that request. Please try again.