summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in42
-rwxr-xr-xsource3/autogen.sh2
-rw-r--r--source3/configure.in14
-rw-r--r--source3/samba4-templates.mk145
-rw-r--r--source3/samba4.m4138
-rw-r--r--source3/samba4.mk170
6 files changed, 481 insertions, 30 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index b67cfe8bb8..31387c315c 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -150,12 +150,7 @@ CODEPAGEDIR = @codepagedir@
# the directory where pid files go
PIDDIR = @piddir@
-FLAGS1 = $(CFLAGS) @FLAGS1@ @SAMBA_CPPFLAGS@ $(CPPFLAGS)
-FLAGS2 =
-FLAGS3 =
-FLAGS4 = -I$(CTDBDIR)/include
-FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4)
-FLAGS = $(ISA) $(FLAGS5) -I$(srcdir)/lib -D_SAMBA_BUILD_=3
+FLAGS = -I. -I$(srcdir) @FLAGS1@ @SAMBA_CPPFLAGS@ $(CPPFLAGS) -I$(CTDBDIR)/include $(ISA) -I$(srcdir)/lib -D_SAMBA_BUILD_=3
PATH_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" \
-DPRIVATE_DIR=\"$(PRIVATE_DIR)\" \
@@ -1169,14 +1164,13 @@ modules:: SHOWFLAGS $(MODULES)
#####################################################################
## Perl IDL Compiler
-IDL_FILES = lsa.idl dfs.idl echo.idl winreg.idl initshutdown.idl \
- srvsvc.idl svcctl.idl eventlog.idl wkssvc.idl netlogon.idl notify.idl \
- epmapper.idl messaging.idl xattr.idl misc.idl samr.idl security.idl \
- dssetup.idl krb5pac.idl ntsvcs.idl libnetapi.idl drsuapi.idl drsblobs.idl \
- nbt.idl
-
-idl::
- @IDL_FILES="$(IDL_FILES)" CPP="$(CPP)" PERL="$(PERL)" \
+samba3-idl::
+ @IDL_FILES="lsa.idl dfs.idl echo.idl winreg.idl initshutdown.idl \
+ srvsvc.idl svcctl.idl eventlog.idl wkssvc.idl netlogon.idl notify.idl \
+ epmapper.idl messaging.idl xattr.idl misc.idl samr.idl security.idl \
+ dssetup.idl krb5pac.idl ntsvcs.idl libnetapi.idl drsuapi.idl drsblobs.idl \
+ nbt.idl" \
+ CPP="$(CPP)" PERL="$(PERL)" \
srcdir="$(srcdir)" $(srcdir)/script/build_idl.sh $(PIDL_ARGS)
@@ -1190,7 +1184,7 @@ everything:: all libtalloc libsmbclient libnetapi debug2html smbfilter talloctor
.SUFFIXES: .c .o .lo
SHOWFLAGS::
- @echo "Using FLAGS = $(FLAGS)"
+ @echo "Using CFLAGS = $(CFLAGS)"
@echo " PICFLAG = $(PICFLAG)"
@echo " LIBS = $(LIBS)"
@echo " LDFLAGS = $(LDFLAGS)"
@@ -1208,11 +1202,11 @@ MAKEDIR = || exec false; \
exec false; fi || exec false
# Run a static checker.
-CHECK_CC = $(CC_CHECKER) -I. -I$(srcdir) $(FLAGS) $(PICFLAG) -c $< -o $@
+CHECK_CC = $(CC_CHECKER) $(CFLAGS) $(PICFLAG) -c $< -o $@
# Compile a source file.
-COMPILE_CC = $(CC) -I. -I$(srcdir) $(FLAGS) $(PICFLAG) -c $< -o $@
+COMPILE_CC = $(CC) $(CFLAGS) $(PICFLAG) -c $< -o $@
# Compile a source file with the installation paths defined.
-COMPILE_CC_PATH = $(CC) -I. -I$(srcdir) $(PATH_FLAGS) $(FLAGS) $(PICFLAG) -c $< -o $@
+COMPILE_CC_PATH = $(CC) $(PATH_FLAGS) $(CFLAGS) $(PICFLAG) -c $< -o $@
COMPILE = $(COMPILE_CC)
@@ -1226,7 +1220,7 @@ COMPILE = $(COMPILE_CC)
@echo Compiling $*.c
@$(COMPILE) && exit 0;\
echo "The following command failed:" 1>&2;\
- echo "$(COMPILE_CC)" 1>&2;\
+ echo "$(subst ",\",$(COMPILE_CC))" 1>&2;\
$(COMPILE_CC) >/dev/null 2>&1
@BROKEN_CC@ -mv `echo $@ | sed 's%^.*/%%g'` $@
@@ -2627,17 +2621,11 @@ include/build_env.h: script/build_env.sh
> $(builddir)/include/build_env.h
proto::
- @echo
- @echo "NOTE: 'proto' is no longer a valid make target as proto.h"
- @echo "and other prototype headers are not generated anymore."
- @echo
-.PHONY: proto
-
-etags:
+etags::
etags `find $(srcdir) -name "*.[ch]"`
-ctags:
+ctags::
ctags `find $(srcdir) -name "*.[ch]"`
realclean:: clean
diff --git a/source3/autogen.sh b/source3/autogen.sh
index 018944e684..355a742aa0 100755
--- a/source3/autogen.sh
+++ b/source3/autogen.sh
@@ -53,7 +53,7 @@ echo "$0: running script/mkversion.sh"
rm -rf autom4te*.cache
rm -f configure include/config.h*
-IPATHS="-Im4 -Ilib/replace"
+IPATHS="-Im4 -Ilib/replace -I../source4"
echo "$0: running $AUTOHEADER $IPATHS"
$AUTOHEADER $IPATHS || exit 1
diff --git a/source3/configure.in b/source3/configure.in
index f813e87fb7..248c39ac4c 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -131,8 +131,6 @@ else
CFLAGS="-O"
fi
-CFLAGS="${CFLAGS} -D_SAMBA_BUILD_=3"
-
m4_include(lib/socket_wrapper/config.m4)
m4_include(lib/nss_wrapper/config.m4)
@@ -6200,6 +6198,14 @@ MSG
fi
+AC_ARG_ENABLE(merged-build,
+[AS_HELP_STRING([--enable-merged-build], [Build Samba 4 as well])])
+
+if test x$enable_merged_build = xyes; then
+ MERGED_BUILD=1
+ m4_include(samba4.m4)
+fi
+
dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
LIB_REMOVE_USR_LIB(LDFLAGS)
LIB_REMOVE_USR_LIB(LIBS)
@@ -6248,6 +6254,10 @@ fi
SMBD_LIBS="$samba_dmapi_libs"
AC_SUBST(SMBD_LIBS)
+if test x$MERGED_BUILD != x1; then
+ CFLAGS="${CFLAGS} \$(FLAGS) -D_SAMBA_BUILD_=3"
+fi
+
AC_OUTPUT(Makefile
script/findsmb smbadduser script/gen-8bit-gap.sh script/installbin.sh script/uninstallbin.sh
lib/netapi/examples/Makefile
diff --git a/source3/samba4-templates.mk b/source3/samba4-templates.mk
new file mode 100644
index 0000000000..154c3aabda
--- /dev/null
+++ b/source3/samba4-templates.mk
@@ -0,0 +1,145 @@
+# Templates file for Samba 4
+# This relies on GNU make.
+#
+# © 2008 Jelmer Vernooij <jelmer@samba.org>
+#
+###############################################################################
+# Templates
+###############################################################################
+
+# Partially link
+# Arguments: target object file, source object files
+define partial_link_template
+$(1): $(2) ;
+ @echo Partially linking $$@
+ @mkdir -p $$(@D)
+ @$$(PARTLINK) -o $$@ $$^
+endef
+
+# Link a binary
+# Arguments: target file, depends, flags
+define binary_link_template
+$(1)4: $(2) $(LIBREPLACE_OBJ) ;
+ @echo Linking $$@
+ @$$(BNLD) $$(BNLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3) $$(LIBS) $$(LIBREPLACE_OBJ)
+clean::
+ @rm -f $(1)
+
+binaries:: $(1)
+
+
+endef
+
+# Link a host-machine binary
+# Arguments: target file, depends, flags
+define host_binary_link_template
+$(1)4: $(2) $(LIBREPLACE_OBJ) ;
+ @echo Linking $$@
+ @$$(HOSTLD) $$(HOSTLD_FLAGS) -L$${builddir}/bin/static -o $$@ $$(INSTALL_LINK_FLAGS) $(3) $$(LIBREPLACE_OBJ)
+
+clean::
+ rm -f $(1)
+
+binaries:: $(1)
+
+
+endef
+
+# Create a prototype header
+# Arguments: header file, c files
+define proto_header_template
+echo:: ;
+ echo $(1) ;
+
+proto:: $(1) ;
+
+clean:: ;
+ rm -f $(1) ;
+
+$(1): $(2) ;
+ @echo "Creating $$@"
+ @$$(PERL) $$(srcdir)/../source4/script/mkproto.pl --srcdir=$$(srcdir)/../source4 --builddir=$$(builddir)/../source4 --public=/dev/null --private=$$@ $$^
+endef
+
+# Shared module
+# Arguments: Target, dependencies, objects
+define shared_module_template
+
+$(1): $(2) ;
+ @echo Linking $$@
+ @mkdir -p $$(@D)
+ @$$(MDLD) $$(LDFLAGS) $$(MDLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3)
+
+PLUGINS += $(1)
+
+endef
+
+# Shared library
+# Arguments: Target, dependencies, link flags, soname
+define shared_library_template
+$(1): $(2)
+ @echo Linking $$@
+ @mkdir -p $$(@D)
+ @$$(SHLD) $$(LDFLAGS) $$(SHLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) \
+ $(3) \
+ $$(if $$(SONAMEFLAG), $$(SONAMEFLAG)$(notdir $(4))) $$(LIBS)
+
+ifneq ($(notdir $(1)),$(notdir $(4)))
+$(4): $(1)
+ @echo "Creating symbolic link for $$@"
+ @ln -fs $$(<F) $$@
+endif
+
+ifneq ($(notdir $(1)),$(notdir $(5)))
+$(5): $(1)
+ @echo "Creating symbolic link for $$@"
+ @ln -fs $$(<F) $$@
+endif
+endef
+
+# Shared alias
+# Arguments: Target, subsystem name, alias name
+define shared_module_alias_template
+bin/modules/$(2)/$(3).$$(SHLIBEXT): $(1)
+ @ln -fs $$(<F) $$@
+
+PLUGINS += bin/modules/$(2)/$(3).$$(SHLIBEXT)
+
+uninstallplugins::
+ @-rm $$(DESTDIR)$$(modulesdir)/$(2)/$(3).$$(SHLIBEXT)
+installplugins::
+ @ln -fs $(1) $$(DESTDIR)$$(modulesdir)/$(2)/$(3).$$(SHLIBEXT)
+
+endef
+
+define shared_module_install_template
+installplugins:: bin/modules/$(1)/$(2)
+ @echo Installing $(2) as $$(DESTDIR)$$(modulesdir)/$(1)/$(2)
+ @mkdir -p $$(DESTDIR)$$(modulesdir)/$(1)/
+ @cp bin/modules/$(1)/$(2) $$(DESTDIR)$$(modulesdir)/$(1)/$(2)
+uninstallplugins::
+ @echo Uninstalling $$(DESTDIR)$$(modulesdir)/$(1)/$(2)
+ @-rm $$(DESTDIR)$$(modulesdir)/$(1)/$(2)
+
+endef
+
+# abspath for older makes
+abspath = $(shell cd $(dir $(1)); pwd)/$(notdir $(1))
+
+# Install a binary
+# Arguments: path to binary to install
+define binary_install_template
+installbin:: $$(DESTDIR)$$(bindir)/$(notdir $(1))4
+
+uninstallbin::
+ @echo "Removing $(notdir $(1))4"
+ @rm -f $$(DESTDIR)$$(bindir)/$(1)4
+endef
+
+define sbinary_install_template
+installsbin:: $$(DESTDIR)$$(sbindir)/$(notdir $(1))4 installdirs
+
+uninstallsbin::
+ @echo "Removing $(notdir $(1))4"
+ @rm -f $$(DESTDIR)$$(sbindir)/$(1)4
+endef
diff --git a/source3/samba4.m4 b/source3/samba4.m4
new file mode 100644
index 0000000000..86047c19a6
--- /dev/null
+++ b/source3/samba4.m4
@@ -0,0 +1,138 @@
+BLDSHARED=true
+AC_SUBST(BLDSHARED)
+smbtorture4_path=bin/smbtorture4
+m4_include(build/m4/public.m4)
+
+m4_include(lib/smbreadline/readline.m4)
+m4_include(heimdal_build/internal.m4)
+m4_include(lib/util/fault.m4)
+m4_include(lib/util/signal.m4)
+m4_include(lib/util/util.m4)
+m4_include(lib/util/fsusage.m4)
+m4_include(lib/util/xattr.m4)
+m4_include(lib/util/capability.m4)
+m4_include(lib/util/time.m4)
+m4_include(lib/popt/samba.m4)
+m4_include(lib/charset/config.m4)
+m4_include(lib/socket/config.m4)
+m4_include(nsswitch/nsstest.m4)
+m4_include(pidl/config.m4)
+m4_include(lib/zlib.m4)
+
+AC_CONFIG_FILES(../source4/lib/registry/registry.pc)
+AC_CONFIG_FILES(../source4/librpc/dcerpc.pc)
+AC_CONFIG_FILES(../source4/librpc/ndr.pc)
+AC_CONFIG_FILES(../source4/lib/torture/torture.pc)
+AC_CONFIG_FILES(../source4/auth/gensec/gensec.pc)
+AC_CONFIG_FILES(../source4/param/samba-hostconfig.pc)
+AC_CONFIG_FILES(../source4/librpc/dcerpc_samr.pc)
+AC_CONFIG_FILES(../source4/librpc/dcerpc_atsvc.pc)
+
+SMB_EXT_LIB_FROM_PKGCONFIG(LIBTALLOC, talloc >= 1.2.0,
+ [],
+ [
+ SMB_INCLUDE_MK(lib/talloc/config.mk)
+ ]
+)
+
+SMB_EXT_LIB_FROM_PKGCONFIG(LIBTDB, tdb >= 1.1.0,
+ [],
+ [
+ m4_include(lib/tdb/libtdb.m4)
+ SMB_INCLUDE_MK(lib/tdb/config.mk)
+ ]
+)
+
+SMB_INCLUDE_MK(lib/tdb/python.mk)
+
+SMB_EXT_LIB_FROM_PKGCONFIG(LIBLDB, ldb >= 0.9.1,
+ [
+ SMB_INCLUDE_MK(lib/ldb/ldb_ildap/config.mk)
+ SMB_INCLUDE_MK(lib/ldb/tools/config.mk)
+ define_ldb_modulesdir=no
+ ],
+ [
+ # Here we need to do some tricks
+ # with AC_CONFIG_COMMANDS_PRE
+ # as that's the deferrs the commands
+ # to location after $prefix and $exec_prefix
+ # have usefull values and directly before
+ # creating config.status.
+ #
+ # The 'eval eval echo' trick is used to
+ # actually get the raw absolute directory
+ # path as this is needed in config.h
+ define_ldb_modulesdir=yes
+ AC_CONFIG_COMMANDS_PRE([
+ if test x"$define_ldb_modulesdir" = x"yes";then
+ LDB_MODULESDIR=`eval eval echo ${modulesdir}/ldb`
+ AC_DEFINE_UNQUOTED(LDB_MODULESDIR, "${LDB_MODULESDIR}" , [ldb Modules directory])
+ fi
+ ])
+ ldbdir="\$(abspath \$(srcdir)/../source4/lib/ldb)"
+ AC_SUBST(ldbdir)
+ m4_include(lib/ldb/sqlite3.m4)
+ m4_include(lib/ldb/libldb.m4)
+ SMB_INCLUDE_MK(lib/ldb/config.mk)
+ AC_CONFIG_FILES(../source4/lib/ldb/ldb.pc)
+ ]
+)
+SMB_INCLUDE_MK(lib/ldb/python.mk)
+
+# Not sure why we need this..
+SMB_ENABLE(swig_ldb,YES)
+
+m4_include(lib/tls/config.m4)
+eventsdir="../source4/lib/events"
+m4_include(lib/events/libevents.m4)
+
+dnl m4_include(auth/kerberos/config.m4)
+m4_include(scripting/python/config.m4)
+m4_include(auth/gensec/config.m4)
+m4_include(smbd/process_model.m4)
+m4_include(ntvfs/posix/config.m4)
+m4_include(ntvfs/unixuid/config.m4)
+m4_include(auth/config.m4)
+m4_include(kdc/config.m4)
+m4_include(ntvfs/sysdep/config.m4)
+m4_include(lib/appweb/config.m4)
+m4_include(nsswitch/config.m4)
+
+dnl Samba 4 files
+AC_SUBST(LD)
+AC_LIBREPLACE_SHLD_FLAGS
+SMB_WRITE_MAKEVARS(samba4-config.mk, [prefix exec_prefix CPPFLAGS LDSHFLAGS POPT_OBJ CFLAGS TALLOC_OBJ POPT_LIBS])
+
+oldbuilddir="$builddir"
+builddir="$builddir/../source4"
+SMB_WRITE_PERLVARS(../source4/build/smb_build/config.pm)
+builddir="$oldbuilddir"
+
+echo "configure: creating ../source4/config.mk"
+cat >../source4/config.mk<<CEOF
+# config.mk - Autogenerated by configure, DO NOT EDIT!
+$SMB_INFO_EXT_LIBS
+$SMB_INFO_SUBSYSTEMS
+$SMB_INFO_LIBRARIES
+CEOF
+
+AC_OUTPUT_COMMANDS([
+cd ${srcdir}/../source4
+USESHARED=false $PERL -I${builddir} -I${builddir}/build \
+ -I. -Ibuild \
+ build/smb_build/main.pl --output=../source3/samba4-data.mk main.mk || exit $?
+cd ../source3
+],[
+srcdir="$srcdir"
+builddir="$builddir"
+PERL="$PERL"
+
+export PERL
+export srcdir
+export builddir
+])
+
+AC_CONFIG_COMMANDS([Makefile-samba4], [
+echo "include samba4.mk" >> ${builddir}/Makefile
+])
+
diff --git a/source3/samba4.mk b/source3/samba4.mk
new file mode 100644
index 0000000000..a842d1312a
--- /dev/null
+++ b/source3/samba4.mk
@@ -0,0 +1,170 @@
+# samba 4 bits
+
+PROG_LD = $(LD)
+BNLD = $(CC)
+HOSTLD = $(CC)
+PARTLINK = $(PROG_LD) -r
+MDLD = $(SHLD)
+MDLD_FLAGS = $(LDSHFLAGS)
+
+samba4srcdir = $(call abspath,$(srcdir)/../source4)
+
+# Flags used for the samba 4 files
+# $(srcdir)/include is required for config.h
+SAMBA4_CFLAGS = -I$(samba4srcdir) -I$(samba4srcdir)/include \
+ -I$(samba4srcdir)/lib/replace -I$(samba4srcdir)/lib \
+ -I$(heimdalsrcdir)/lib/hcrypto -I$(tallocdir) \
+ -I$(srcdir)/include -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H
+
+.SUFFIXES: .ho
+
+# No cross compilation for now, thanks
+.c.ho:
+ @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
+ dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
+ @if test -n "$(CC_CHECKER)"; then \
+ echo "Checking $*.c with '$(CC_CHECKER)'";\
+ $(CHECK_CC); \
+ fi
+ @echo Compiling $*.c
+ @$(COMPILE) && exit 0;\
+ echo "The following command failed:" 1>&2;\
+ echo "$(subst ",\",$(COMPILE_CC))" 1>&2;\
+ $(COMPILE_CC) >/dev/null 2>&1
+
+# The order really does matter here! GNU Make 3.80 will break if the more specific
+# overrides are not specified first.
+ifeq ($(MAKE_VERSION),3.81)
+%.o: CFLAGS+=$(FLAGS)
+$(samba4srcdir)/%.o: CFLAGS=$(SAMBA4_CFLAGS)
+$(samba4srcdir)/%.ho: CFLAGS=$(SAMBA4_CFLAGS)
+$(heimdalsrcdir)/%.o: CFLAGS=-I$(heimdalbuildsrcdir) $(SAMBA4_CFLAGS) -I$(srcdir)
+$(heimdalsrcdir)/%.ho: CFLAGS=-I$(heimdalbuildsrcdir) $(SAMBA4_CFLAGS) -I$(srcdir)
+else
+$(heimdalsrcdir)/%.o: CFLAGS=-I$(heimdalbuildsrcdir) $(SAMBA4_CFLAGS) -I$(srcdir)
+$(heimdalsrcdir)/%.ho: CFLAGS=-I$(heimdalbuildsrcdir) $(SAMBA4_CFLAGS) -I$(srcdir)
+$(samba4srcdir)/%.o: CFLAGS=$(SAMBA4_CFLAGS)
+$(samba4srcdir)/%.ho: CFLAGS=$(SAMBA4_CFLAGS)
+%.o: CFLAGS+=$(FLAGS)
+endif
+
+# Create a static library
+%.a:
+ @echo Linking $@
+ @rm -f $@
+ @mkdir -p $(@D)
+ @$(AR) -rc $@ $^
+
+INTERN_LDFLAGS = -L${builddir}/bin/static -L${builddir}/bin/shared
+
+pidldir = $(samba4srcdir)/pidl
+include $(pidldir)/config.mk
+include samba4-config.mk
+include samba4-templates.mk
+
+zlibsrcdir := $(samba4srcdir)/lib/zlib
+dynconfigsrcdir := $(samba4srcdir)/dynconfig
+heimdalsrcdir := $(samba4srcdir)/heimdal
+dsdbsrcdir := $(samba4srcdir)/dsdb
+smbdsrcdir := $(samba4srcdir)/smbd
+clustersrcdir := $(samba4srcdir)/cluster
+libnetsrcdir := $(samba4srcdir)/libnet
+authsrcdir := $(samba4srcdir)/auth
+nsswitchsrcdir := $(samba4srcdir)/nsswitch
+libsrcdir := $(samba4srcdir)/lib
+libsocketsrcdir := $(samba4srcdir)/lib/socket
+libcharsetsrcdir := $(samba4srcdir)/lib/charset
+ldb_sambasrcdir := $(samba4srcdir)/lib/ldb-samba
+libtlssrcdir := $(samba4srcdir)/lib/tls
+libregistrysrcdir := $(samba4srcdir)/lib/registry
+libmessagingsrcdir := $(samba4srcdir)/lib/messaging
+libeventssrcdir := $(samba4srcdir)/lib/events
+libcmdlinesrcdir := $(samba4srcdir)/lib/cmdline
+poptsrcdir := $(samba4srcdir)/lib/popt
+socketwrappersrcdir := $(samba4srcdir)/lib/socket_wrapper
+nsswrappersrcdir := $(samba4srcdir)/lib/nss_wrapper
+appwebsrcdir := $(samba4srcdir)/lib/appweb
+libstreamsrcdir := $(samba4srcdir)/lib/stream
+libutilsrcdir := $(samba4srcdir)/lib/util
+libtdrsrcdir := $(samba4srcdir)/lib/tdr
+libdbwrapsrcdir := $(samba4srcdir)/lib/dbwrap
+libcryptosrcdir := $(samba4srcdir)/lib/crypto
+libtorturesrcdir := $(samba4srcdir)/lib/torture
+libcompressionsrcdir := $(samba4srcdir)/lib/compression
+libgencachesrcdir := $(samba4srcdir)/lib
+paramsrcdir := $(samba4srcdir)/param
+smb_serversrcdir := $(samba4srcdir)/smb_server
+rpc_serversrcdir := $(samba4srcdir)/rpc_server
+ldap_serversrcdir := $(samba4srcdir)/ldap_server
+web_serversrcdir := $(samba4srcdir)/web_server
+winbindsrcdir := $(samba4srcdir)/winbind
+nbt_serversrcdir := $(samba4srcdir)/nbt_server
+wrepl_serversrcdir := $(samba4srcdir)/wrepl_server
+cldap_serversrcdir := $(samba4srcdir)/cldap_server
+librpcsrcdir := $(samba4srcdir)/librpc
+torturesrcdir := $(samba4srcdir)/torture
+utilssrcdir := $(samba4srcdir)/utils
+ntvfssrcdir := $(samba4srcdir)/ntvfs
+ntptrsrcdir := $(samba4srcdir)/ntptr
+clientsrcdir := $(samba4srcdir)/client
+libclisrcdir := $(samba4srcdir)/libcli
+ejsscriptsrcdir := $(samba4srcdir)/scripting/ejs
+pyscriptsrcdir := $(samba4srcdir)/scripting/python
+kdcsrcdir := $(samba4srcdir)/kdc
+smbreadlinesrcdir := $(samba4srcdir)/lib/smbreadline
+ntp_signdsrcdir := $(samba4srcdir)/ntp_signd
+tdbsrcdir := $(samba4srcdir)/lib/tdb
+ldbsrcdir := $(samba4srcdir)/lib/ldb
+override ASN1C = bin/asn1_compile4
+override ET_COMPILER = bin/compile_et4
+include samba4-data.mk
+include $(samba4srcdir)/static_deps.mk
+include $(samba4srcdir)/build/make/python.mk
+
+INSTALLPERMS = 0755
+
+$(DESTDIR)$(bindir)/%: bin/%4 installdirs
+ @mkdir -p $(@D)
+ @echo Installing $(@F) as $@
+ @if test -f $@; then rm -f $@.old; mv $@ $@.old; fi
+ @cp $< $@
+ @chmod $(INSTALLPERMS) $@
+
+$(DESTDIR)$(sbindir)/%: bin/%4 installdirs
+ @mkdir -p $(@D)
+ @echo Installing $(@F) as $@
+ @if test -f $@; then rm -f $@.old; mv $@ $@.old; fi
+ @cp $< $@
+ @chmod $(INSTALLPERMS) $@
+
+clean::
+ @echo Removing samba 4 objects
+ @-find $(samba4srcdir) -name '*.o' -exec rm -f '{}' \;
+ @echo Removing samba 4 hostcc objects
+ @-find $(samba4srcdir) -name '*.ho' -exec rm -f '{}' \;
+ @echo Removing samba 4 libraries
+ @-rm -f $(STATIC_LIBS) $(SHARED_LIBS)
+ @-rm -f bin/static/*.a bin/shared/*.$(SHLIBEXT) bin/mergedobj/*.o
+ @echo Removing samba 4 modules
+ @-rm -f bin/modules/*/*.$(SHLIBEXT)
+ @-rm -f bin/*_init_module.c
+ @echo Removing samba 4 dummy targets
+ @-rm -f bin/.*_*
+ @echo Removing samba 4 generated files
+ @-rm -f bin/*_init_module.c
+ @-rm -rf $(samba4srcdir)/librpc/gen_*
+
+proto:: $(PROTO_HEADERS)
+modules:: $(PLUGINS)
+
+all:: basics bin/smbd4 bin/regpatch4 bin/regdiff4 bin/regshell4 bin/regtree4 bin/smbclient4
+torture:: basics bin/smbtorture4
+everything:: basics $(patsubst %,%4,$(BINARIES))
+
+
+etags::
+ etags --append=yes `find $(samba4srcdir) -name "*.[ch]"`
+
+ctags::
+ ctags --append=yes `find $(samba4srcdir) -name "*.[ch]"`
+