Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 531 lines (469 sloc) 15.954 kb
f8a95fd PR 49870: pass the xsrc path to postinstall
martin authored
1 # $NetBSD: Makefile,v 1.313 2015/05/03 15:13:13 martin 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
a8ef41d s/is the not root/is not the root/ in a comment - from Snader_LB
abs authored
51 # is not the 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:
0419c95 iso -> images
snj authored
67 # Create CD-ROM image in RELEASEDIR/images.
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:
0419c95 iso -> images
snj authored
71 # Create CD-ROM image with source in RELEASEDIR/images.
82d4f8d Add an iso-image-source option which does the same thing as iso-image…
jnemeth authored
72 # RELEASEDIR must already have been populated by
73 # `make release sourcesets' or equivalent.
b9a53cc Add "live-image" and "install-image" target support to build.sh.
tsutsui authored
74 # live-image:
75 # Create bootable live image for emulators or USB stick etc.
76 # in RELEASEDIR/liveimage.
77 # RELEASEDIR must already have been populated by `make release'
78 # or equivalent.
79 # install-image:
80 # Create bootable installation image for USB stick etc.
81 # in RELEASEDIR/installimage.
82 # RELEASEDIR must already have been populated by `make release'
83 # or equivalent.
c76af6d fix PR#12832: split `make build' up into these steps (from new the
mrg authored
84 #
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
85 # Targets invoked by `make build,' in order:
86 # cleandir: cleans the tree.
5b60ec5 Add a do-top-obj target, which builds the top-level obj directory.
apb authored
87 # do-top-obj: creates the top level object directory.
07f4031 Defer the "make obj" step until after tools are built and installed.
apb authored
88 # do-tools-obj: creates object directories for the host toolchain.
85a68ff Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
89 # do-tools: builds host toolchain.
3317b79 Create a "params" file in the top-level .OBJDIR during "make build".
apb authored
90 # params: record the values of variables that might affect the
91 # build.
07f4031 Defer the "make obj" step until after tools are built and installed.
apb authored
92 # obj: creates object directories.
a7041f0 Put do-make-tools before creating distrib-dirs (as binstall has to be
tv authored
93 # do-distrib-dirs: creates the distribution directories.
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
94 # includes: installs include files.
651e9dc Implement build_install in src/lib/Makefile, which traverses the
joerg authored
95 # do-lib: builds and installs prerequisites from lib
82ead09 - enable 32-bit library builds on amd64 and sparc64
mrg authored
96 # if ${MKCOMPAT} != "no".
651e9dc Implement build_install in src/lib/Makefile, which traverses the
joerg authored
97 # do-compat-lib: builds and installs prerequisites from compat/lib
82ead09 - enable 32-bit library builds on amd64 and sparc64
mrg authored
98 # if ${MKCOMPAT} != "no".
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
99 # do-build: builds and installs the entire system.
4694719 - retire MKXORG from public use
mrg authored
100 # do-x11: builds and installs X11 if ${MKX11} != "no"; either
101 # X11R7 from src/external/mit/xorg if ${X11FLAVOUR} == "Xorg"
102 # or X11R6 from src/x11
358f392 Support "extsrc", externally added programs and libraries. Users can…
uebayasi authored
103 # do-extsrc: builds and installs extsrc if ${MKEXTSRC} != "no".
ed6f193 fix some comments
lukem authored
104 # do-obsolete: installs the obsolete sets (for the postinstall-* targets).
69d1160 * Add two new (experimental) targets:
lukem authored
105 #
448982f pull in bsd.own.mk earlier, to get configuration variables.
cgd authored
106
79154dd * Always descend into "tools" regardless of USETOOLS setting. Instead,
tv authored
107 .if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == ""
108 .MAKEFLAGS: -m ${.CURDIR}/share/mk
109 .endif
110
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 # If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
113 # not be the top level objdir, because "make obj" can happen in the *middle*
114 # of "make build" (long after <bsd.own.mk> is calculated it). So, pre-set
115 # _SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}.
69d1160 * Add two new (experimental) targets:
lukem authored
116 #
9d29a4f If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
tv authored
117 _SRC_TOP_OBJ_=
118
79154dd * Always descend into "tools" regardless of USETOOLS setting. Instead,
tv authored
119 .include <bsd.own.mk>
a445358 change "Id" to "Header" in rcsid, and noted why etc was not in subdirs
cgd authored
120
69d1160 * Add two new (experimental) targets:
lukem authored
121 #
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
122 # Sanity check: make sure that "make build" is not invoked simultaneously
123 # with a standard recursive target.
69d1160 * Add two new (experimental) targets:
lukem authored
124 #
c2e4e20 Fix the rebuild of libgcc:
tv authored
125
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
126 .if make(build) || make(release) || make(snapshot)
127 .for targ in ${TARGETS:Nobj:Ncleandir}
128 .if make(${targ}) && !target(.BEGIN)
129 .BEGIN:
130 @echo 'BUILD ABORTED: "make build" and "make ${targ}" are mutually exclusive.'
131 @false
132 .endif
133 .endfor
046845e Add a 'NBUILDJOBS' variable which control the number of jobs started in
bouyer authored
134 .endif
135
69d1160 * Add two new (experimental) targets:
lukem authored
136 #
5b60ec5 Add a do-top-obj target, which builds the top-level obj directory.
apb authored
137 # _SUBDIR is used to set SUBDIR, after removing directories that have
138 # BUILD_${dir}=no, or that have no ${dir}/Makefile.
69d1160 * Add two new (experimental) targets:
lukem authored
139 #
0946e1f add crypto/external to the build.
christos authored
140 _SUBDIR= tools lib include gnu external crypto/external bin games
141 _SUBDIR+= libexec sbin usr.bin
1e645ce hp700 rescue/ldd fails on -j16 build if usr.bin/ldd/elf32/libldd_elf32.a
joerg authored
142 _SUBDIR+= usr.sbin share sys etc tests compat
143 _SUBDIR+= .WAIT rescue .WAIT distrib regress
e2c2314 make sure include and include/sys are populated before starting to
assar authored
144
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
145 .for dir in ${_SUBDIR}
5b60ec5 Add a do-top-obj target, which builds the top-level obj directory.
apb authored
146 .if "${dir}" == ".WAIT" \
147 || (${BUILD_${dir}:Uyes} != "no" && exists(${dir}/Makefile))
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
148 SUBDIR+= ${dir}
634e8c1 allow builds to work if directory games is missing. Closes pr misc/19…
explorer authored
149 .endif
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
150 .endfor
c330d79 allow toplevel makefile to descend into sys
cgd authored
151
72a7b88 Make regress only if directory exists. It can be optional.
brezak authored
152 .if exists(regress)
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
153 regression-tests: .PHONY .MAKE
7e08344 oops, clean that up a bit
cgd authored
154 @echo Running regression tests...
8993a70 Convert lines of the form
lukem authored
155 ${MAKEDIRTARGET} regress regress
bc33876 if not installing man pages, don't remake whatis db
cgd authored
156 .endif
7413e10 add some new targets to DTRT when installing/building
cgd authored
157
0f2c0be Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was d…
lukem authored
158 .if ${MKUNPRIVED} != "no"
62b3892 Fix what rev. 1.176 broke, in particular, doing a priv'd build into
thorpej authored
159 NOPOSTINSTALL= # defined
160 .endif
161
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
162 afterinstall: .PHONY .MAKE
a0e7536 Add a new target (infodir-meta:) that synthesizes the share/info/dir
perry authored
163 .if ${MKMAN} != "no"
8993a70 Convert lines of the form
lukem authored
164 ${MAKEDIRTARGET} share/man makedb
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
165 .endif
0f2c0be Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was d…
lukem authored
166 .if (${MKUNPRIVED} != "no" && ${MKINFO} != "no")
8993a70 Convert lines of the form
lukem authored
167 ${MAKEDIRTARGET} gnu/usr.bin/texinfo/install-info infodir-meta
a0e7536 Add a new target (infodir-meta:) that synthesizes the share/info/dir
perry authored
168 .endif
62b3892 Fix what rev. 1.176 broke, in particular, doing a priv'd build into
thorpej authored
169 .if !defined(NOPOSTINSTALL)
8993a70 Convert lines of the form
lukem authored
170 ${MAKEDIRTARGET} . postinstall-check
52b0450 In afterinstall, only run postinstall check if DESTDIR == / (or equiv…
lukem authored
171 .endif
6c495ae move postinstall from afterinstall to separate "postinstall-check" ta…
lukem authored
172
b25d9ec Pass -m MACHINE -a MACHINE_ARCH to postinstall
apb authored
173 _POSTINSTALL= ${.CURDIR}/usr.sbin/postinstall/postinstall \
174 -m ${MACHINE} -a ${MACHINE_ARCH}
c35d632 Pass all relevant tool variables to postinstall, not just a subset.
apb authored
175 _POSTINSTALL_ENV= \
176 AWK=${TOOL_AWK:Q} \
177 DB=${TOOL_DB:Q} \
0deacfb Add HOST_SH to _POSTINSTALL_ENV; needed for
apb authored
178 HOST_SH=${HOST_SH:Q} \
c35d632 Pass all relevant tool variables to postinstall, not just a subset.
apb authored
179 MAKE=${MAKE:Q} \
258c8df Pass STAT=${TOOL_STAT:Q} through to postinstall.
apb authored
180 PWD_MKDB=${TOOL_PWD_MKDB:Q} \
632a3ad Pass SED=${TOOL_SED:Q} to postinstall.
apb authored
181 SED=${TOOL_SED:Q} \
258c8df Pass STAT=${TOOL_STAT:Q} through to postinstall.
apb authored
182 STAT=${TOOL_STAT:Q}
c39ab16 use usr.sbin/postinstall/postinstall instead of etc/postinstall
lukem authored
183
f8a95fd PR 49870: pass the xsrc path to postinstall
martin authored
184 .if ${MKX11} != "no"
185 _POSTINSTALL_X11=-x ${X11SRCDIR:Q}
186 .endif
187
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
188 postinstall-check: .PHONY
ff9a5ba run "./etc/postinstall check" in afterinstall:
lukem authored
189 @echo " === Post installation checks ==="
f8a95fd PR 49870: pass the xsrc path to postinstall
martin authored
190 ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi
ff9a5ba run "./etc/postinstall check" in afterinstall:
lukem authored
191 @echo " ================================"
192
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
193 postinstall-fix: .NOTMAIN .PHONY
84bb4a2 we might as well provide a handy "postinstall-fix" target whilst here
lukem authored
194 @echo " === Post installation fixes ==="
f8a95fd PR 49870: pass the xsrc path to postinstall
martin authored
195 ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix
6784880 Add postinstall-fix-obsolete (to invoke "postinstall fix obsolete" -
lukem authored
196 @echo " ==============================="
197
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
198 postinstall-fix-obsolete: .NOTMAIN .PHONY
6784880 Add postinstall-fix-obsolete (to invoke "postinstall fix obsolete" -
lukem authored
199 @echo " === Removing obsolete files ==="
f8a95fd PR 49870: pass the xsrc path to postinstall
martin authored
200 ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete
6784880 Add postinstall-fix-obsolete (to invoke "postinstall fix obsolete" -
lukem authored
201 @echo " ==============================="
84bb4a2 we might as well provide a handy "postinstall-fix" target whilst here
lukem authored
202
6064809 Run "postinstall fix obsolete_stand" just before checkflist,
apb authored
203 postinstall-fix-obsolete_stand: .NOTMAIN .PHONY
204 @echo " === Removing obsolete files ==="
f8a95fd PR 49870: pass the xsrc path to postinstall
martin authored
205 ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete_stand
6064809 Run "postinstall fix obsolete_stand" just before checkflist,
apb authored
206 @echo " ==============================="
207
a0e7536 Add a new target (infodir-meta:) that synthesizes the share/info/dir
perry authored
208
69d1160 * Add two new (experimental) targets:
lukem authored
209 #
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
210 # Targets (in order!) called by "make build".
69d1160 * Add two new (experimental) targets:
lukem authored
211 #
ca06aeb Warn when "make build" is started with USE_NEW_TOOLCHAIN on a platfor…
tv authored
212 BUILDTARGETS+= check-tools
0f2c0be Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was d…
lukem authored
213 .if ${MKUPDATE} == "no" && !defined(NOCLEANDIR)
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
214 BUILDTARGETS+= cleandir
a7041f0 Put do-make-tools before creating distrib-dirs (as binstall has to be
tv authored
215 .endif
5b60ec5 Add a do-top-obj target, which builds the top-level obj directory.
apb authored
216 .if ${MKOBJDIRS} != "no"
217 BUILDTARGETS+= do-top-obj
218 .endif
219 .if ${USETOOLS} == "yes" # {
c2c3d6f Reverse the order of "make cleandir" and "make obj" back to the way they
tv authored
220 .if ${MKOBJDIRS} != "no"
07f4031 Defer the "make obj" step until after tools are built and installed.
apb authored
221 BUILDTARGETS+= do-tools-obj
c2c3d6f Reverse the order of "make cleandir" and "make obj" back to the way they
tv authored
222 .endif
85a68ff Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
223 BUILDTARGETS+= do-tools
5b60ec5 Add a do-top-obj target, which builds the top-level obj directory.
apb authored
224 .endif # USETOOLS # }
3317b79 Create a "params" file in the top-level .OBJDIR during "make build".
apb authored
225 BUILDTARGETS+= params
07f4031 Defer the "make obj" step until after tools are built and installed.
apb authored
226 .if ${MKOBJDIRS} != "no"
227 BUILDTARGETS+= obj
228 .endif
71531eb Make clean_METALOG in distrib/sets early in the build, to ensure that
apb authored
229 BUILDTARGETS+= clean_METALOG
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
230 .if !defined(NODISTRIBDIRS)
231 BUILDTARGETS+= do-distrib-dirs
a7041f0 Put do-make-tools before creating distrib-dirs (as binstall has to be
tv authored
232 .endif
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
233 .if !defined(NOINCLUDES)
234 BUILDTARGETS+= includes
a7041f0 Put do-make-tools before creating distrib-dirs (as binstall has to be
tv authored
235 .endif
4cb28da Remove the do-external-lib and do-gnu-lib targets, along with
plunky authored
236 BUILDTARGETS+= do-lib
651e9dc Implement build_install in src/lib/Makefile, which traverses the
joerg authored
237 BUILDTARGETS+= do-compat-lib
4694719 - retire MKXORG from public use
mrg authored
238 .if ${MKX11} != "no"
19423fd Implement do-x11, to run "make build" in ./x11/
lukem authored
239 BUILDTARGETS+= do-x11
240 .endif
e75c76c Reorganise the way xorg is build. Move build of makestrs into src/tools
joerg authored
241 BUILDTARGETS+= do-build
358f392 Support "extsrc", externally added programs and libraries. Users can…
uebayasi authored
242 .if ${MKEXTSRC} != "no"
243 BUILDTARGETS+= do-extsrc
244 .endif
431157a all:
lukem authored
245 BUILDTARGETS+= do-obsolete
a7041f0 Put do-make-tools before creating distrib-dirs (as binstall has to be
tv authored
246
69d1160 * Add two new (experimental) targets:
lukem authored
247 #
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
248 # Enforce proper ordering of some rules.
69d1160 * Add two new (experimental) targets:
lukem authored
249 #
c76af6d fix PR#12832: split `make build' up into these steps (from new the
mrg authored
250
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
251 .ORDER: ${BUILDTARGETS}
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
252 includes-lib: .PHONY includes-include includes-sys
253 includes-gnu: .PHONY includes-lib
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 #
3317b79 Create a "params" file in the top-level .OBJDIR during "make build".
apb authored
256 # Record the values of variables that might affect the build.
257 # If no values have changed, avoid updating the timestamp
258 # of the params file.
259 #
260 # This is referenced by _NETBSD_VERSION_DEPENDS in <bsd.own.mk>.
261 #
a31e538 Add src/etc/Makefile.params, containing the definition of the
apb authored
262 .include "${NETBSDSRCDIR}/etc/Makefile.params"
3317b79 Create a "params" file in the top-level .OBJDIR during "make build".
apb authored
263 CLEANDIRFILES+= params
264 params: .EXEC
265 ${_MKMSG_CREATE} params
a31e538 Add src/etc/Makefile.params, containing the definition of the
apb authored
266 @${PRINT_PARAMS} >${.TARGET}.new
3317b79 Create a "params" file in the top-level .OBJDIR during "make build".
apb authored
267 @if cmp -s ${.TARGET}.new ${.TARGET} > /dev/null 2>&1; then \
268 : "params is unchanged" ; \
269 rm ${.TARGET}.new ; \
270 else \
271 : "params has changed or is new" ; \
272 mv ${.TARGET}.new ${.TARGET} ; \
273 fi
274
275 #
a31e538 Add src/etc/Makefile.params, containing the definition of the
apb authored
276 # Display current make(1) parameters
277 #
278 show-params: .PHONY .MAKE
279 @${PRINT_PARAMS}
280
281 #
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
282 # Build the system and install into DESTDIR.
69d1160 * Add two new (experimental) targets:
lukem authored
283 #
ae121f5 The final step -- hook src/tools into the main build. If USE_NEW_TOO…
tv authored
284
a9a889a show the start time at the end of the build as well.
lukem authored
285 START_TIME!= date
286
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
287 build: .PHONY .MAKE
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
288 .if defined(BUILD_DONE)
289 @echo "Build already installed into ${DESTDIR}"
290 .else
a9a889a show the start time at the end of the build as well.
lukem authored
291 @echo "Build started at: ${START_TIME}"
5d1bfa2 Work around parallelism lossage, because .ORDER doesn't work yet
tv authored
292 .for tgt in ${BUILDTARGETS}
8993a70 Convert lines of the form
lukem authored
293 ${MAKEDIRTARGET} . ${tgt}
5d1bfa2 Work around parallelism lossage, because .ORDER doesn't work yet
tv authored
294 .endfor
8993a70 Convert lines of the form
lukem authored
295 ${MAKEDIRTARGET} etc install-etc-release
a9a889a show the start time at the end of the build as well.
lukem authored
296 @echo "Build started at: ${START_TIME}"
63eda99 Use printf rather than echo -n, since the former works on all POSIX s…
bjh21 authored
297 @printf "Build finished at: " && date
3acd090 Do not build libgcc 3 times.
mycroft authored
298 .endif
c76af6d fix PR#12832: split `make build' up into these steps (from new the
mrg authored
299
69d1160 * Add two new (experimental) targets:
lukem authored
300 #
fa27277 Add a wrapper for the "distribution" target, similar to the wrapper
thorpej authored
301 # Build a full distribution, but not a release (i.e. no sets into
69d1160 * Add two new (experimental) targets:
lukem authored
302 # ${RELEASEDIR}). "buildworld" enforces a build to ${DESTDIR} != /
303 #
fa27277 Add a wrapper for the "distribution" target, similar to the wrapper
thorpej authored
304
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
305 distribution buildworld: .PHONY .MAKE
364a133 fix DESTDIR checks if !defined(DESTDIR)
lukem authored
306 .if make(buildworld) && \
307 (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
69d1160 * Add two new (experimental) targets:
lukem authored
308 @echo "Won't make ${.TARGET} with DESTDIR=/"
309 @false
310 .endif
8993a70 Convert lines of the form
lukem authored
311 ${MAKEDIRTARGET} . build NOPOSTINSTALL=1
312 ${MAKEDIRTARGET} etc distribution INSTALL_DONE=1
12ac6dc After running the body of the "distribution" target, do a "checkflist…
thorpej authored
313 .if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/"
8993a70 Convert lines of the form
lukem authored
314 ${MAKEDIRTARGET} . postinstall-fix-obsolete
6064809 Run "postinstall fix obsolete_stand" just before checkflist,
apb authored
315 ${MAKEDIRTARGET} . postinstall-fix-obsolete_stand
8993a70 Convert lines of the form
lukem authored
316 ${MAKEDIRTARGET} distrib/sets checkflist
12ac6dc After running the body of the "distribution" target, do a "checkflist…
thorpej authored
317 .endif
092e768 improve previous; show times at end of distribution/release/snapshot …
lukem authored
318 @echo "make ${.TARGET} started at: ${START_TIME}"
cf09c55 print date when make {distribution,release,snapshot} finished
lukem authored
319 @printf "make ${.TARGET} finished at: " && date
fa27277 Add a wrapper for the "distribution" target, similar to the wrapper
thorpej authored
320
69d1160 * Add two new (experimental) targets:
lukem authored
321 #
322 # Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/')
323 # If installing to /, ensures that the host's operating system is NetBSD and
324 # the host's `uname -m` == ${MACHINE}.
325 #
326
327 HOST_UNAME_S!= uname -s
328 HOST_UNAME_M!= uname -m
329
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
330 installworld: .PHONY .MAKE
364a133 fix DESTDIR checks if !defined(DESTDIR)
lukem authored
331 .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
69d1160 * Add two new (experimental) targets:
lukem authored
332 @echo "Can't make ${.TARGET} to DESTDIR=/"
333 @false
334 .endif
335 .if !defined(INSTALLWORLDDIR) || \
336 ${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/"
337 .if (${HOST_UNAME_S} != "NetBSD")
338 @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/"
339 @false
340 .endif
341 .if (${HOST_UNAME_M} != ${MACHINE})
342 @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/"
343 @false
344 .endif
345 .endif
8993a70 Convert lines of the form
lukem authored
346 ${MAKEDIRTARGET} distrib/sets installsets \
1da5d3c Pass down INSTALLSETS variable to installsets target. Use :Q to escape
jym authored
347 INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=${INSTALLSETS:Q}
8993a70 Convert lines of the form
lukem authored
348 ${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR}
69d1160 * Add two new (experimental) targets:
lukem authored
349 @echo "make ${.TARGET} started at: ${START_TIME}"
350 @printf "make ${.TARGET} finished at: " && date
6cc60ff add an installmodules=<dir> command to build.sh
jmcneill authored
351
352 #
353 # Install modules from $DESTDIR to $INSTALLMODULESDIR
354 #
355 installmodules: .PHONY .MAKE
356 .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
357 @echo "Can't make ${.TARGET} to DESTDIR=/"
358 @false
359 .endif
360 .if !defined(INSTALLMODULESDIR) || \
361 ${INSTALLMODULESDIR} == "" || ${INSTALLMODULESDIR} == "/"
362 .if (${HOST_UNAME_S} != "NetBSD")
363 @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLMODULESDIR=/"
364 @false
365 .endif
366 .if (${HOST_UNAME_M} != ${MACHINE})
367 @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLMODULESDIR=/"
368 @false
369 .endif
370 .endif
b88e516 Fix typo that prevented installmodules from working with -U
jmcneill authored
371 ${MAKEDIRTARGET} sys/modules install DESTDIR=${INSTALLMODULESDIR:U/}
6cc60ff add an installmodules=<dir> command to build.sh
jmcneill authored
372 @echo "make ${.TARGET} started at: ${START_TIME}"
373 @printf "make ${.TARGET} finished at: " && date
69d1160 * Add two new (experimental) targets:
lukem authored
374
375 #
b31e270 Add "sourcesets" argument/target, which builds source sets into
lukem authored
376 # Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR
ece364c - Add "sets" top-level Makefile target and build.sh operation.
lukem authored
377 #
378
0934a2e Add a new "syspkgs" target, which simply chains to the "syspkgs" target
apb authored
379 .for tgt in sets sourcesets syspkgs
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
380 ${tgt}: .PHONY .MAKE
8993a70 Convert lines of the form
lukem authored
381 ${MAKEDIRTARGET} distrib/sets ${tgt}
b31e270 Add "sourcesets" argument/target, which builds source sets into
lukem authored
382 .endfor
ece364c - Add "sets" top-level Makefile target and build.sh operation.
lukem authored
383
384 #
4903b14 Modify "release" to invoke "make distribution" instead of "make build",
lukem authored
385 # Build a release or snapshot (implies "make distribution"). Note that
12ac6dc After running the body of the "distribution" target, do a "checkflist…
thorpej authored
386 # in this case, the set lists will be checked before the tar files
387 # are made.
69d1160 * Add two new (experimental) targets:
lukem authored
388 #
c76af6d fix PR#12832: split `make build' up into these steps (from new the
mrg authored
389
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
390 release snapshot: .PHONY .MAKE
4903b14 Modify "release" to invoke "make distribution" instead of "make build",
lukem authored
391 ${MAKEDIRTARGET} . distribution
392 ${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1
092e768 improve previous; show times at end of distribution/release/snapshot …
lukem authored
393 @echo "make ${.TARGET} started at: ${START_TIME}"
cf09c55 print date when make {distribution,release,snapshot} finished
lukem authored
394 @printf "make ${.TARGET} finished at: " && date
c76af6d fix PR#12832: split `make build' up into these steps (from new the
mrg authored
395
69d1160 * Add two new (experimental) targets:
lukem authored
396 #
468bd5d * Add an "iso-image" target in the top level Makefile,
apb authored
397 # Create a CD-ROM image.
398 #
399
400 iso-image: .PHONY
fd7849c Add an iso_image target (iso-image as a target name doesn't play well…
bouyer authored
401 ${MAKEDIRTARGET} distrib iso_image
468bd5d * Add an "iso-image" target in the top level Makefile,
apb authored
402 ${MAKEDIRTARGET} etc iso-image
403 @echo "make ${.TARGET} started at: ${START_TIME}"
404 @printf "make ${.TARGET} finished at: " && date
405
82d4f8d Add an iso-image-source option which does the same thing as iso-image…
jnemeth authored
406 iso-image-source: .PHONY
407 ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true
408 ${MAKEDIRTARGET} etc iso-image
409 @echo "make ${.TARGET} started at: ${START_TIME}"
410 @printf "make ${.TARGET} finished at: " && date
411
468bd5d * Add an "iso-image" target in the top level Makefile,
apb authored
412 #
b9a53cc Add "live-image" and "install-image" target support to build.sh.
tsutsui authored
413 # Create bootable live images.
414 #
415
416 live-image: .PHONY
417 ${MAKEDIRTARGET} etc live-image
418 @echo "make ${.TARGET} started at: ${START_TIME}"
419 @printf "make ${.TARGET} finished at: " && date
420
421 #
422 # Create bootable installation images.
423 #
424
425 install-image: .PHONY
426 ${MAKEDIRTARGET} etc install-image
427 @echo "make ${.TARGET} started at: ${START_TIME}"
428 @printf "make ${.TARGET} finished at: " && date
429
430 #
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
431 # Special components of the "make build" process.
69d1160 * Add two new (experimental) targets:
lukem authored
432 #
c76af6d fix PR#12832: split `make build' up into these steps (from new the
mrg authored
433
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
434 check-tools: .PHONY
b97d965 Consistently check ${TOOLCHAIN_MISSING} against "no".
lukem authored
435 .if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN)
b645c30 * Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
thorpej authored
436 @echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.'
437 @echo '*** May result in a failed build or corrupt binaries!'
438 .elif defined(EXTERNAL_TOOLCHAIN)
439 @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.'
ca06aeb Warn when "make build" is started with USE_NEW_TOOLCHAIN on a platfor…
tv authored
440 .endif
c74b501 Correct BUGS in BUILDING.mdoc now that most ports are USE_NEW_TOOLCHAIN
sommerfeld authored
441 .if defined(NBUILDJOBS)
442 @echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!'
443 .endif
ca06aeb Warn when "make build" is started with USE_NEW_TOOLCHAIN on a platfor…
tv authored
444
71531eb Make clean_METALOG in distrib/sets early in the build, to ensure that
apb authored
445 # Delete or sanitise a leftover METALOG from a previous build.
446 clean_METALOG: .PHONY .MAKE
447 .if ${MKUPDATE} != "no"
448 ${MAKEDIRTARGET} distrib/sets clean_METALOG
449 .endif
450
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
451 do-distrib-dirs: .PHONY .MAKE
bb154af Add back logic which forces DESTDIR=/ for the distrib-dirs rule if it…
jmc authored
452 .if !defined(DESTDIR) || ${DESTDIR} == ""
8993a70 Convert lines of the form
lukem authored
453 ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/
bb154af Add back logic which forces DESTDIR=/ for the distrib-dirs rule if it…
jmc authored
454 .else
8993a70 Convert lines of the form
lukem authored
455 ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR}
bb154af Add back logic which forces DESTDIR=/ for the distrib-dirs rule if it…
jmc authored
456 .endif
c76af6d fix PR#12832: split `make build' up into these steps (from new the
mrg authored
457
2205992 Add do-{target} aliases for: cleandir obj includes
lukem authored
458 .for targ in cleandir obj includes
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
459 do-${targ}: .PHONY ${targ}
2205992 Add do-{target} aliases for: cleandir obj includes
lukem authored
460 @true
461 .endfor
462
f313b93 Move the build_install logic from lib/Makefile into share/mk and re-use
joerg authored
463 do-tools: .PHONY .MAKE
464 ${MAKEDIRTARGET} tools build_install
b9e597f Re-add intermediate dependall/install targets (do-lib-csu, do-lib,
tv authored
465
651e9dc Implement build_install in src/lib/Makefile, which traverses the
joerg authored
466 do-lib: .PHONY .MAKE
467 ${MAKEDIRTARGET} lib build_install
468
469 do-compat-lib: .PHONY .MAKE
470 ${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../lib"
8db3434 adjust the do-compat-* rules now that src/compat/lib and friends no l…
mrg authored
471
5b60ec5 Add a do-top-obj target, which builds the top-level obj directory.
apb authored
472 do-top-obj: .PHONY .MAKE
473 ${MAKEDIRTARGET} . obj NOSUBDIR=
474
07f4031 Defer the "make obj" step until after tools are built and installed.
apb authored
475 do-tools-obj: .PHONY .MAKE
476 ${MAKEDIRTARGET} tools obj
477
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
478 do-build: .PHONY .MAKE
c46e0aa Rather than build in `tools' and `lib' twice, build `tools' and `lib'
tv authored
479 .for targ in dependall install
8993a70 Convert lines of the form
lukem authored
480 ${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no
c46e0aa Rather than build in `tools' and `lib' twice, build `tools' and `lib'
tv authored
481 .endfor
7413e10 add some new targets to DTRT when installing/building
cgd authored
482
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
483 do-x11: .PHONY .MAKE
4694719 - retire MKXORG from public use
mrg authored
484 .if ${MKX11} != "no"
485 .if ${X11FLAVOUR} == "Xorg"
e75c76c Reorganise the way xorg is build. Move build of makestrs into src/tools
joerg authored
486 ${MAKEDIRTARGET} external/mit/xorg/tools all
487 ${MAKEDIRTARGET} external/mit/xorg/lib build_install
4694719 - retire MKXORG from public use
mrg authored
488 .else
8993a70 Convert lines of the form
lukem authored
489 ${MAKEDIRTARGET} x11 build
4694719 - retire MKXORG from public use
mrg authored
490 .endif
a0a02de Improve support for MKXORG!=no to enable builds into external/mit/xorg.
lukem authored
491 .else
4694719 - retire MKXORG from public use
mrg authored
492 @echo "MKX11 is not enabled"
a0a02de Improve support for MKXORG!=no to enable builds into external/mit/xorg.
lukem authored
493 @false
b58283f if MKXORG != no, use external/mit/xorg subdir instead of x11 subdir for
mrg authored
494 .endif
19423fd Implement do-x11, to run "make build" in ./x11/
lukem authored
495
358f392 Support "extsrc", externally added programs and libraries. Users can…
uebayasi authored
496 do-extsrc: .PHONY .MAKE
497 .if ${MKEXTSRC} != "no"
498 ${MAKEDIRTARGET} extsrc build
499 .else
500 @echo "MKEXTSRC is not enabled"
501 @false
502 .endif
503
e636f08 Add .MAKE to all targets that use ${MAKEDIRTARGET} otherwise make closes
dsl authored
504 do-obsolete: .PHONY .MAKE
8993a70 Convert lines of the form
lukem authored
505 ${MAKEDIRTARGET} etc install-obsolete-lists
431157a all:
lukem authored
506
69d1160 * Add two new (experimental) targets:
lukem authored
507 #
c210e5b Overhaul and simplify the top level Makefile, and add some sanity che…
tv authored
508 # Speedup stubs for some subtrees that don't need to run these rules.
509 # (Tells <bsd.subdir.mk> not to recurse for them.)
69d1160 * Add two new (experimental) targets:
lukem authored
510 #
f03f6b1 Add release and snapshot targets. (They do the same thing.)
cjs authored
511
b1a3186 Add usr.bin to the exclude list for make includes.
veego authored
512 .for dir in bin etc distrib games libexec regress sbin usr.bin usr.sbin tools
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
513 includes-${dir}: .PHONY
85a68ff Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
514 @true
515 .endfor
516 .for dir in etc distrib regress
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
517 install-${dir}: .PHONY
85a68ff Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
518 @true
519 .endfor
520
69d1160 * Add two new (experimental) targets:
lukem authored
521 #
85a68ff Major overhaul of src/tools and host toolchain. Summary of changes:
tv authored
522 # XXX this needs to change when distrib Makefiles are recursion compliant
69d1160 * Add two new (experimental) targets:
lukem authored
523 # XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first...
524 #
f1173c1 Apply the .PHONY attribute where appropriate.
lukem authored
525 dependall-distrib depend-distrib all-distrib: .PHONY
6f15fa2 Use @true instead of @${TRUE} in includes-foo targets, since there is no
nathanw authored
526 @true
8626600 - Remove the include of Makefile.tools; this will be done elsewhere.
tv authored
527
4fc1f4e Create an objdir here for storage of timestamps, build-wide data, and so
tv authored
528 .include <bsd.obj.mk>
e496a61 Add "params" target, to display the value of various variables.
lukem authored
529 .include <bsd.kernobj.mk>
79154dd * Always descend into "tools" regardless of USETOOLS setting. Instead,
tv authored
530 .include <bsd.subdir.mk>
Something went wrong with that request. Please try again.