Do satyr work against a copy of the build farm scripts so as not to
[ira/wip.git] / source3 / Makefile.in
index 4bced02721c744f63e1dbd1686e404436f7e6c9a..bc6517ebc261c6d587893b3cef00e50825866229 100644 (file)
@@ -1,6 +1,7 @@
 ###########################################################################
 # Makefile.in for Samba - rewritten for autoconf support
 # Copyright Andrew Tridgell 1992-1998
+# Copyright (C) 2001 by Martin Pool <mbp@samba.org>
 ###########################################################################
 
 prefix=@prefix@
@@ -28,6 +29,13 @@ srcdir=@srcdir@
 builddir=@builddir@
 SHELL=/bin/sh
 
+# XXX: Perhaps this should be @SHELL@ instead -- apparently autoconf
+# will search for a POSIX-compliant shell, and that might not be
+# /bin/sh on some platforms.  I guess it's not a big problem -- mbp
+
+# See the autoconf manual "Installation Directory Variables" for a
+# discussion of thesubtle use of these variables.
+
 BASEDIR= @prefix@
 BINDIR = @bindir@
 # sbindir is mapped to bindir when compiling SAMBA in 2.0.x compatibility mode.
@@ -61,14 +69,20 @@ LOCKDIR = @lockdir@
 # man pages language(s)
 man_langs = "@manlangs@"
 
+FLAGS1 = $(CFLAGS) -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper $(CPPFLAGS) -I. -I$(srcdir)
+FLAGS2 = 
+FLAGS3 = 
+FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4)
+FLAGS  = $(ISA) $(FLAGS5) 
+FLAGS32  = $(ISA32) $(FLAGS5)
+
 PASSWD_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" -DPRIVATE_DIR=\"$(PRIVATE_DIR)\"
-FLAGS1 = $(CFLAGS) -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper $(CPPFLAGS) -DLOGFILEBASE=\"$(LOGFILEBASE)\"
-FLAGS2 = -DCONFIGFILE=\"$(CONFIGFILE)\" -DLMHOSTSFILE=\"$(LMHOSTSFILE)\" 
-FLAGS3 = -DSWATDIR=\"$(SWATDIR)\" -DSBINDIR=\"$(SBINDIR)\" -DLOCKDIR=\"$(LOCKDIR)\"
-FLAGS4 = -DDRIVERFILE=\"$(DRIVERFILE)\" -DBINDIR=\"$(BINDIR)\" -DFORMSFILE=\"$(FORMSFILE)\" -DNTDRIVERSDIR=\"$(NTDRIVERSDIR)\" -DLIBDIR=\"$(LIBDIR)\"
-FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4) -DHAVE_INCLUDES_H 
-FLAGS  = $(ISA) $(FLAGS5) $(PASSWD_FLAGS)
-FLAGS32  = $(ISA32) $(FLAGS5) $(PASSWD_FLAGS)
+PATH_FLAGS1 = -DCONFIGFILE=\"$(CONFIGFILE)\"  -DSBINDIR=\"$(SBINDIR)\"
+PATH_FLAGS2 = $(PATH_FLAGS1) -DBINDIR=\"$(BINDIR)\" -DDRIVERFILE=\"$(DRIVERFILE)\" 
+PATH_FLAGS3 = $(PATH_FLAGS2) -DLMHOSTSFILE=\"$(LMHOSTSFILE)\" 
+PATH_FLAGS4 = $(PATH_FLAGS3) -DSWATDIR=\"$(SWATDIR)\"  -DLOCKDIR=\"$(LOCKDIR)\"
+PATH_FLAGS5 = $(PATH_FLAGS4) -DLIBDIR=\"$(LIBDIR)\" -DLOGFILEBASE=\"$(LOGFILEBASE)\"
+PATH_FLAGS = $(PATH_FLAGS5) $(PASSWD_FLAGS)
 
 WINBIND_PROGS = bin/wbinfo
 WINBIND_SPROGS = bin/winbindd
@@ -108,14 +122,14 @@ LIB_OBJ = lib/charcnv.o lib/debug.o lib/fault.o \
          lib/ms_fnmatch.o lib/select.o lib/error.o lib/messages.o \
          lib/md5.o lib/hmacmd5.o lib/iconv.o lib/smbpasswd.o \
          nsswitch/wb_client.o nsswitch/wb_common.o \
-         intl/lang_tdb.o $(TDB_OBJ)
+         intl/lang_tdb.o $(TDB_OBJ) 
 
 READLINE_OBJ = lib/readline.o
 
 UBIQX_OBJ = ubiqx/ubi_BinTree.o ubiqx/ubi_Cache.o ubiqx/ubi_SplayTree.o \
             ubiqx/ubi_dLinkList.o ubiqx/ubi_sLinkList.o ubiqx/debugparse.o
 
-PARAM_OBJ = param/loadparm.o param/params.o
+PARAM_OBJ = param/loadparm.o param/params.o dynconfig.o
 
 LIBSMB_OBJ = libsmb/clientgen.o libsmb/cliconnect.o libsmb/clifile.o \
             libsmb/clikrb5.o libsmb/clispnego.o libsmb/asn1.o \
