On Thu, 23 Jan 2003, Herb Lewis wrote:

> I did a quick check on the SAMBA_2_2 tree and got the following size
> differences when they were linked against libsmbclient instead of 
> the "normal" linking. I've attached the patch to Makefile.in I used.
> Before running any of the commands you need to make sure you copy
> libsmbclient.so to your library path and create a link to 
> libsmbclient.so.0

While there are size reductions, in my view, this is not the cleanest way 
to do this.

We should think carefully about this. What is happening is the 
libsmbclient.so is pulling in many of the things that are needed by all 
these other commands, so linking against it ignores the libsmbclient entry 
points, but it does save space etc.

A cleaner approach would be to create a smaller base library, and then 
link that dynamically to both libsmbclient and to other things in Samba.
 
> file                    size w/ libsmb    orig size    % orig size
> make_printerdef            23,404          546,980     4.3
> make_smbcodepage           23,060          546,592     4.2
> make_unicodemap            22,844          546,376     4.2
> nmbd                      219,824          982,588     22.4
> nmblookup                  23,240          802,388     2.9
> rpcclient                 716,964        1,479,716     48.5
> smbcacls                  686,612        1,445,176     47.5
> smbclient                 117,848          880,508     13.4
> smbcontrol                 66,644          589,980     11.3
> smbd                    1,698,216        2,411,664     70.4
> smbfilter                  22,648          797,856     2.8
> smbpasswd                 644,552        1,403,212     45.9
> smbsh                      23,164          546,636     4.2
> smbspool                   22,648          801,996     2.8
> smbstatus                  70,736          594,068     11.9
> smbtorture                114,560          877,160     13.1
> swat                      671,892        1,434,552     46.8
> testparm                   22,644          546,224     4.1
> testprns                   42,460          565,828     7.3
> wbinfo                     68,040          591,360     11.5
> winbindd                1,057,968        1,564,856     67.6    
> 
> 

-- 
Regards
-----
Richard Sharpe, rsharpe[at]ns.aus.com, rsharpe[at]samba.org, 
sharpe[at]ethereal.com, http://www.richardsharpe.com
Index: Makefile.in
===================================================================
RCS file: /data/cvs/samba/source/Makefile.in,v
retrieving revision 1.227.2.151
diff -u -r1.227.2.151 Makefile.in
--- Makefile.in 6 Jan 2003 17:59:55 -0000       1.227.2.151
+++ Makefile.in 23 Jan 2003 16:36:35 -0000
@@ -209,9 +209,9 @@
 
 MSDFS_OBJ = msdfs/msdfs.o 
 
-SMBD_OBJ = $(SMBD_OBJ1) $(MSDFS_OBJ) $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) \
+SMBD_OBJ = $(SMBD_OBJ1) $(MSDFS_OBJ) \
            $(RPC_SERVER_OBJ) $(RPC_PARSE_OBJ) $(RPC_CLIENT_OBJ) \
-           $(LOCKING_OBJ) $(PASSDB_OBJ) $(PRINTING_OBJ) $(PROFILE_OBJ) $(LIB_OBJ) \
+           $(LOCKING_OBJ) $(PASSDB_OBJ) $(PRINTING_OBJ) $(PROFILE_OBJ) \
           $(PRINTBACKEND_OBJ) $(QUOTAOBJS) $(OPLOCK_OBJ) $(NOTIFY_OBJ)
 
 
@@ -228,45 +228,33 @@
             nmbd/nmbd_subnetdb.o nmbd/nmbd_winsproxy.o nmbd/nmbd_winsserver.o \
             nmbd/nmbd_workgroupdb.o nmbd/nmbd_synclists.o
 
-NMBD_OBJ = $(NMBD_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) \
-           $(PROFILE_OBJ) $(LIB_OBJ)
+NMBD_OBJ = $(NMBD_OBJ1) $(PROFILE_OBJ)
 
 SWAT_OBJ = web/cgi.o web/diagnose.o web/startstop.o web/statuspage.o \
