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
23 export SOURCEDEBUG
=yes
26 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 smbsrv headers to be safe
91 # test -f $ROOT/usr/include/smbsrv/wintypes.h ||
92 (cd $SRC/uts
/common
/sys
&& $make -k install_h
)
93 (cd $SRC/uts
/common
/smb
&& $make -k install_h
)
94 (cd $SRC/uts
/common
/smbsrv
&& $make -k install_h
)
98 # Need some library headers too...
116 (cd $SRC/lib
/$lib && $make $targ)
120 ################################################################
124 lint
) targ
=modlintlib
;;
127 ( unset SOURCEDEBUG
;
128 (cd $SRC/uts
/$x/nsmb
&& $make $targ) ;
129 (cd $SRC/uts
/$x/smbfs
&& $make $targ) ;
130 (cd $SRC/uts
/$x/smbsrv
&& $make $targ) )
133 ################################################################
135 # Note lib1 builds prerequisite libraries not delivered by the
136 # tar file we create below. To accelerate clean/install, we
137 # skip these on clean (but still nuke them for clobber)
147 (cd $SRC/lib
/$lib && $make $1)
151 # lib2 builds stuff we include in the tar file,
152 # or that we don't mind rebuilding after clean.
160 (cd $SRC/lib
/$lib && $make $1)
163 (cd $SRC/lib
/libshare
&& $make $1 PLUGINS
=smb
)
164 (cd $SRC/lib
/smbsrv
&& $make $1)
165 (cd $SRC/lib
/passwdutil
&& $make $1)
166 (cd $SRC/lib
/pam_modules
/smb
&& $make $1)
170 ################################################################
176 # mount programs need fslib.o
177 (cd $SRC/cmd
/fs.d
&& $make fslib.o
)
178 (cd $SRC/cmd
/fs.d
/smbclnt
&& $make $1 catalog
)
181 (cd $SRC/cmd
/fs.d
/smbclnt
&& $make $1)
182 (cd $SRC/cmd
/fs.d
&& $make ${1}_local
)
186 (cd $SRC/cmd
/devfsadm
&& $make $1)
187 (cd $SRC/cmd
/smbsrv
&& $make $1)
189 # Build the MDB modules, WITH the linktest
190 (cd $SRC/cmd
/mdb
/tools
&& $make $1)
195 (cd $SRC/cmd
/mdb
/$x/$a/kmdb
&&
196 $make kmdb_modlinktest.o
)
199 (cd $SRC/cmd
/mdb
/$x/$a/kmdb
&&
204 (cd $SRC/cmd
/mdb
/$x/$a/nsmb
&&
205 $make $1 KMDB_LINKTEST_ENABLE
= )
206 (cd $SRC/cmd
/mdb
/$x/$a/smbfs
&&
207 $make $1 KMDB_LINKTEST_ENABLE
= )
208 (cd $SRC/cmd
/mdb
/$x/$a/smbsrv
&&
209 $make $1 KMDB_LINKTEST_ENABLE
= )
210 (cd $SRC/cmd
/mdb
/$x/$a/libfksmbsrv
&&
211 $make $1 KMDB_LINKTEST_ENABLE
= )
213 # We build these libraries (to the proto area), so we need to
214 # build the mdb modules too so mdb will load them.
215 (cd $SRC/cmd
/mdb
/$x/$a/libcmdutils
&&
217 (cd $SRC/cmd
/mdb
/$x/$a/libavl
&&
222 (cd $SRC/cmd
/Adm
/sun
&& $make $1)
224 # Deal with mode 0400 file annoyance...
225 # See usr/src/cmd/Adm/sun/Makefile
226 if [ $1 = install ]; then
227 chmod a
+r
$ROOT/var
/smb
/smbpasswd
232 ################################################################
233 # This builds $SRC/TAGS (and cscope.files) in a helpful order.
237 find uts
/common
/sys
-name '*.[ch]' -print |
sort
238 find uts
/common
/net
-name '*.[ch]' -print |
sort
239 find uts
/common
/netinet
-name '*.[ch]' -print |
sort
240 find uts
/common
/smb
-name '*.[ch]' -print |
sort
241 find uts
/common
/smbsrv
-name '*.ndl' -print |
sort
242 find uts
/common
/smbsrv
-name '*.[ch]' -print |
sort
243 find uts
/common
/fs
/smbsrv
-name '*.[ch]' -print |
sort
244 find lib
/libsmbfs
-name '*.[ch]' -print |
sort
245 find lib
/smbsrv
-name '*.[ch]' -print |
sort
246 find cmd
/smbsrv
-name '*.[ch]' -print |
sort
247 find common
/smbsrv
-name '*.[ch]' -print |
sort
248 ) > $SRC/cscope.files
251 exctags
-e --langmap=c
:+.ndl
-h ndl
-L - < cscope.files
255 ################################################################
256 # This creates a tarfile one can use to update a test machine.
260 usr/kernel/drv/$arch64/smbsrv
261 usr/kernel/drv/smbsrv
262 usr/kernel/kmdb/$arch64/smbsrv
263 usr/kernel/kmdb/smbsrv
264 usr/lib/fs/smb/$arch64/libshare_smb.so.1
265 usr/lib/fs/smb/libshare_smb.so.1
266 usr/lib/libsmbfs.so.1
267 usr/lib/mdb/kvm/$arch64/smbsrv.so
268 usr/lib/mdb/kvm/smbsrv.so
269 usr/lib/reparse/libreparse_smb.so.1
270 usr/lib/security/pam_smb_passwd.so.1
271 usr/lib/smbsrv/libmlrpc.so.1
272 usr/lib/smbsrv/libmlsvc.so.1
273 usr/lib/smbsrv/libsmb.so.1
274 usr/lib/smbsrv/libsmbns.so.1
281 (cd $ROOT && tar cfj ..
/..
/smbsrv.
tar.bz2
$files)
284 ################################################################
286 if [ "$1" = "" ]; then
287 set '?' # force usage
311 # intentionally skip: lib1, hdrs, tools
331 echo "Usage: $0 {install|lint|clean|clobber|tags|tar}";