@@ -133,6 +147,8 @@ LIBMSRPC_OBJ = libsmb/cli_lsarpc.o libsmb/cli_samr.o libsmb/cli_spoolss.o \
               libsmb/cli_reg.o \
               rpc_client/cli_pipe.o libsmb/cli_pipe_util.o
 
+LIBMSRPC_PICOBJ = $(LIBMSRPC_OBJ:.o=.po)
+
 RPC_SERVER_OBJ = rpc_server/srv_lsa.o rpc_server/srv_lsa_nt.o \
                  rpc_server/srv_lsa_hnd.o rpc_server/srv_netlog.o rpc_server/srv_netlog_nt.o \
                  rpc_server/srv_pipe_hnd.o rpc_server/srv_reg.o rpc_server/srv_reg_nt.o \
@@ -151,15 +167,12 @@ RPC_PARSE_OBJ = rpc_parse/parse_lsa.o rpc_parse/parse_net.o \
                 rpc_parse/parse_reg.o rpc_parse/parse_rpc.o \
                 rpc_parse/parse_samr.o rpc_parse/parse_srv.o \
                 rpc_parse/parse_wks.o \
-               rpc_parse/parse_spoolss.o rpc_parse/parse_dfs.o \
-               rpc_parse/parse_creds.o
+               rpc_parse/parse_spoolss.o rpc_parse/parse_dfs.o
 
 
 RPC_CLIENT_OBJ = rpc_client/cli_netlogon.o rpc_client/cli_pipe.o \
-               rpc_client/cli_lsarpc.o rpc_client/cli_connect.o \
-               rpc_client/cli_use.o rpc_client/cli_login.o \
-               rpc_client/cli_spoolss_notify.o rpc_client/ncacn_np_use.o \
-               lib/util_list.o rpc_client/cli_trust.o 
+       rpc_client/cli_login.o rpc_client/cli_trust.o \
+       rpc_client/cli_spoolss_notify.o
 
 LOCKING_OBJ = locking/locking.o locking/brlock.o locking/posix.o
 
@@ -398,8 +411,8 @@ WINBINDD_OBJ1 = \
                nsswitch/winbindd_cm.o
 
 NECESSARY_BECAUSE_SAMBA_DEPENDENCIES_ARE_SO_BROKEN_OBJ = \
-               libsmb/domain_client_validate.o smbd/auth_util.o \
-               rpc_client/cli_netlogon.o rpc_client/cli_login.o
+               rpc_client/cli_netlogon.o rpc_client/cli_login.o \
+               smbd/auth_util.o
 
 WINBINDD_OBJ = \
                $(WINBINDD_OBJ1) $(NOPROTO_OBJ) $(PASSDB_OBJ) \
@@ -420,38 +433,38 @@ POPT_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
 ######################################################################
 # now the rules...
 ######################################################################
-all : CHECK include/proto.h $(SPROGS) $(PROGS) $(SHLIBS) nsswitch
+all : SHOWFLAGS include/proto.h $(SPROGS) $(PROGS) $(SHLIBS) nsswitch
 
-pam_smbpass : CHECK bin/pam_smbpass.@SHLIBEXT@
+pam_smbpass : SHOWFLAGS bin/pam_smbpass.@SHLIBEXT@
 
-smbwrapper : CHECK bin/smbsh bin/smbwrapper.@SHLIBEXT@ @WRAP32@
+smbwrapper : SHOWFLAGS bin/smbsh bin/smbwrapper.@SHLIBEXT@ @WRAP32@
 
-torture : CHECK $(TORTURE_PROGS)
+torture : SHOWFLAGS $(TORTURE_PROGS)
 
-smbtorture : CHECK bin/smbtorture
+smbtorture : SHOWFLAGS bin/smbtorture
 
-masktest : CHECK bin/masktest
+masktest : SHOWFLAGS bin/masktest
 
-msgtest : CHECK bin/msgtest
+msgtest : SHOWFLAGS bin/msgtest
 
-locktest : CHECK bin/locktest
+locktest : SHOWFLAGS bin/locktest
 
-smbcacls : CHECK bin/smbcacls
+smbcacls : SHOWFLAGS bin/smbcacls
 
-locktest2 : CHECK bin/locktest2
+locktest2 : SHOWFLAGS bin/locktest2
 
-rpctorture : CHECK bin/rpctorture
+rpctorture : SHOWFLAGS bin/rpctorture
 
-debug2html : CHECK bin/debug2html
+debug2html : SHOWFLAGS bin/debug2html
 
-smbfilter : CHECK bin/smbfilter
+smbfilter : SHOWFLAGS bin/smbfilter
 
-nsswitch : CHECK @WINBIND_TARGETS@ @WINBIND_STARGETS@ @WINBIND_LTARGETS@
+nsswitch : SHOWFLAGS @WINBIND_TARGETS@ @WINBIND_STARGETS@ @WINBIND_LTARGETS@
 
 .SUFFIXES:
 .SUFFIXES: .c .o .po .po32 .lo
 