-           web/swat.o $(PRINTING_OBJ) $(LIBSMB_OBJ) $(LOCKING_OBJ) \
-           $(PARAM_OBJ) $(PASSDB_OBJ) $(RPC_PARSE_OBJ) \
-           $(UBIQX_OBJ) $(LIB_OBJ) 
+           web/swat.o $(PRINTING_OBJ) $(LOCKING_OBJ) \
+           $(PASSDB_OBJ) $(RPC_PARSE_OBJ)
 
-SMBSH_OBJ = smbwrapper/smbsh.o smbwrapper/shared.o \
-            $(PARAM_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
+SMBSH_OBJ = smbwrapper/smbsh.o smbwrapper/shared.o
 
-MAKE_SMBCODEPAGE_OBJ = utils/make_smbcodepage.o $(PARAM_OBJ) \
-                       $(UBIQX_OBJ) $(LIB_OBJ)
+MAKE_SMBCODEPAGE_OBJ = utils/make_smbcodepage.o
 
-MAKE_UNICODEMAP_OBJ = utils/make_unicodemap.o $(PARAM_OBJ) \
-                       $(UBIQX_OBJ) $(LIB_OBJ)
+MAKE_UNICODEMAP_OBJ = utils/make_unicodemap.o
 
-MAKE_PRINTERDEF_OBJ = utils/make_printerdef.o $(PARAM_OBJ) \
-                      $(UBIQX_OBJ) $(LIB_OBJ)
+MAKE_PRINTERDEF_OBJ = utils/make_printerdef.o
 
-STATUS_OBJ = utils/status.o $(LOCKING_OBJ) $(PARAM_OBJ) \
-             $(UBIQX_OBJ) $(PROFILE_OBJ) $(LIB_OBJ)
+STATUS_OBJ = utils/status.o $(LOCKING_OBJ) $(PROFILE_OBJ)
 
-SMBCONTROL_OBJ = utils/smbcontrol.o $(LOCKING_OBJ) $(PARAM_OBJ) \
-             $(UBIQX_OBJ) $(PROFILE_OBJ) $(LIB_OBJ)
+SMBCONTROL_OBJ = utils/smbcontrol.o $(LOCKING_OBJ) $(PROFILE_OBJ)
 
-TESTPARM_OBJ = utils/testparm.o \
-               $(PARAM_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
+TESTPARM_OBJ = utils/testparm.o
 
-TESTPRNS_OBJ = utils/testprns.o $(PARAM_OBJ) $(PRINTING_OBJ) $(UBIQX_OBJ) \
-               $(LIB_OBJ)
+TESTPRNS_OBJ = utils/testprns.o $(PRINTING_OBJ)
 
-SMBPASSWD_OBJ = utils/smbpasswd.o $(PARAM_OBJ) \
-                               $(LIBSMB_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ)\
-                               $(UBIQX_OBJ) $(RPC_CLIENT_OBJ) $(RPC_PARSE_OBJ) 
$(LIB_OBJ) \
+SMBPASSWD_OBJ = utils/smbpasswd.o $(PASSDB_OBJ) $(GROUPDB_OBJ)\
+                               $(RPC_CLIENT_OBJ) $(RPC_PARSE_OBJ) \
                                libsmb/cli_lsarpc.o libsmb/cli_samr.o 
libsmb/cli_pipe_util.o
 
-PDBEDIT_OBJ = utils/pdbedit.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(PASSDB_OBJ) \
-               $(UBIQX_OBJ) $(LIB_OBJ) $(GROUPDB_OBJ)
+PDBEDIT_OBJ = utils/pdbedit.o $(PASSDB_OBJ) $(GROUPDB_OBJ)
 
 RPCCLIENT_OBJ1 = rpcclient/rpcclient.o rpcclient/cmd_lsarpc.o \
                                rpcclient/cmd_samr.o rpcclient/cmd_spoolss.o \
@@ -276,7 +264,6 @@
                                rpcclient/display_sec.o
  
 RPCCLIENT_OBJ = $(RPCCLIENT_OBJ1) \
-                               $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) \
                                $(RPC_PARSE_OBJ) $(PASSDB_OBJ) $(LIBMSRPC_OBJ) \
                                $(READLINE_OBJ)
 
@@ -286,7 +273,7 @@
                smbwrapper/smbw_dir.o smbwrapper/smbw_stat.o \
                smbwrapper/realcalls.o smbwrapper/shared.o \
                $(LIBSMB_OBJ) $(PARAM_OBJ) \
-                $(UBIQX_OBJ) $(LIB_OBJ)
+               $(UBIQX_OBJ) $(LIB_OBJ)
 
 SMBWRAPPER_OBJ = $(SMBW_OBJ) smbwrapper/wrapped.o
 
@@ -294,45 +281,33 @@
                $(PARAM_OBJ) $(UBIQX_OBJ)
 
 CLIENT_OBJ = client/client.o client/clitar.o \
-             $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) \
              $(READLINE_OBJ)
 
