《NetBSD指南-30.7.3.使用build.sh选项》
发表于 : 2010-03-08 3:18
除了环境变量以及 /etc/mk.conf, 编译过程受很多 build.sh 脚本的选项影响, as 我们前面已经看见了无特权(非root)编译, 选择目标构架或者防止编译前删除旧文件。所有这些选项可以通过运行 build.sh -h列出:
如你所见, 你可以重新设定这些选项来改变编译操作。 有些我们已经介绍过了, 你可以根据自己的需要设置其它选项。
代码: 全选
$ cd /usr/src
$ build.sh -h
Usage: build.sh [-EnorUux] [-a arch] [-B buildid] [-D dest] [-j njob]
[-M obj] [-m mach] [-N noisy] [-O obj] [-R release] [-T tools]
[-V var=[value]] [-w wrapper] [-X x11src] [-Z var]
operation [...]
Build operations (all imply "obj" and "tools"):
build Run "make build".
distribution Run "make distribution" (includes DESTDIR/etc/ files).
release Run "make release" (includes kernels and distrib media).
Other operations:
help Show this message and exit.
makewrapper Create nbmake-${MACHINE} wrapper and nbmake.
Always performed.
obj Run "make obj". [Default unless -o is used]
tools Build and install tools.
install=idir Run "make installworld" to `idir' to install all sets
except `etc'. Useful after "distribution" or "release"
kernel=conf Build kernel with config file `conf'
releasekernel=conf Install kernel built by kernel=conf to RELEASEDIR.
sets Create binary sets in RELEASEDIR/MACHINE/binary/sets.
DESTDIR should be populated beforehand.
sourcesets Create source sets in RELEASEDIR/source/sets.
params Display various make(1) parameters.
Options:
-a arch Set MACHINE_ARCH to arch. [Default: deduced from MACHINE]
-B buildId Set BUILDID to buildId.
-D dest Set DESTDIR to dest. [Default: destdir.MACHINE]
-E Set "expert" mode; disables various safety checks.
Should not be used without expert knowledge of the build system.
-j njob Run up to njob jobs in parallel; see make(1) -j.
-M obj Set obj root directory to obj; sets MAKEOBJDIRPREFIX.
Unsets MAKEOBJDIR.
-m mach Set MACHINE to mach; not required if NetBSD native.
-N noisy Set the noisyness (MAKEVERBOSE) level of the build:
0 Quiet
1 Operations are described, commands are suppressed
2 Full output
[Default: 2]
-n Show commands that would be executed, but do not execute them.
-O obj Set obj root directory to obj; sets a MAKEOBJDIR pattern.
Unsets MAKEOBJDIRPREFIX.
-o Set MKOBJDIRS=no; do not create objdirs at start of build.
-R release Set RELEASEDIR to release. [Default: releasedir]
-r Remove contents of TOOLDIR and DESTDIR before building.
-T tools Set TOOLDIR to tools. If unset, and TOOLDIR is not set in
the environment, nbmake will be (re)built unconditionally.
-U Set MKUNPRIVED=yes; build without requiring root privileges,
install from an UNPRIVED build with proper file permissions.
-u Set MKUPDATE=yes; do not run "make clean" first.
Without this, everything is rebuilt, including the tools.
-V v=[val] Set variable `v' to `val'.
-w wrapper Create nbmake script as wrapper.
[Default: ${TOOLDIR}/bin/nbmake-${MACHINE}]
-X x11src Set X11SRCDIR to x11src. [Default: /usr/xsrc]
-x Set MKX11=yes; build X11R6 from X11SRCDIR
-Z v Unset ("zap") variable `v'.