Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 468 lines (412 sloc) 14.073 kb
881089f Sync with wrstuden-revivesa-base-2.
wrstuden authored
1 # $NetBSD: Makefile,v 1.252.4.2 2008/09/18 04:27:24 wrstuden Exp $
4693743 Improve documentation.
cjs authored
2
69d1160 * Add two new (experimental) targets:
lukem authored
3 #
4693743 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
4152b20 netbsd.org->NetBSD.org
salo authored
6 # information, see http://www.NetBSD.org/developers/releng/index.html
4693743 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:
f7a8ac6 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.
0f2c0be 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
f7a8ac6 Document MKOBJDIRS here, and sort the variable list in the comments
sommerfeld authored
24 # an appropriate point in a build.
0f2c0be 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
4693743 Improve documentation.
cjs authored
26 # anything in /usr/share.
0f2c0be 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
6485a5c Fix whitespace usage in comment.
enami authored
28 # `make build', as well as having the effects listed in
29 # /usr/share/mk/bsd.README.
f40352f clarify some variable documentation; from cagney
mrg authored
30 # NOCLEANDIR, if defined, will avoid a `make cleandir' at the start
6485a5c Fix whitespace usage in comment.
enami authored
31 # of the `make build'.
f979063 Document the cool NOCLEANDIR/NOINCLUDES options that somebody added.
toddpw authored
32 # NOINCLUDES will avoid the `make includes' usually done by `make build'.
4693743 Improve documentation.
cjs authored
33 #
0f2c0be 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 #
4693743 Improve documentation.
cjs authored
37 # Targets:
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
38 # build:
4626503 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.
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
52 # release:
4903b14 Modify "release" to invoke "make distribution" instead of "make build",
lukem authored
53 # Does a `make distribution', and then tars up the DESTDIR files
97b91fc Consistently document RELEASEDIR/RELEASEMACHINEDIR.
lukem authored
54 # into ${RELEASEDIR}/${RELEASEMACHINEDIR}, in release(7) format.
4626503 Install release files under "${RELEASEDIR}/${MACHINE}/..." instead of
lukem authored
55 # (See etc/Makefile for more information on this.)
c210e5b 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.
b31e270 Add "sourcesets" argument/target, which builds source sets into
lukem authored
58 # sets:
97b91fc Consistently document RELEASEDIR/RELEASEMACHINEDIR.
lukem authored
59 # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
60 # from ${DESTDIR}
b31e270 Add "sourcesets" argument/target, which builds source sets into
lukem authored
61 # sourcesets:
62 # Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR}
0934a2e Add a new "syspkgs" target, which simply chains to the "syspkgs" target
apb authored
63 # syspkgs:
97b91fc Consistently document RELEASEDIR/RELEASEMACHINEDIR.
lukem authored
64 # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/syspkgs
65 # from ${DESTDIR}
468bd5d * Add an "iso-image" target in the top level Makefile,
apb authored
66 # iso-image:
82d4f8d Add an iso-image-source option which does the same thing as iso-image…
jnemeth authored
67 # Create CD-ROM image in RELEASEDIR/iso.
468bd5d * Add an "iso-image" target in the top level Makefile,
apb authored
68 # RELEASEDIR must already have been populated by `make release'
69 # or equivalent.
82d4f8d Add an iso-image-source option which does the same thing as iso-image…
jnemeth authored
70 # iso-image-source:
71 # Create CD-ROM image with source in RELEASEDIR/iso.
72 # RELEASEDIR must already have been populated by
73 # `make release sourcesets' or equivalent.
c76af6d fix PR#12832: split `make build' up into these steps (from new the
mrg authored
74 #
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
75 # Targets invoked by `make build,' in order:
76 # cleandir: cleans the tree.
c2c3d6f Reverse the order of "make cleandir" and "make obj" back to the way they
tv authored
77 # obj: creates object directories.
85a68ff Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
78 # do-tools: builds host toolchain.
a7041f0 Put do-make-tools before creating distrib-dirs (as binstall has to be
tv authored
79 # do-distrib-dirs: creates the distribution directories.
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
80 # includes: installs include files.
be4d05d update "targets invoked by make build" to match reality ...
lukem authored
81 # do-tools-compat: builds the "libnbcompat" library; needed for some
82 # random host tool programs in the source tree.
5b1b90c correct the comment describing the build order
lukem authored
83 # do-lib-csu: builds and installs prerequisites from lib/csu.
26b7b01 Provide 'do-libgcc' to build gnu/lib/crtstuff${LIBGCC_EXT} (if necess…
lukem authored
84 # do-libgcc: builds and installs prerequisites from
85 # gnu/lib/crtstuff${LIBGCC_EXT} (if necessary) and
86 # gnu/lib/libgcc${LIBGCC_EXT}.
881089f Sync with wrstuden-revivesa-base-2.
wrstuden authored
87 # do-libpcc: builds and install prerequisites from
88 # external/bsd/pcc/crtstuff and external/bsd/pcc/libpcc.
7c3b4fc Add a do-lib-libc target which is processed after do-lib-csu. This
thorpej authored
89 # do-lib-libc: builds and installs prerequisites from lib/libc.
b9e597f Re-add intermediate dependall/install targets (do-lib-csu, do-lib,
tv authored
90 # do-lib: builds and installs prerequisites from lib.
91 # do-gnu-lib: builds and installs prerequisites from gnu/lib.
76a76a9 Sync w/ -current. 34 merge conflicts to follow.
wrstuden authored
92 # do-external-lib: builds and installs prerequisites from external/lib.
881089f Sync with wrstuden-revivesa-base-2.
wrstuden authored
93 # do-sys-rump-fs-lib: builds and installs prerequisites from sys/rump/fs/lib
770f682 MKDYNAMICROOT for a.out
itohy authored
94 # do-ld.so: builds and installs prerequisites from libexec/ld.*_so.
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
95 # do-build: builds and installs the entire system.
881089f Sync with wrstuden-revivesa-base-2.
wrstuden authored
96 # do-x11: builds and installs X11; either
97 # X11R7 from src/external/mit/xorg if ${MKORG} != "no"
98 # or X11R6 from src/x11 if ${MKX11} != "no"
ed6f193 fix some comments
lukem authored
99 # do-obsolete: installs the obsolete sets (for the postinstall-* targets).
69d1160 * Add two new (experimental) targets:
lukem authored
100 #
448982f pull in bsd.own.mk earlier, to get configuration variables.
cgd authored
101
79154dd * Always descend into "tools" regardless of USETOOLS setting. Instead,
tv authored
102 .if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == ""
103 .MAKEFLAGS: -m ${.CURDIR}/share/mk
104 .endif
105
69d1160 * Add two new (experimental) targets:
lukem authored
106 #
9d29a4f If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
tv authored
107 # If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
108 # not be the top level objdir, because "make obj" can happen in the *middle*
109 # of "make build" (long after <bsd.own.mk> is calculated it). So, pre-set
110 # _SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}.
69d1160 * Add two new (experimental) targets:
lukem authored
111 #
9d29a4f If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
tv authored
112 _SRC_TOP_OBJ_=
113
79154dd * Always descend into "tools" regardless of USETOOLS setting. Instead,
tv authored
114 .include <bsd.own.mk>
a445358 change "Id" to "Header" in rcsid, and noted why etc was not in subdirs
cgd authored
115
69d1160 * Add two new (experimental) targets:
lukem authored
116 #
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
117 # Sanity check: make sure that "make build" is not invoked simultaneously
118 # with a standard recursive target.
69d1160 * Add two new (experimental) targets:
lukem authored
119 #
c2e4e20 Fix the rebuild of libgcc:
tv authored
120
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
121 .if make(build) || make(release) || make(snapshot)
122 .for targ in ${TARGETS:Nobj:Ncleandir}
123 .if make(${targ}) && !target(.BEGIN)
124 .BEGIN:
125 @echo 'BUILD ABORTED: "make build" and "make ${targ}" are mutually exclusive.'
126 @false
127 .endif
128 .endfor
046845e Add a 'NBUILDJOBS' variable which control the number of jobs started in
bouyer authored
129 .endif
130
76a76a9 Sync w/ -current. 34 merge conflicts to follow.
wrstuden authored
131 _SUBDIR= tools lib include gnu external bin games libexec sbin usr.bin
a56e490 Add the tests.tgz set
jmmv authored
132 _SUBDIR+= usr.sbin share rescue sys etc tests .WAIT distrib regress
634e8c1 allow builds to work if directory games is missing. Closes pr misc/19…
explorer authored
133
69d1160 * Add two new (experimental) targets:
lukem authored
134 #
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
135 # Weed out directories that don't exist.
69d1160 * Add two new (experimental) targets:
lukem authored
136 #
e2c2314 make sure include and include/sys are populated before starting to
assar authored
137
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
138 .for dir in ${_SUBDIR}
a166943 don't filter out .WAIT when converting from _SUBDIR to SUBDIR
dbj authored
139 .if ("${dir}" == ".WAIT") || exists(${dir}/Makefile) && (${BUILD_${dir}:Uyes} != "no")
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
140 SUBDIR+= ${dir}
634e8c1 allow builds to work if directory games is missing. Closes pr misc/19…
explorer authored
141 .endif
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
142 .endfor
c330d79 allow toplevel makefile to descend into sys
cgd authored
143
72a7b88 Make regress only if directory exists. It can be optional.
brezak authored
144 .if exists(regress)
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
145 regression-tests: .PHONY .MAKE
7e08344 oops, clean that up a bit
cgd authored
146 @echo Running regression tests...
8993a70 Convert lines of the form
lukem authored
147 ${MAKEDIRTARGET} regress regress
bc33876 if not installing man pages, don't remake whatis db
cgd authored
148 .endif
7413e10 add some new targets to DTRT when installing/building
cgd authored
149
0f2c0be Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was d…
lukem authored
150 .if ${MKUNPRIVED} != "no"
62b3892 Fix what rev. 1.176 broke, in particular, doing a priv'd build into
thorpej authored
151 NOPOSTINSTALL= # defined
152 .endif
153
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
154 afterinstall: .PHONY .MAKE
a0e7536 Add a new target (infodir-meta:) that synthesizes the share/info/dir
perry authored
155 .if ${MKMAN} != "no"
8993a70 Convert lines of the form
lukem authored
156 ${MAKEDIRTARGET} share/man makedb
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
157 .endif
0f2c0be Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was d…
lukem authored
158 .if (${MKUNPRIVED} != "no" && ${MKINFO} != "no")
8993a70 Convert lines of the form
lukem authored
159 ${MAKEDIRTARGET} gnu/usr.bin/texinfo/install-info infodir-meta
a0e7536 Add a new target (infodir-meta:) that synthesizes the share/info/dir
perry authored
160 .endif
62b3892 Fix what rev. 1.176 broke, in particular, doing a priv'd build into
thorpej authored
161 .if !defined(NOPOSTINSTALL)
8993a70 Convert lines of the form
lukem authored
162 ${MAKEDIRTARGET} . postinstall-check
52b0450 In afterinstall, only run postinstall check if DESTDIR == / (or equiv…
lukem authored
163 .endif
6c495ae move postinstall from afterinstall to separate "postinstall-check" ta…
lukem authored
164
c39ab16 use usr.sbin/postinstall/postinstall instead of etc/postinstall
lukem authored
165 _POSTINSTALL= ${.CURDIR}/usr.sbin/postinstall/postinstall
166
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
167 postinstall-check: .PHONY
ff9a5ba run "./etc/postinstall check" in afterinstall:
lukem authored
168 @echo " === Post installation checks ==="
f561666 Do not abort on exit code 1 from postinstall check, this is expected.
pavel authored
169 ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi
ff9a5ba run "./etc/postinstall check" in afterinstall:
lukem authored
170 @echo " ================================"
171
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
172 postinstall-fix: .NOTMAIN .PHONY
84bb4a2 we might as well provide a handy "postinstall-fix" target whilst here
lukem authored
173 @echo " === Post installation fixes ==="
c39ab16 use usr.sbin/postinstall/postinstall instead of etc/postinstall
lukem authored
174 ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix
6784880 Add postinstall-fix-obsolete (to invoke "postinstall fix obsolete" -
lukem authored
175 @echo " ==============================="
176
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
177 postinstall-fix-obsolete: .NOTMAIN .PHONY
6784880 Add postinstall-fix-obsolete (to invoke "postinstall fix obsolete" -
lukem authored
178 @echo " === Removing obsolete files ==="
c39ab16 use usr.sbin/postinstall/postinstall instead of etc/postinstall
lukem authored
179 ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix obsolete
6784880 Add postinstall-fix-obsolete (to invoke "postinstall fix obsolete" -
lukem authored
180 @echo " ==============================="
84bb4a2 we might as well provide a handy "postinstall-fix" target whilst here
lukem authored
181
a0e7536 Add a new target (infodir-meta:) that synthesizes the share/info/dir
perry authored
182
69d1160 * Add two new (experimental) targets:
lukem authored
183 #
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
184 # Targets (in order!) called by "make build".
69d1160 * Add two new (experimental) targets:
lukem authored
185 #
881089f Sync with wrstuden-revivesa-base-2.
wrstuden authored
186 .if defined(HAVE_GCC)
5b803cb remove support for building (with) GCC 2.95. also:
mrg authored
187 .if ${HAVE_GCC} == "3"
f99f07d maybe build gnu/lib/libgcc3 instead of libgcc[2]
mrg authored
188 LIBGCC_EXT=3
189 .else
5b803cb remove support for building (with) GCC 2.95. also:
mrg authored
190 LIBGCC_EXT=4
f99f07d maybe build gnu/lib/libgcc3 instead of libgcc[2]
mrg authored
191 .endif
881089f Sync with wrstuden-revivesa-base-2.
wrstuden authored
192 .endif
a3028a2 If updating from a system which has a /usr/pkg/info/dir, move that to
tv authored
193
ca06aeb Warn when "make build" is started with USE_NEW_TOOLCHAIN on a platfor…
tv authored
194 BUILDTARGETS+= check-tools
0f2c0be Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was d…
lukem authored
195 .if ${MKUPDATE} == "no" && !defined(NOCLEANDIR)
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
196 BUILDTARGETS+= cleandir
a7041f0 Put do-make-tools before creating distrib-dirs (as binstall has to be
tv authored
197 .endif
c2c3d6f Reverse the order of "make cleandir" and "make obj" back to the way they
tv authored
198 .if ${MKOBJDIRS} != "no"
199 BUILDTARGETS+= obj
200 .endif
f76409a Change
tv authored
201 .if ${USETOOLS} == "yes"
85a68ff Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
202 BUILDTARGETS+= do-tools
2caf839 UPDATING (1.38) says:
mason authored
203 .endif
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
204 .if !defined(NODISTRIBDIRS)
205 BUILDTARGETS+= do-distrib-dirs
a7041f0 Put do-make-tools before creating distrib-dirs (as binstall has to be
tv authored
206 .endif
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
207 .if !defined(NOINCLUDES)
208 BUILDTARGETS+= includes
a7041f0 Put do-make-tools before creating distrib-dirs (as binstall has to be
tv authored
209 .endif
b042d91 Always build tools/compat, so that random host helper programs
thorpej authored
210 BUILDTARGETS+= do-tools-compat
8988beb Be more gcc like in the way we deal with libgcc so that sh3/hppa mill…
skrll authored
211 BUILDTARGETS+= do-lib-csu
f0e2d90 build libgcc early, if at all
drochner authored
212 .if ${MKGCC} != "no"
26b7b01 Provide 'do-libgcc' to build gnu/lib/crtstuff${LIBGCC_EXT} (if necess…
lukem authored
213 BUILDTARGETS+= do-libgcc
f0e2d90 build libgcc early, if at all
drochner authored
214 .endif
881089f Sync with wrstuden-revivesa-base-2.
wrstuden authored
215 .if ${MKPCC} != "no"
216 BUILDTARGET+= do-libpcc
217 .endif
8988beb Be more gcc like in the way we deal with libgcc so that sh3/hppa mill…
skrll authored
218 BUILDTARGETS+= do-lib-libc
76a76a9 Sync w/ -current. 34 merge conflicts to follow.
wrstuden authored
219 BUILDTARGETS+= do-lib do-gnu-lib do-external-lib
881089f Sync with wrstuden-revivesa-base-2.
wrstuden authored
220 BUILDTARGETS+= do-sys-rump-fs-lib
5767649 only build do-lib-libdes if ${MKCRYPTO}!=no
lukem authored
221 BUILDTARGETS+= do-ld.so
222 BUILDTARGETS+= do-build
881089f Sync with wrstuden-revivesa-base-2.
wrstuden authored
223 .if ${MKX11} != "no" || ${MKXORG} != "no"
19423fd Implement do-x11, to run "make build" in ./x11/
lukem authored
224 BUILDTARGETS+= do-x11
225 .endif
431157a all:
lukem authored
226 BUILDTARGETS+= do-obsolete
a7041f0 Put do-make-tools before creating distrib-dirs (as binstall has to be
tv authored
227
69d1160 * Add two new (experimental) targets:
lukem authored
228 #
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
229 # Enforce proper ordering of some rules.
69d1160 * Add two new (experimental) targets:
lukem authored
230 #
c76af6d fix PR#12832: split `make build' up into these steps (from new the
mrg authored
231
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
232 .ORDER: ${BUILDTARGETS}
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
233 includes-lib: .PHONY includes-include includes-sys
234 includes-gnu: .PHONY includes-lib
c76af6d fix PR#12832: split `make build' up into these steps (from new the
mrg authored
235
69d1160 * Add two new (experimental) targets:
lukem authored
236 #
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
237 # Build the system and install into DESTDIR.
69d1160 * Add two new (experimental) targets:
lukem authored
238 #
ae121f5 The final step -- hook src/tools into the main build. If USE_NEW_TOO…
tv authored
239
a9a889a show the start time at the end of the build as well.
lukem authored
240 START_TIME!= date
241
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
242 build: .PHONY .MAKE
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
243 .if defined(BUILD_DONE)
244 @echo "Build already installed into ${DESTDIR}"
245 .else
a9a889a show the start time at the end of the build as well.
lukem authored
246 @echo "Build started at: ${START_TIME}"
5d1bfa2 Work around parallelism lossage, because .ORDER doesn't work yet
tv authored
247 .for tgt in ${BUILDTARGETS}
8993a70 Convert lines of the form
lukem authored
248 ${MAKEDIRTARGET} . ${tgt}
5d1bfa2 Work around parallelism lossage, because .ORDER doesn't work yet
tv authored
249 .endfor
8993a70 Convert lines of the form
lukem authored
250 ${MAKEDIRTARGET} etc install-etc-release
a9a889a show the start time at the end of the build as well.
lukem authored
251 @echo "Build started at: ${START_TIME}"
63eda99 Use printf rather than echo -n, since the former works on all POSIX s…
bjh21 authored
252 @printf "Build finished at: " && date
3acd090 Do not build libgcc 3 times.
mycroft authored
253 .endif
c76af6d fix PR#12832: split `make build' up into these steps (from new the
mrg authored
254
69d1160 * Add two new (experimental) targets:
lukem authored
255 #
fa27277 Add a wrapper for the "distribution" target, similar to the wrapper
thorpej authored
256 # Build a full distribution, but not a release (i.e. no sets into
69d1160 * Add two new (experimental) targets:
lukem authored
257 # ${RELEASEDIR}). "buildworld" enforces a build to ${DESTDIR} != /
258 #
fa27277 Add a wrapper for the "distribution" target, similar to the wrapper
thorpej authored
259
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
260 distribution buildworld: .PHONY .MAKE
364a133 fix DESTDIR checks if !defined(DESTDIR)
lukem authored
261 .if make(buildworld) && \
262 (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
69d1160 * Add two new (experimental) targets:
lukem authored
263 @echo "Won't make ${.TARGET} with DESTDIR=/"
264 @false
265 .endif
8993a70 Convert lines of the form
lukem authored
266 ${MAKEDIRTARGET} . build NOPOSTINSTALL=1
267 ${MAKEDIRTARGET} etc distribution INSTALL_DONE=1
12ac6dc After running the body of the "distribution" target, do a "checkflist…
thorpej authored
268 .if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/"
8993a70 Convert lines of the form
lukem authored
269 ${MAKEDIRTARGET} . postinstall-fix-obsolete
270 ${MAKEDIRTARGET} distrib/sets checkflist
12ac6dc After running the body of the "distribution" target, do a "checkflist…
thorpej authored
271 .endif
092e768 improve previous; show times at end of distribution/release/snapshot …
lukem authored
272 @echo "make ${.TARGET} started at: ${START_TIME}"
cf09c55 print date when make {distribution,release,snapshot} finished
lukem authored
273 @printf "make ${.TARGET} finished at: " && date
fa27277 Add a wrapper for the "distribution" target, similar to the wrapper
thorpej authored
274
69d1160 * Add two new (experimental) targets:
lukem authored
275 #
276 # Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/')
277 # If installing to /, ensures that the host's operating system is NetBSD and
278 # the host's `uname -m` == ${MACHINE}.
279 #
280
281 HOST_UNAME_S!= uname -s
282 HOST_UNAME_M!= uname -m
283
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
284 installworld: .PHONY .MAKE
364a133 fix DESTDIR checks if !defined(DESTDIR)
lukem authored
285 .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
69d1160 * Add two new (experimental) targets:
lukem authored
286 @echo "Can't make ${.TARGET} to DESTDIR=/"
287 @false
288 .endif
289 .if !defined(INSTALLWORLDDIR) || \
290 ${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/"
291 .if (${HOST_UNAME_S} != "NetBSD")
292 @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/"
293 @false
294 .endif
295 .if (${HOST_UNAME_M} != ${MACHINE})
296 @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/"
297 @false
298 .endif
299 .endif
8993a70 Convert lines of the form
lukem authored
300 ${MAKEDIRTARGET} distrib/sets installsets \
301 INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=
302 ${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR}
69d1160 * Add two new (experimental) targets:
lukem authored
303 @echo "make ${.TARGET} started at: ${START_TIME}"
304 @printf "make ${.TARGET} finished at: " && date
305
306 #
b31e270 Add "sourcesets" argument/target, which builds source sets into
lukem authored
307 # Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR
ece364c - Add "sets" top-level Makefile target and build.sh operation.
lukem authored
308 #
309
0934a2e Add a new "syspkgs" target, which simply chains to the "syspkgs" target
apb authored
310 .for tgt in sets sourcesets syspkgs
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
311 ${tgt}: .PHONY .MAKE
8993a70 Convert lines of the form
lukem authored
312 ${MAKEDIRTARGET} distrib/sets ${tgt}
b31e270 Add "sourcesets" argument/target, which builds source sets into
lukem authored
313 .endfor
ece364c - Add "sets" top-level Makefile target and build.sh operation.
lukem authored
314
315 #
4903b14 Modify "release" to invoke "make distribution" instead of "make build",
lukem authored
316 # Build a release or snapshot (implies "make distribution"). Note that
12ac6dc After running the body of the "distribution" target, do a "checkflist…
thorpej authored
317 # in this case, the set lists will be checked before the tar files
318 # are made.
69d1160 * Add two new (experimental) targets:
lukem authored
319 #
c76af6d fix PR#12832: split `make build' up into these steps (from new the
mrg authored
320
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
321 release snapshot: .PHONY .MAKE
4903b14 Modify "release" to invoke "make distribution" instead of "make build",
lukem authored
322 ${MAKEDIRTARGET} . distribution
323 ${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1
092e768 improve previous; show times at end of distribution/release/snapshot …
lukem authored
324 @echo "make ${.TARGET} started at: ${START_TIME}"
cf09c55 print date when make {distribution,release,snapshot} finished
lukem authored
325 @printf "make ${.TARGET} finished at: " && date
c76af6d fix PR#12832: split `make build' up into these steps (from new the
mrg authored
326
69d1160 * Add two new (experimental) targets:
lukem authored
327 #
468bd5d * Add an "iso-image" target in the top level Makefile,
apb authored
328 # Create a CD-ROM image.
329 #
330
331 iso-image: .PHONY
fd7849c Add an iso_image target (iso-image as a target name doesn't play well…
bouyer authored
332 ${MAKEDIRTARGET} distrib iso_image
468bd5d * Add an "iso-image" target in the top level Makefile,
apb authored
333 ${MAKEDIRTARGET} etc iso-image
334 @echo "make ${.TARGET} started at: ${START_TIME}"
335 @printf "make ${.TARGET} finished at: " && date
336
82d4f8d Add an iso-image-source option which does the same thing as iso-image…
jnemeth authored
337 iso-image-source: .PHONY
338 ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true
339 ${MAKEDIRTARGET} etc iso-image
340 @echo "make ${.TARGET} started at: ${START_TIME}"
341 @printf "make ${.TARGET} finished at: " && date
342
468bd5d * Add an "iso-image" target in the top level Makefile,
apb authored
343 #
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
344 # Special components of the "make build" process.
69d1160 * Add two new (experimental) targets:
lukem authored
345 #
c76af6d fix PR#12832: split `make build' up into these steps (from new the
mrg authored
346
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
347 check-tools: .PHONY
b97d965 Consistently check ${TOOLCHAIN_MISSING} against "no".
lukem authored
348 .if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN)
b645c30 * Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
thorpej authored
349 @echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.'
350 @echo '*** May result in a failed build or corrupt binaries!'
351 .elif defined(EXTERNAL_TOOLCHAIN)
352 @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.'
ca06aeb Warn when "make build" is started with USE_NEW_TOOLCHAIN on a platfor…
tv authored
353 .endif
c74b501 Correct BUGS in BUILDING.mdoc now that most ports are USE_NEW_TOOLCHAIN
sommerfeld authored
354 .if defined(NBUILDJOBS)
355 @echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!'
356 .endif
ca06aeb Warn when "make build" is started with USE_NEW_TOOLCHAIN on a platfor…
tv authored
357
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
358 do-distrib-dirs: .PHONY .MAKE
bb154af Add back logic which forces DESTDIR=/ for the distrib-dirs rule if it…
jmc authored
359 .if !defined(DESTDIR) || ${DESTDIR} == ""
8993a70 Convert lines of the form
lukem authored
360 ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/
bb154af Add back logic which forces DESTDIR=/ for the distrib-dirs rule if it…
jmc authored
361 .else
8993a70 Convert lines of the form
lukem authored
362 ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR}
bb154af Add back logic which forces DESTDIR=/ for the distrib-dirs rule if it…
jmc authored
363 .endif
c76af6d fix PR#12832: split `make build' up into these steps (from new the
mrg authored
364
2205992 Add do-{target} aliases for: cleandir obj includes
lukem authored
365 .for targ in cleandir obj includes
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
366 do-${targ}: .PHONY ${targ}
2205992 Add do-{target} aliases for: cleandir obj includes
lukem authored
367 @true
368 .endfor
369
881089f Sync with wrstuden-revivesa-base-2.
wrstuden authored
370 .if defined(HAVE_GCC)
371 BUILD_CC_LIB= gnu/lib/crtstuff${LIBGCC_EXT}
372 BUILD_CC_LIB+= gnu/lib/libgcc${LIBGCC_EXT}
373 .elif defined(HAVE_PCC)
374 BUILD_CC_LIB+= external/bsd/pcc/crtstuff
375 BUILD_CC_LIB+= external/bsd/pcc/libpcc
376 .endif
377
378 .for dir in tools tools/compat lib/csu ${BUILD_CC_LIB} lib/libc lib/libdes lib gnu/lib external/lib sys/rump/fs/lib
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
379 do-${dir:S/\//-/g}: .PHONY .MAKE
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
380 .for targ in dependall install
8993a70 Convert lines of the form
lukem authored
381 ${MAKEDIRTARGET} ${dir} ${targ}
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
382 .endfor
383 .endfor
b9e597f Re-add intermediate dependall/install targets (do-lib-csu, do-lib,
tv authored
384
26b7b01 Provide 'do-libgcc' to build gnu/lib/crtstuff${LIBGCC_EXT} (if necess…
lukem authored
385 do-libgcc: .PHONY .MAKE
881089f Sync with wrstuden-revivesa-base-2.
wrstuden authored
386 .if defined(HAVE_GCC)
26b7b01 Provide 'do-libgcc' to build gnu/lib/crtstuff${LIBGCC_EXT} (if necess…
lukem authored
387 .if ${MKGCC} != "no"
388 .if (${HAVE_GCC} == "3" || ${HAVE_GCC} == "4")
389 ${MAKEDIRTARGET} . do-gnu-lib-crtstuff${LIBGCC_EXT}
390 .endif
391 ${MAKEDIRTARGET} . do-gnu-lib-libgcc${LIBGCC_EXT}
392 .endif
881089f Sync with wrstuden-revivesa-base-2.
wrstuden authored
393 .endif
394
395 do-libpcc: .PHONY .MAKE
396 .if defined(HAVE_PCC)
397 .if ${MKPCC} != "no"
398 ${MAKEDIRTARGET} . do-pcc-lib-crtstuff
399 ${MAKEDIRTARGET} . do-pcc-lib-libpcc
400 .endif
401 .endif
26b7b01 Provide 'do-libgcc' to build gnu/lib/crtstuff${LIBGCC_EXT} (if necess…
lukem authored
402
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
403 do-ld.so: .PHONY .MAKE
1d3f1b5 add "do-ld.elf_so" target, which builds & installs libexec/ld.elf_so.
lukem authored
404 .for targ in dependall install
770f682 MKDYNAMICROOT for a.out
itohy authored
405 .if (${OBJECT_FMT} == "a.out")
8993a70 Convert lines of the form
lukem authored
406 ${MAKEDIRTARGET} libexec/ld.aout_so ${targ}
770f682 MKDYNAMICROOT for a.out
itohy authored
407 .endif
408 .if (${OBJECT_FMT} == "ELF")
8993a70 Convert lines of the form
lukem authored
409 ${MAKEDIRTARGET} libexec/ld.elf_so ${targ}
770f682 MKDYNAMICROOT for a.out
itohy authored
410 .endif
1d3f1b5 add "do-ld.elf_so" target, which builds & installs libexec/ld.elf_so.
lukem authored
411 .endfor
412
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
413 do-build: .PHONY .MAKE
c46e0aa Rather than build in `tools' and `lib' twice, build `tools' and `lib'
tv authored
414 .for targ in dependall install
8993a70 Convert lines of the form
lukem authored
415 ${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no
c46e0aa Rather than build in `tools' and `lib' twice, build `tools' and `lib'
tv authored
416 .endfor
7413e10 add some new targets to DTRT when installing/building
cgd authored
417
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
418 do-x11: .PHONY .MAKE
881089f Sync with wrstuden-revivesa-base-2.
wrstuden authored
419 .if ${MKXORG} != "no"
420 ${MAKEDIRTARGET} external/mit/xorg build
421 .elif ${MKX11} != "no"
8993a70 Convert lines of the form
lukem authored
422 ${MAKEDIRTARGET} x11 build
881089f Sync with wrstuden-revivesa-base-2.
wrstuden authored
423 .else
424 @echo "Neither MKX11 or MKXORG is enabled"
425 @false
426 .endif
19423fd Implement do-x11, to run "make build" in ./x11/
lukem authored
427
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
428 do-obsolete: .PHONY .MAKE
8993a70 Convert lines of the form
lukem authored
429 ${MAKEDIRTARGET} etc install-obsolete-lists
431157a all:
lukem authored
430
69d1160 * Add two new (experimental) targets:
lukem authored
431 #
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
432 # Speedup stubs for some subtrees that don't need to run these rules.
433 # (Tells <bsd.subdir.mk> not to recurse for them.)
69d1160 * Add two new (experimental) targets:
lukem authored
434 #
f03f6b1 Add release and snapshot targets. (They do the same thing.)
cjs authored
435
85a68ff Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
436 .for dir in bin etc distrib games libexec regress sbin usr.sbin tools
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
437 includes-${dir}: .PHONY
85a68ff Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
438 @true
439 .endfor
440 .for dir in etc distrib regress
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
441 install-${dir}: .PHONY
85a68ff Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
442 @true
443 .endfor
444
69d1160 * Add two new (experimental) targets:
lukem authored
445 #
85a68ff Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
446 # XXX this needs to change when distrib Makefiles are recursion compliant
69d1160 * Add two new (experimental) targets:
lukem authored
447 # XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first...
448 #
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
449 dependall-distrib depend-distrib all-distrib: .PHONY
6f15fa2 Use @true instead of @${TRUE} in includes-foo targets, since there is no
nathanw authored
450 @true
8626600 - Remove the include of Makefile.tools; this will be done elsewhere.
tv authored
451
919514d Rename a large chunk of the make(1) variables which refer to a
lukem authored
452 .include <bsd.sys.mk>
4fc1f4e Create an objdir here for storage of timestamps, build-wide data, and so
tv authored
453 .include <bsd.obj.mk>
e496a61 Add "params" target, to display the value of various variables.
lukem authored
454 .include <bsd.kernobj.mk>
79154dd * Always descend into "tools" regardless of USETOOLS setting. Instead,
tv authored
455 .include <bsd.subdir.mk>
45e2272 Add rules for generating plaintext and HTML versions of the "BUILDING"
tv authored
456
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
457 build-docs: .PHONY ${.CURDIR}/BUILDING
60f23ab move BUILDING.mdoc -> doc/BUILDING.mdoc
lukem authored
458 ${.CURDIR}/BUILDING: doc/BUILDING.mdoc
17f2dd7 MAKEVERBOSE support for build-docs
lukem authored
459 ${_MKMSG_CREATE} ${.TARGET}
7645298 redo previous (functionality rollback of 1.213) to retain the style o…
lukem authored
460 ${TOOL_GROFF} -mdoc -Tascii -P-bou $> >$@
e496a61 Add "params" target, to display the value of various variables.
lukem authored
461
462
463 #
464 # Display current make(1) parameters
465 #
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
466 params: .PHONY .MAKE
8993a70 Convert lines of the form
lukem authored
467 ${MAKEDIRTARGET} etc params
Something went wrong with that request. Please try again.