-CUPS_OBJ = client/smbspool.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
+CUPS_OBJ = client/smbspool.o
 
-MOUNT_OBJ = client/smbmount.o \
-             $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
+MOUNT_OBJ = client/smbmount.o
 
-MNT_OBJ = client/smbmnt.o \
-             $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
+MNT_OBJ = client/smbmnt.o
 
-UMOUNT_OBJ = client/smbumount.o \
-             $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
+UMOUNT_OBJ = client/smbumount.o
 
-NMBLOOKUP_OBJ = utils/nmblookup.o $(PARAM_OBJ) $(UBIQX_OBJ) \
-                $(LIBSMB_OBJ) $(LIB_OBJ)
+NMBLOOKUP_OBJ = utils/nmblookup.o
 
-SMBTORTURE_OBJ = utils/torture.o utils/nbio.o $(LIBSMB_OBJ) $(PARAM_OBJ) \
-                 $(UBIQX_OBJ) $(LIB_OBJ)
+SMBTORTURE_OBJ = utils/torture.o utils/nbio.o
 
-MASKTEST_OBJ = utils/masktest.o $(LIBSMB_OBJ) $(PARAM_OBJ) \
-                 $(UBIQX_OBJ) $(LIB_OBJ)
+MASKTEST_OBJ = utils/masktest.o
 
-MSGTEST_OBJ = utils/msgtest.o $(LIBSMB_OBJ) $(PARAM_OBJ) \
-                 $(UBIQX_OBJ) $(LIB_OBJ)
+MSGTEST_OBJ = utils/msgtest.o
 
-LOCKTEST_OBJ = utils/locktest.o $(LOCKING_OBJ) $(LIBSMB_OBJ) $(PARAM_OBJ) \
-                 $(UBIQX_OBJ) $(LIB_OBJ)
+LOCKTEST_OBJ = utils/locktest.o $(LOCKING_OBJ)
 
-NSSTEST_OBJ = utils/nsstest.o $(LIBSMB_OBJ) $(PARAM_OBJ) \
-                               $(UBIQX_OBJ) $(LIB_OBJ)
+NSSTEST_OBJ = utils/nsstest.o
 
-SMBCACLS_OBJ = utils/smbcacls.o $(LOCKING_OBJ) $(LIBSMB_OBJ) $(PARAM_OBJ) \
-                               $(UBIQX_OBJ) $(LIB_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_OBJ) 
\
+SMBCACLS_OBJ = utils/smbcacls.o $(LOCKING_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_OBJ) \
                                $(LIBMSRPC_OBJ)
 
 
-LOCKTEST2_OBJ = utils/locktest2.o $(LOCKING_OBJ) $(LIBSMB_OBJ) $(PARAM_OBJ) \
-                 $(UBIQX_OBJ) $(LIB_OBJ)
+LOCKTEST2_OBJ = utils/locktest2.o $(LOCKING_OBJ)
 
 RPCTORTURE_OBJ = utils/rpctorture.o \
              rpcclient/display.o \
