3 # This file and its contents are supplied under the terms of the
4 # Common Development and Distribution License ("CDDL"), version 1.0.
5 # You may only use this file in accordance with the terms of version
8 # A full copy of the text of the CDDL should have accompanied this
9 # source. A copy of the CDDL is also available via the Internet at
10 # http://www.illumos.org/license/CDDL.
14 # Copyright 2014 Nexenta Systems, Inc. All rights reserved.
17 # Use distributed make (dmake) by default.
21 export CLOSED_IS_PRESENT
24 echo "SRC not set. Run 'ws' or 'bldenv' first."
42 *) echo "Huh?" ; exit 1;;
45 ################################################################
48 test -f $SRC/tools
/proto
/root_i386-nd
/opt
/onbld
/bin
/genoffsets ||
49 (cd $SRC/tools
&& $make install)
50 (cd $SRC/common
/mapfiles
; $make install)
54 (cd $SRC/tools
&& $make clobber
)
55 (cd $SRC/common
/mapfiles
; $make clobber
)
58 ################################################################
63 if [ "$targ" = clobber
]
65 (cd $SRC/uts
&& $make -k clobber_h
)
66 (cd $SRC/head && $make clobber
)
69 if [ "$targ" = install ]
73 # Just the parts of "make sgs" we need, and
74 # skip them if they appear to be done.
75 # ... stuff under $SRC
76 test -f $SRC/uts
/common
/sys
/priv_names.h ||
77 (cd $SRC/uts
&& $make -k all_h
)
79 test -f $SRC/head
/rpcsvc
/nispasswd.h ||
80 (cd $SRC/head && $make -k install_h
)
82 # ... stuff under $ROOT (proto area)
83 test -d $ROOT/usr
/include
/sys ||
84 (cd $SRC && $make rootdirs
)
85 test -f $ROOT/usr
/include
/sys
/types.h ||
86 (cd $SRC/uts
&& $make -k install_h
)
87 test -f $ROOT/usr
/include
/rpcsvc
/daemon_utils.h ||
88 (cd $SRC/head && $make install_h
)
90 # always update the sys headers to be safe
91 (cd $SRC/uts
/common
/sys
&& $make -k install_h
)
95 # Need some library headers too...
113 (cd $SRC/lib
/$lib && $make $targ)
115 # Should fix the Makefile here so all_h or install_h works.
116 (cd $SRC/lib
/libzpool
/$cpu && $make ..
/common
/zfs.h
)
119 ################################################################
123 lint
) targ
=modlintlib
;;
126 (cd $SRC/uts
/$x/zfs
&& $make $targ)
129 ################################################################
131 # Build all libraries used by the other targets in here.
133 # Run this once (at least) in each new workspace where you
134 # will run "make-zfs install", if you want to avoid linking
135 # against the libraries from your build host.
139 # install all the lib headers
140 if [ "$1" = install ] ; then
141 (cd $SRC/lib
&& $make install_h
)
144 # Wow, building libc takes a while. Really want that?
165 (cd $SRC/lib
/$lib && $make $1)
169 ################################################################
183 (cd $SRC/lib
/$lib && $make $1)
185 (cd $SRC/lib
/libshare
&& $make $1 PLUGINS
=)
188 ################################################################
205 (cd $SRC/cmd
/$cmd && $make $1)
210 # mount programs need fslib.o
211 (cd $SRC/cmd
/fs.d
/zfs
&& $make $1)
212 # Build just the ZFS devfsadm module
213 (cd $SRC/cmd
/devfsadm
/$cpu && $make SUNW_zfs_link.so \
214 ${ROOT}/usr
/lib
/devfsadm
/linkmod \
215 ${ROOT}/usr
/lib
/devfsadm
/linkmod
/SUNW_zfs_link.so
)
218 (cd $SRC/cmd
/fs.d
/zfs
&& $make clobber
)
219 (cd $SRC/cmd
/fs.d
&& $make ${1}_local
)
220 (cd $SRC/cmd
/devfsadm
&& $make $1)
224 (cd $SRC/cmd
/syseventd
/modules
/zfs_mod
&& $make $1)
226 # Build the MDB modules, WITH the linktest
227 (cd $SRC/cmd
/mdb
/tools
&& $make $1)
232 (cd $SRC/cmd
/mdb
/$x/$a/kmdb
&&
233 $make kmdb_modlinktest.o
)
236 (cd $SRC/cmd
/mdb
/$x/$a/kmdb
&&
241 (cd $SRC/cmd
/mdb
/$x/$a/zfs
&&
242 $make $1 KMDB_LINKTEST_ENABLE
= )
244 (cd $SRC/cmd
/mdb
/$x/$a/libzpool
&&
250 ################################################################
256 (cd $SRC/man
/man1m
&& make \
257 $ROOT/usr
/share
/man
/man1m
/zdb
.1m \
258 $ROOT/usr
/share
/man
/man1m
/zfs
.1m \
259 $ROOT/usr
/share
/man
/man1m
/zpool
.1m
)
260 (cd $SRC/man
/man5
&& make \
261 $ROOT/usr
/share
/man
/man
5/zpool-features
.5 )
264 (cd $SRC/man
/man1m
&& make zdb
.1m.check zfs
.1m.check zpool
.1m.check
)
265 (cd $SRC/man
/man5
&& make zpool-features
.5.check
)
268 (cd $SRC/man
/man1m
&& make $1)
269 (cd $SRC/man
/man5
&& make $
)
274 ################################################################
275 # This builds $SRC/TAGS (and cscope.files) in a helpful order.
279 find uts
/common
/sys
-name '*.[ch]' -print |
sort
280 find uts
/common
/fs
/zfs
-name '*.[ch]' -print |
sort
281 find lib
/libzpool
-name '*.[ch]' -print |
sort
282 find lib
/libzfs
-name '*.[ch]' -print |
sort
283 find cmd
/zpool
-name '*.[ch]' -print |
sort
284 find cmd
/zfs
-name '*.[ch]' -print |
sort
285 find cmd
/zdb
-name '*.[ch]' -print |
sort
286 find cmd
/zhack
-name '*.[ch]' -print |
sort
287 find cmd
/zinject
-name '*.[ch]' -print |
sort
288 find cmd
/ztest
-name '*.[ch]' -print |
sort
289 find common
/zfs
-name '*.[ch]' -print |
sort
290 echo cmd
/mdb
/common
/modules
/zfs
/zfs.c
291 ) > $SRC/cscope.files
294 exctags
-e --langmap=c
:+.ndl
-h ndl
-L - < cscope.files
298 ################################################################
299 # This creates a tarfile one can use to update a test machine.
302 git_rev
=`git rev-parse --short=8 HEAD`
304 kernel/drv/$arch64/zfs
306 kernel/fs/$arch64/zfs
308 kernel/kmdb/$arch64/zfs
310 lib/$arch64/libzfs.so.1
311 lib/$arch64/libzfs_core.so.1
314 usr/bin/$arch32/ztest
315 usr/bin/$arch64/ztest
316 usr/lib/$arch64/libzfs_jni.so.1
317 usr/lib/$arch64/libzpool.so.1
318 usr/lib/devfsadm/linkmod/SUNW_zfs_link.so
319 usr/lib/fs/zfs/bootinstall
320 usr/lib/fs/zfs/fstyp.so.1
321 usr/lib/libzfs_jni.so.1
322 usr/lib/libzpool.so.1
323 usr/lib/mdb/kvm/$arch64/zfs.so
324 usr/lib/mdb/kvm/zfs.so
325 usr/lib/mdb/proc/$arch64/libzpool.so
326 usr/lib/mdb/proc/libzpool.so
329 usr/lib/sysevent/modules/zfs_mod.so
330 usr/lib/zfs/availdevs
332 usr/lib/zfs/pyzfs.pyc
335 usr/sbin/$arch32/zhack
336 usr/sbin/$arch64/zhack
337 usr/sbin/$arch32/zinject
338 usr/sbin/$arch64/zinject
340 usr/share/man/man1m/zdb.1m
341 usr/share/man/man1m/zfs.1m
342 usr/share/man/man1m/zpool.1m
343 usr/share/man/man5/zpool-features.5
345 (cd $ROOT && tar cfj ..
/..
/zfs-
${git_rev}.
tar.bz2
$files)
348 ################################################################
350 if [ "$1" = "" ]; then
351 set '?' # force usage
401 echo "Usage: $0 {install|lint|clean|clobber|deplibs|tags|tar}";