2008-09-15 16:30:15 +04:00
# samba 4 bits
PROG_LD = $( LD)
BNLD = $( CC)
HOSTLD = $( CC)
PARTLINK = $( PROG_LD) -r
MDLD = $( SHLD)
MDLD_FLAGS = $( LDSHFLAGS)
2008-12-23 03:53:38 +03:00
shliboutputdir = bin/shared
2008-09-15 16:30:15 +04:00
2008-09-22 01:57:59 +04:00
samba4srcdir = $( srcdir) /../source4
2008-09-15 16:30:15 +04:00
# Flags used for the samba 4 files
# $(srcdir)/include is required for config.h
2008-10-15 17:17:31 +04:00
SAMBA4_CFLAGS = -I.. -I$( samba4srcdir) -I$( samba4srcdir) /include \
2008-09-17 16:25:25 +04:00
-I$( samba4srcdir) /../lib/replace -I$( samba4srcdir) /lib \
2008-09-15 16:30:15 +04:00
-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.
i f e q ( $( MAKE_VERSION ) , 3 . 8 1 )
%.o : CFLAGS +=$( FLAGS )
2008-12-16 20:56:21 +03:00
../librpc/gen_ndr/%_c.o : CFLAGS =$( SAMBA 4_CFLAGS )
../librpc/gen_ndr/py_%.o : CFLAGS =$( SAMBA 4_CFLAGS )
2008-09-15 16:30:15 +04:00
$(samba4srcdir)/%.o : CFLAGS =$( SAMBA 4_CFLAGS )
$(samba4srcdir)/%.ho : CFLAGS =$( SAMBA 4_CFLAGS )
$(heimdalsrcdir)/%.o : CFLAGS =-I $( heimdalbuildsrcdir ) $( SAMBA 4_CFLAGS ) -I $( srcdir )
$(heimdalsrcdir)/%.ho : CFLAGS =-I $( heimdalbuildsrcdir ) $( SAMBA 4_CFLAGS ) -I $( srcdir )
e l s e
$(heimdalsrcdir)/%.o : CFLAGS =-I $( heimdalbuildsrcdir ) $( SAMBA 4_CFLAGS ) -I $( srcdir )
$(heimdalsrcdir)/%.ho : CFLAGS =-I $( heimdalbuildsrcdir ) $( SAMBA 4_CFLAGS ) -I $( srcdir )
$(samba4srcdir)/%.o : CFLAGS =$( SAMBA 4_CFLAGS )
$(samba4srcdir)/%.ho : CFLAGS =$( SAMBA 4_CFLAGS )
2008-12-16 20:56:21 +03:00
../librpc/gen_ndr/%_c.o : CFLAGS =$( SAMBA 4_CFLAGS )
../librpc/gen_ndr/py_%.o : CFLAGS =$( SAMBA 4_CFLAGS )
2008-09-15 16:30:15 +04:00
%.o : CFLAGS +=$( FLAGS )
e n d i f
# Create a static library
%.a :
@echo Linking $@
@rm -f $@
@mkdir -p $( @D)
@$( AR) -rc $@ $^
2008-09-17 20:57:40 +04:00
pidldir = $( samba4srcdir) /../pidl
2008-09-15 16:30:15 +04:00
i n c l u d e $( pidldir ) / c o n f i g . m k
i n c l u d e s a m b a 4 - c o n f i g . m k
i n c l u d e s a m b a 4 - t e m p l a t e s . m k
2008-10-12 20:29:36 +04:00
zlibsrcdir := $( samba4srcdir) /../lib/zlib
2008-09-15 16:30:15 +04:00
dynconfigsrcdir := $( samba4srcdir) /dynconfig
heimdalsrcdir := $( samba4srcdir) /heimdal
dsdbsrcdir := $( samba4srcdir) /dsdb
smbdsrcdir := $( samba4srcdir) /smbd
2008-12-30 12:09:59 +03:00
clustersrcdir := $( samba4srcdir) /cluster
2008-09-15 16:30:15 +04:00
libnetsrcdir := $( samba4srcdir) /libnet
authsrcdir := $( samba4srcdir) /auth
2008-12-16 12:06:04 +03:00
nsswitchsrcdir := $( samba4srcdir) /../nsswitch
2009-04-16 16:53:36 +04:00
libwbclientsrcdir := $( nsswitchsrcdir) /libwbclient
2008-09-15 16:30:15 +04:00
libsrcdir := $( samba4srcdir) /lib
libsocketsrcdir := $( samba4srcdir) /lib/socket
2008-10-24 06:18:47 +04:00
libcharsetsrcdir := $( samba4srcdir) /../lib/util/charset
2008-09-15 16:30:15 +04:00
ldb_sambasrcdir := $( samba4srcdir) /lib/ldb-samba
libtlssrcdir := $( samba4srcdir) /lib/tls
libregistrysrcdir := $( samba4srcdir) /lib/registry
libmessagingsrcdir := $( samba4srcdir) /lib/messaging
2008-12-16 21:57:09 +03:00
libteventsrcdir := $( samba4srcdir) /../lib/tevent
2008-09-15 16:30:15 +04:00
libeventssrcdir := $( samba4srcdir) /lib/events
libcmdlinesrcdir := $( samba4srcdir) /lib/cmdline
2008-09-17 16:25:25 +04:00
poptsrcdir := $( samba4srcdir) /../lib/popt
socketwrappersrcdir := $( samba4srcdir) /../lib/socket_wrapper
nsswrappersrcdir := $( samba4srcdir) /../lib/nss_wrapper
2008-09-15 16:30:15 +04:00
libstreamsrcdir := $( samba4srcdir) /lib/stream
2008-10-11 18:31:39 +04:00
libutilsrcdir := $( samba4srcdir) /../lib/util
2009-03-15 00:57:02 +03:00
libtdrsrcdir := ../lib/tdr
2008-09-25 00:49:05 +04:00
libcryptosrcdir := $( samba4srcdir) /../lib/crypto
2008-11-16 02:58:08 +03:00
libtorturesrcdir := ../lib/torture
2008-09-17 16:25:25 +04:00
libcompressionsrcdir := $( samba4srcdir) /../lib/compression
2008-09-15 16:30:15 +04:00
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
2008-10-08 14:03:45 +04:00
libclinbtsrcdir := $( samba4srcdir) /../libcli/nbt
2009-02-01 18:08:45 +03:00
libclicommonsrcdir := $( samba4srcdir) /../libcli
2008-09-15 16:30:15 +04:00
pyscriptsrcdir := $( samba4srcdir) /scripting/python
kdcsrcdir := $( samba4srcdir) /kdc
smbreadlinesrcdir := $( samba4srcdir) /lib/smbreadline
ntp_signdsrcdir := $( samba4srcdir) /ntp_signd
2008-09-17 16:25:25 +04:00
tdbsrcdir := $( samba4srcdir) /../lib/tdb
ldbsrcdir := $( samba4srcdir) /lib/ldb
tallocsrcdir := $( samba4srcdir) /../lib/talloc
2008-09-22 01:57:59 +04:00
comsrcdir := $( samba4srcdir) /lib/com
2008-09-15 16:30:15 +04:00
o v e r r i d e ASN1C = bin/asn1_compile4
o v e r r i d e ET_COMPILER = bin/compile_et4
2008-10-31 01:19:51 +03:00
i n c l u d e $( samba 4srcdir ) / b u i l d / m a k e / p y t h o n . m k
2008-09-15 16:30:15 +04:00
i n c l u d e s a m b a 4 - d a t a . m k
i n c l u d e $( samba 4srcdir ) / s t a t i c _ d e p s . m k
INSTALLPERMS = 0755
2008-10-31 01:19:51 +03:00
$( foreach SCRIPT ,$ ( wildcard scripting /bin /*) ,$ ( eval $ ( call binary_install_template ,$ ( SCRIPT ) ) ) )
2008-09-15 16:30:15 +04:00
2008-10-31 01:19:51 +03:00
$(DESTDIR)$(bindir)/%4 : bin /%4 installdirs
2008-09-15 16:30:15 +04:00
@mkdir -p $( @D)
@echo Installing $( @F) as $@
@if test -f $@ ; then rm -f $@ .old; mv $@ $@ .old; fi
@cp $< $@
@chmod $( INSTALLPERMS) $@
2008-10-31 01:19:51 +03:00
$(DESTDIR)$(sbindir)/%4 : bin /%4 installdirs
2008-09-15 16:30:15 +04:00
@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)
2008-12-23 03:53:38 +03:00
@-rm -f bin/static/*.a $( shliboutputdir) /*.$( SHLIBEXT) bin/mergedobj/*.o
2008-09-15 16:30:15 +04:00
@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 )
2008-10-31 01:19:51 +03:00
pythonmods :: $( PYTHON_PYS ) $( PYTHON_SO )
2008-12-22 21:06:17 +03:00
all :: bin /samba 4 bin /regpatch 4 bin /regdiff 4 bin /regshell 4 bin /regtree 4 bin /smbclient 4 bin /wbinfo 4 pythonmods setup plugins
2008-10-21 20:49:43 +04:00
torture :: bin /smbtorture 4
everything :: $( patsubst %,%4,$ ( BINARIES ) )
2008-12-11 21:07:50 +03:00
setup :
@ln -sf ../source4/setup setup
2008-11-02 18:38:27 +03:00
2009-01-28 11:35:44 +03:00
S4_LD_LIBPATH_OVERRIDE = $( LIB_PATH_VAR) = " $( builddir) /bin/shared "
2009-01-21 12:15:22 +03:00
2009-02-04 13:20:39 +03:00
SELFTEST4 = $( S4_LD_LIBPATH_OVERRIDE) EXEEXT = "4" PYTHON = " $( PYTHON) " PERL = " $( PERL) " \
$( PERL) $( selftestdir) /selftest.pl --prefix= st4 \
2008-11-02 18:38:27 +03:00
--builddir= $( builddir) --srcdir= $( samba4srcdir) \
2009-01-21 12:15:22 +03:00
--exeext= 4 \
2008-11-02 18:38:27 +03:00
--expected-failures= $( samba4srcdir) /selftest/knownfail \
--format= $( SELFTEST_FORMAT) \
--exclude= $( samba4srcdir) /selftest/skip --testlist= " $( samba4srcdir) /selftest/tests.sh| " \
$( TEST4_OPTIONS)
SELFTEST4_NOSLOW_OPTS = --exclude= $( samba4srcdir) /selftest/slow
SELFTEST4_QUICK_OPTS = $( SELFTEST4_NOSLOW_OPTS) --quick --include= $( samba4srcdir) /selftest/quick
slowtest4 :: everything
$( SELFTEST4) $( DEFAULT_TEST_OPTIONS) --immediate $( TESTS)
test4 :: everything
$( SELFTEST4) $( SELFTEST4_NOSLOW_OPTS) $( DEFAULT_TEST_OPTIONS) --immediate \
$( TESTS)
testone4 :: everything
$( SELFTEST4) $( SELFTEST4_NOSLOW_OPTS) $( DEFAULT_TEST_OPTIONS) --one $( TESTS)
test4-swrap :: everything
$( SELFTEST4) $( SELFTEST4_NOSLOW_OPTS) --socket-wrapper --immediate $( TESTS)
test4-swrap-pcap :: everything
$( SELFTEST4) $( SELFTEST4_NOSLOW_OPTS) --socket-wrapper-pcap --immediate $( TESTS)
test4-swrap-keep-pcap :: everything
$( SELFTEST4) $( SELFTEST4_NOSLOW_OPTS) --socket-wrapper-keep-pcap --immediate $( TESTS)
test4-noswrap :: everything
$( SELFTEST4) $( SELFTEST4_NOSLOW_OPTS) --immediate $( TESTS)
quicktest4 :: all
$( SELFTEST4) $( SELFTEST4_QUICK_OPTS) --socket-wrapper --immediate $( TESTS)
quicktestone4 :: all
$( SELFTEST4) $( SELFTEST4_QUICK_OPTS) --socket-wrapper --one $( TESTS)
testenv4 :: everything
$( SELFTEST4) $( SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv
testenv4-% :: everything
SELFTEST_TESTENV = $* $( SELFTEST4) $( SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv
test4-% ::
$( MAKE) test TESTS = $*
valgrindtest4 :: valgrindtest -all
valgrindtest4-quick :: all
2009-03-20 18:11:14 +03:00
SAMBA_VALGRIND = " xterm -n server -e $( selftestdir) /valgrind_run $( LD_LIBPATH_OVERRIDE) " \
2008-11-02 18:38:27 +03:00
VALGRIND = " valgrind -q --num-callers=30 --log-file= ${ selftest_prefix } /valgrind.log " \
$( SELFTEST4) $( SELFTEST4_QUICK_OPTS) --immediate --socket-wrapper $( TESTS)
valgrindtest4-all :: everything
2009-03-20 18:11:14 +03:00
SAMBA_VALGRIND = " xterm -n server -e $( selftestdir) /valgrind_run $( LD_LIBPATH_OVERRIDE) " \
2008-11-02 18:38:27 +03:00
VALGRIND = " valgrind -q --num-callers=30 --log-file= ${ selftest_prefix } /valgrind.log " \
$( SELFTEST4) $( SELFTEST4_NOSLOW_OPTS) --immediate --socket-wrapper $( TESTS)
valgrindtest4-env :: everything
2009-03-20 18:11:14 +03:00
SAMBA_VALGRIND = " xterm -n server -e $( selftestdir) /valgrind_run $( LD_LIBPATH_OVERRIDE) " \
2008-11-02 18:38:27 +03:00
VALGRIND = " valgrind -q --num-callers=30 --log-file= ${ selftest_prefix } /valgrind.log " \
$( SELFTEST4) $( SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv
gdbtest4 :: gdbtest 4-all
gdbtest4-quick :: all
2009-03-20 18:11:14 +03:00
SAMBA_VALGRIND = " xterm -n server -e $( selftestdir) /gdb_run $( LD_LIBPATH_OVERRIDE) " \
2008-11-02 18:38:27 +03:00
$( SELFTEST4) $( SELFTEST4_QUICK_OPTS) --immediate --socket-wrapper $( TESTS)
gdbtest4-all :: everything
2009-03-20 18:11:14 +03:00
SAMBA_VALGRIND = " xterm -n server -e $( selftestdir) /gdb_run $( LD_LIBPATH_OVERRIDE) " \
2008-11-02 18:38:27 +03:00
$( SELFTEST4) $( SELFTEST4_NOSLOW_OPTS) --immediate --socket-wrapper $( TESTS)
gdbtest4-env :: everything
2009-03-20 18:11:14 +03:00
SAMBA_VALGRIND = " xterm -n server -e $( selftestdir) /gdb_run $( LD_LIBPATH_OVERRIDE) " \
2008-11-02 18:38:27 +03:00
$( SELFTEST4) $( SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv
2008-12-22 21:06:17 +03:00
plugins : $( PLUGINS )