@@ -341,17 +316,13 @@
              rpcclient/cmd_samr.o \
              rpcclient/cmd_srvsvc.o \
              rpcclient/cmd_netlogon.o \
-             $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) \
              $(RPC_PARSE_OBJ) $(PASSDB_OBJ)
 
-RPCCHECK_OBJ = utils/rpccheck.o \
-               $(LIB_OBJ)  $(RPC_PARSE_OBJ) \
-               $(UBIQX_OBJ) $(PARAM_OBJ) $(LIBSMB_OBJ)
+RPCCHECK_OBJ = utils/rpccheck.o $(RPC_PARSE_OBJ)
 
 DEBUG2HTML_OBJ = utils/debug2html.o ubiqx/debugparse.o
 
-SMBFILTER_OBJ = utils/smbfilter.o $(LIBSMB_OBJ) $(PARAM_OBJ) \
-                 $(UBIQX_OBJ) $(LIB_OBJ)
+SMBFILTER_OBJ = utils/smbfilter.o
 
 PROTO_OBJ = $(SMBD_OBJ) $(NMBD_OBJ) $(SWAT_OBJ) $(CLIENT_OBJ) \
            $(SMBWRAPPER_OBJ) $(SMBTORTURE_OBJ) $(RPCCLIENT_OBJ1) \
@@ -400,7 +371,6 @@
 
 WINBINDD_OBJ = \
                $(WINBINDD_OBJ1) $(NOPROTO_OBJ) $(PASSDB_OBJ) \
-               $(LIBNMB_OBJ) $(PARAM_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) \
                $(LIBSMB_OBJ) $(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) \
                $(GROUPDB_OBJ) $(PROFILE_OBJ) \
                $(NECESSARY_BECAUSE_SAMBA_DEPENDENCIES_ARE_SO_BROKEN_OBJ)
@@ -508,130 +478,130 @@
          dir=bin $(MAKEDIR); fi
        @: >> $@ || : > $@ # what a fancy emoticon!
 