-CHECK:
+SHOWFLAGS:
        @echo "Using FLAGS = $(FLAGS)"
        @echo "Using FLAGS32 = $(FLAGS32)"
        @echo "Using LIBS = $(LIBS)"
@@ -472,6 +485,24 @@ MAKEDIR = || exec false; \
          -o $@ 
 @BROKEN_CC@    -mv `echo $@ | sed 's%^.*/%%g'` $@
 
+# These dependencies are only approximately correct: we want to make
+# sure Samba's paths are updated if ./configure is re-run.  Really it
+# would be nice if "make prefix=/opt/samba all" also rebuilt things,
+# but since we also require "make install prefix=/opt/samba" *not* to
+# rebuild it's a bit hard.
+
+dynconfig.o: dynconfig.c Makefile
+       @echo Compiling $*.c
+       @$(CC) $(FLAGS) $(PATH_FLAGS) -c $< -o $@ 
+
+dynconfig.po: dynconfig.c Makefile
+       @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
+         dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
+       @echo Compiling $*.c with @PICFLAG@
+       @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) @PICFLAG@ -c $< -o $*.@PICSUFFIX@
+@BROKEN_CC@    -mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.po$$%.o%'` $@
+@POBAD_CC@     @mv $*.po.o $@
+
 .c.po: 
        @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
          dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
@@ -667,6 +698,13 @@ bin/pam_smbpass.@SHLIBEXT@: $(PAM_SMBPASS_PICOOBJ)
        @echo "Linking shared library $@"
        $(LD) $(LDSHFLAGS) -symbolic -o $@ $(PAM_SMBPASS_PICOOBJ) -lpam $(LIBS) -lc
 
+bin/libmsrpc.a: $(LIBMSRPC_PICOBJ)
+       -$(AR) -rc $@ $(LIBMSRPC_PICOBJ) 
+
+bin/spamsync: rpcclient/samsync.o bin/libmsrpc.a
+       @$(LINK) -o $@ rpcclient/samsync.o bin/libmsrpc.a \
+               $(UBIQX_OBJ) $(LIBS)
+
 install: installbin installman installscripts installswat 
 
 installdirs:
@@ -699,6 +737,18 @@ revert:
 installman:
        @$(SHELL) $(srcdir)/script/installman.sh $(MANDIR) $(srcdir) $(man_langs) "@ROFF@"
 
+.PHONY: showlayout
+
+showlayout: 
+       @echo "Samba will be installed into:"
+       @echo "  basedir: $(BASEDIR)"
+       @echo "  bindir:  $(BINDIR)"
+       @echo "  sbindir: $(SBINDIR)"
+       @echo "  libdir:  $(LIBDIR)"
+       @echo "  vardir:  $(VARDIR)"
+       @echo "  mandir:  $(MANDIR)"
+
+
 uninstall: uninstallman uninstallbin uninstallscripts
 
 uninstallman:
@@ -711,7 +761,7 @@ uninstallbin:
 uninstallscripts:
        @$(SHELL) $(srcdir)/script/uninstallscripts.sh $(INSTALLPERMS) $(BINDIR) $(SCRIPTS)
 
-clean: 
+clean: delheaders
        -rm -f core */*~ *~ */*.o */*.po */*.po32 */*.@SHLIBEXT@ $(PROGS) $(SPROGS) 
 
 winbindd_proto:
@@ -782,3 +832,34 @@ config.status: $(srcdir)/configure
 Makefile: $(srcdir)/Makefile.in config.status
        @echo "WARNING: you need to run ./config.status"
 
+test_prefix=/tmp/test-samba
+# Run regression suite using the external "satyr" framework
+check:
+       @echo "** Sorry, samba self-test without installation does not work "
+       @echo "** yet.  Please try specifying a scratch directory to"
+       @echo "**       ./configure --prefix DIR"
+       @echo "** then run \"make install installcheck\""
+       exit 1
+
+#      -rm -rf $(test_prefix)/lib
+#      mkdir $(test_prefix)/lib -p ./testdir 
+#      PATH=$(builddir)/bin:$(PATH) \
+#      SATYR_SUITEDIR=../testsuite/build_farm/ prefix=$(test_prefix) \
+#      testdir=./testdir $(SHELL) satyr
+
+# Run regression suite on the installed version.
+
+# `installcheck'
+#      Perform installation tests (if any).  The user must build and
+#      install the program before running the tests.  You should not
+#      assume that `$(bindir)' is in the search path.
+
+dangerous-installcheck:
+       mkdir -p $(BASEDIR)/lib
+       mkdir -p $(BASEDIR)/var
+       PATH=$(BINDIR):$(SBINDIR):$(PATH) \
+       SATYR_DISCOURAGE=1 \
+       SATYR_SUITEDIR=../testsuite/satyr/ prefix=$(BASEDIR) \
+       LIBSMB_PROG=$(SBINDIR)/smbd \
+       testdir=./testdir $(SHELL) satyr
+