-bin/smbd: $(SMBD_OBJ) bin/.dummy
+bin/smbd: $(SMBD_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(SMBD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(LDAPLIBS)
+       @$(CC) $(FLAGS) -o $@ $(SMBD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(LDAPLIBS) -L 
+./bin -lsmbclient
 
-bin/nmbd: $(NMBD_OBJ) bin/.dummy
+bin/nmbd: $(NMBD_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(NMBD_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(NMBD_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/swat: $(SWAT_OBJ) bin/.dummy
+bin/swat: $(SWAT_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(LDAPLIBS) 
+       @$(CC) $(FLAGS) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(LDAPLIBS)  -L 
+./bin -lsmbclient
 
-bin/rpcclient: $(RPCCLIENT_OBJ) bin/.dummy
+bin/rpcclient: $(RPCCLIENT_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(RPCCLIENT_OBJ) $(LDFLAGS) $(DYNEXP) $(TERMLDFLAGS) 
$(TERMLIBS) $(LIBS) $(LDAPLIBS)
+       @$(CC) $(FLAGS) -o $@ $(RPCCLIENT_OBJ) $(LDFLAGS) $(DYNEXP) $(TERMLDFLAGS) 
+$(TERMLIBS) $(LIBS) $(LDAPLIBS) -L ./bin -lsmbclient
 
-bin/smbclient: $(CLIENT_OBJ) bin/.dummy
+bin/smbclient: $(CLIENT_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) 
$(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) 
+$(LIBS) -L ./bin -lsmbclient
 
-bin/smbspool: $(CUPS_OBJ) bin/.dummy
+bin/smbspool: $(CUPS_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(CUPS_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(CUPS_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/smbmount: $(MOUNT_OBJ) bin/.dummy
+bin/smbmount: $(MOUNT_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(MOUNT_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(MOUNT_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/smbmnt: $(MNT_OBJ) bin/.dummy
+bin/smbmnt: $(MNT_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(MNT_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(MNT_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/smbumount: $(UMOUNT_OBJ) bin/.dummy
+bin/smbumount: $(UMOUNT_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(UMOUNT_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(UMOUNT_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/testparm: $(TESTPARM_OBJ) bin/.dummy
+bin/testparm: $(TESTPARM_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(TESTPARM_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(TESTPARM_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/testprns: $(TESTPRNS_OBJ) bin/.dummy
+bin/testprns: $(TESTPRNS_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(TESTPRNS_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(TESTPRNS_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/smbstatus: $(STATUS_OBJ) bin/.dummy
+bin/smbstatus: $(STATUS_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(STATUS_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(STATUS_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/smbcontrol: $(SMBCONTROL_OBJ) bin/.dummy
+bin/smbcontrol: $(SMBCONTROL_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(SMBCONTROL_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(SMBCONTROL_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/smbpasswd: $(SMBPASSWD_OBJ) bin/.dummy
+bin/smbpasswd: $(SMBPASSWD_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(SMBPASSWD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(LDAPLIBS)
+       @$(CC) $(FLAGS) -o $@ $(SMBPASSWD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) 
+$(LDAPLIBS) -L ./bin -lsmbclient
 
-bin/pdbedit: $(PDBEDIT_OBJ) bin/.dummy
+bin/pdbedit: $(PDBEDIT_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(PDBEDIT_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(LDAPLIBS)
+       @$(CC) $(FLAGS) -o $@ $(PDBEDIT_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(LDAPLIBS) 
+-L ./bin -lsmbclient
 
-bin/make_smbcodepage: $(MAKE_SMBCODEPAGE_OBJ) bin/.dummy
+bin/make_smbcodepage: $(MAKE_SMBCODEPAGE_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(MAKE_SMBCODEPAGE_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(MAKE_SMBCODEPAGE_OBJ) $(LDFLAGS) $(LIBS) -L ./bin 
+-lsmbclient
 
-bin/make_unicodemap: $(MAKE_UNICODEMAP_OBJ) bin/.dummy
+bin/make_unicodemap: $(MAKE_UNICODEMAP_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(MAKE_UNICODEMAP_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(MAKE_UNICODEMAP_OBJ) $(LDFLAGS) $(LIBS) -L ./bin 
+-lsmbclient
 
-bin/nmblookup: $(NMBLOOKUP_OBJ) bin/.dummy
+bin/nmblookup: $(NMBLOOKUP_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(NMBLOOKUP_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(NMBLOOKUP_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/make_printerdef: $(MAKE_PRINTERDEF_OBJ) bin/.dummy
+bin/make_printerdef: $(MAKE_PRINTERDEF_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(MAKE_PRINTERDEF_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(MAKE_PRINTERDEF_OBJ) $(LDFLAGS) $(LIBS) -L ./bin 
+-lsmbclient
 
-bin/smbtorture: $(SMBTORTURE_OBJ) bin/.dummy
+bin/smbtorture: $(SMBTORTURE_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(SMBTORTURE_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(SMBTORTURE_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/masktest: $(MASKTEST_OBJ) bin/.dummy
+bin/masktest: $(MASKTEST_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(MASKTEST_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(MASKTEST_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/msgtest: $(MSGTEST_OBJ) bin/.dummy
+bin/msgtest: $(MSGTEST_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(MSGTEST_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(MSGTEST_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/smbcacls: $(SMBCACLS_OBJ) bin/.dummy
+bin/smbcacls: $(SMBCACLS_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(SMBCACLS_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(LDAPLIBS)
+       @$(CC) $(FLAGS) -o $@ $(SMBCACLS_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(LDAPLIBS) 
+-L ./bin -lsmbclient
 
-bin/locktest: $(LOCKTEST_OBJ) bin/.dummy
+bin/locktest: $(LOCKTEST_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(LOCKTEST_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(LOCKTEST_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/locktest2: $(LOCKTEST2_OBJ) bin/.dummy
+bin/locktest2: $(LOCKTEST2_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(LOCKTEST2_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(LOCKTEST2_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/nsstest: $(NSSTEST_OBJ) bin/.dummy
+bin/nsstest: $(NSSTEST_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(NSSTEST_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(NSSTEST_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
-bin/rpctorture: $(RPCTORTURE_OBJ) bin/.dummy
+bin/rpctorture: $(RPCTORTURE_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(RPCTORTURE_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(RPCTORTURE_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) -L ./bin 
+-lsmbclient
 
 bin/debug2html: $(DEBUG2HTML_OBJ) bin/.dummy
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(DEBUG2HTML_OBJ) $(LDFLAGS) $(LIBS)
 
-bin/smbfilter: $(SMBFILTER_OBJ) bin/.dummy
+bin/smbfilter: $(SMBFILTER_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(SMBFILTER_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(SMBFILTER_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
 
 bin/smbw_sample: $(SMBW_OBJ) utils/smbw_sample.o bin/.dummy
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBW_OBJ) utils/smbw_sample.o $(LDFLAGS) $(LIBS)
 
-bin/smbsh: $(SMBSH_OBJ) bin/.dummy
+bin/smbsh: $(SMBSH_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(SMBSH_OBJ) $(LDFLAGS) $(LIBS)
+       @$(CC) $(FLAGS) -o $@ $(SMBSH_OBJ) $(LDFLAGS) $(LIBS) -L ./bin -lsmbclient
 
 bin/smbwrapper.@SHLIBEXT@: $(PICOBJS) bin/.dummy
        @echo Linking shared library $@
@@ -645,7 +615,7 @@
 
 bin/libsmbclient.@SHLIBEXT@: $(LIBSMBCLIENT_PICOBJS) bin/.dummy
        @echo Linking libsmbclient shared library $@
-       @$(SHLD) @LDSHFLAGS@ -o $@ $(LIBSMBCLIENT_PICOBJS) $(LDFLAGS) $(LIBS) \
+       @$(SHLD) @LDSHFLAGS@ -o $@ $(LIBSMBCLIENT_PICOBJS) $(LIBS) \
                @SONAMEFLAG@`basename $@`.$(LIBSMBCLIENT_MAJOR)
 
 bin/libsmbclient.a: $(LIBSMBCLIENT_PICOBJS) bin/.dummy
@@ -662,9 +632,9 @@
        @$(SHLD) @LDSHFLAGS@ -o $@ $(NSS_OBJ) -lc \
                @SONAMEFLAG@`basename $@`
 
-bin/winbindd: $(WINBINDD_OBJ) bin/.dummy
+bin/winbindd: $(WINBINDD_OBJ) bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(LINK) -o $@ $(WINBINDD_OBJ) $(DYNEXP) $(LIBS) $(LDAPLIBS)
+       @$(LINK) -o $@ $(WINBINDD_OBJ) $(DYNEXP) $(LIBS) $(LDAPLIBS) -L ./bin 
+-lsmbclient
 
 nsswitch/libns_winbind.so: $(WINBIND_NSS_PICOBJS)
        @echo "Linking $@"
@@ -682,10 +652,9 @@
                @SONAMEFLAG@`basename $@`
 
 bin/wbinfo: $(WBINFO_OBJ) $(PARAM_OBJ) $(LIB_OBJ) $(NOPROTO_OBJ) \
-                       $(UBIQX_OBJ) @BUILD_POPT@ bin/.dummy
+                       $(UBIQX_OBJ) @BUILD_POPT@ bin/.dummy bin/libsmbclient.so
        @echo Linking $@
-       @$(LINK) -o $@ $(WBINFO_OBJ) $(PARAM_OBJ) $(LIB_OBJ) $(NOPROTO_OBJ) \
-               $(UBIQX_OBJ) $(LIBS) @BUILD_POPT@
+       @$(LINK) -o $@ $(WBINFO_OBJ) $(NOPROTO_OBJ) $(LIBS) -L ./bin -lsmbclient 
+@BUILD_POPT@
 
 bin/tdbbackup: $(TDBBACKUP_OBJ) bin/.dummy
        @echo Linking $@

Reply via email to