6 PARTLINK
= $(PROG_LD
) -r
8 MDLD_FLAGS
= $(LDSHFLAGS
)
10 samba4srcdir
= $(srcdir)/..
/source4
12 # Flags used for the samba 4 files
13 # $(srcdir)/include is required for config.h
14 SAMBA4_CFLAGS
= -I..
-I
$(samba4srcdir
) -I
$(samba4srcdir
)/include \
15 -I
$(samba4srcdir
)/..
/lib
/replace
-I
$(samba4srcdir
)/lib \
16 -I
$(heimdalsrcdir
)/lib
/hcrypto
-I
$(tallocdir
) \
17 -I
$(srcdir)/include -D_SAMBA_BUILD_
=4 -DHAVE_CONFIG_H
21 # No cross compilation for now, thanks
23 @if
(: >> $@ ||
: > $@
) >/dev
/null
2>&1; then
rm -f
$@
; else \
24 dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR
); fi
25 @if
test -n
"$(CC_CHECKER)"; then \
26 echo
"Checking $*.c with '$(CC_CHECKER)'";\
30 @
$(COMPILE
) && exit
0;\
31 echo
"The following command failed:" 1>&2;\
32 echo
"$(subst ",\",$(COMPILE_CC
))" 1>&2;\
33 $(COMPILE_CC) >/dev/null 2>&1
35 # The order really does matter here! GNU Make 3.80 will break if the more specific
36 # overrides are not specified first.
37 ifeq ($(MAKE_VERSION),3.81)
39 $(samba4srcdir)/%.o: CFLAGS=$(SAMBA4_CFLAGS)
40 $(samba4srcdir)/%.ho: CFLAGS=$(SAMBA4_CFLAGS)
41 $(heimdalsrcdir)/%.o: CFLAGS=-I$(heimdalbuildsrcdir) $(SAMBA4_CFLAGS) -I$(srcdir)
42 $(heimdalsrcdir)/%.ho: CFLAGS=-I$(heimdalbuildsrcdir) $(SAMBA4_CFLAGS) -I$(srcdir)
44 $(heimdalsrcdir)/%.o: CFLAGS=-I$(heimdalbuildsrcdir) $(SAMBA4_CFLAGS) -I$(srcdir)
45 $(heimdalsrcdir)/%.ho: CFLAGS=-I$(heimdalbuildsrcdir) $(SAMBA4_CFLAGS) -I$(srcdir)
46 $(samba4srcdir)/%.o: CFLAGS=$(SAMBA4_CFLAGS)
47 $(samba4srcdir)/%.ho: CFLAGS=$(SAMBA4_CFLAGS)
51 # Create a static library
58 INTERN_LDFLAGS = -L${builddir}/bin/static -L${builddir}/bin/shared
60 pidldir = $(samba4srcdir)/../pidl
61 include $(pidldir)/config.mk
62 include samba4-config.mk
63 include samba4-templates.mk
65 zlibsrcdir := $(samba4srcdir)/../lib/zlib
66 dynconfigsrcdir := $(samba4srcdir)/dynconfig
67 heimdalsrcdir := $(samba4srcdir)/heimdal
68 dsdbsrcdir := $(samba4srcdir)/dsdb
69 smbdsrcdir := $(samba4srcdir)/smbd
70 clustersrcdir := $(samba4srcdir)/cluster
71 libnetsrcdir := $(samba4srcdir)/libnet
72 authsrcdir := $(samba4srcdir)/auth
73 nsswitchsrcdir := $(samba4srcdir)/nsswitch
74 libsrcdir := $(samba4srcdir)/lib
75 libsocketsrcdir := $(samba4srcdir)/lib/socket
76 libcharsetsrcdir := $(samba4srcdir)/../lib/util/charset
77 ldb_sambasrcdir := $(samba4srcdir)/lib/ldb-samba
78 libtlssrcdir := $(samba4srcdir)/lib/tls
79 libregistrysrcdir := $(samba4srcdir)/lib/registry
80 libmessagingsrcdir := $(samba4srcdir)/lib/messaging
81 libeventssrcdir := $(samba4srcdir)/lib/events
82 libcmdlinesrcdir := $(samba4srcdir)/lib/cmdline
83 poptsrcdir := $(samba4srcdir)/../lib/popt
84 socketwrappersrcdir := $(samba4srcdir)/../lib/socket_wrapper
85 nsswrappersrcdir := $(samba4srcdir)/../lib/nss_wrapper
86 libstreamsrcdir := $(samba4srcdir)/lib/stream
87 libutilsrcdir := $(samba4srcdir)/../lib/util
88 libtdrsrcdir := $(samba4srcdir)/lib/tdr
89 libdbwrapsrcdir := $(samba4srcdir)/lib/dbwrap
90 libcryptosrcdir := $(samba4srcdir)/../lib/crypto
91 libtorturesrcdir := $(samba4srcdir)/lib/torture
92 libcompressionsrcdir := $(samba4srcdir)/../lib/compression
93 libgencachesrcdir := $(samba4srcdir)/lib
94 paramsrcdir := $(samba4srcdir)/param
95 smb_serversrcdir := $(samba4srcdir)/smb_server
96 rpc_serversrcdir := $(samba4srcdir)/rpc_server
97 ldap_serversrcdir := $(samba4srcdir)/ldap_server
98 web_serversrcdir := $(samba4srcdir)/web_server
99 winbindsrcdir := $(samba4srcdir)/winbind
100 nbt_serversrcdir := $(samba4srcdir)/nbt_server
101 wrepl_serversrcdir := $(samba4srcdir)/wrepl_server
102 cldap_serversrcdir := $(samba4srcdir)/cldap_server
103 librpcsrcdir := $(samba4srcdir)/librpc
104 torturesrcdir := $(samba4srcdir)/torture
105 utilssrcdir := $(samba4srcdir)/utils
106 ntvfssrcdir := $(samba4srcdir)/ntvfs
107 ntptrsrcdir := $(samba4srcdir)/ntptr
108 clientsrcdir := $(samba4srcdir)/client
109 libclisrcdir := $(samba4srcdir)/libcli
110 libclinbtsrcdir := $(samba4srcdir)/../libcli/nbt
111 pyscriptsrcdir := $(samba4srcdir)/scripting/python
112 kdcsrcdir := $(samba4srcdir)/kdc
113 smbreadlinesrcdir := $(samba4srcdir)/lib/smbreadline
114 ntp_signdsrcdir := $(samba4srcdir)/ntp_signd
115 tdbsrcdir := $(samba4srcdir)/../lib/tdb
116 ldbsrcdir := $(samba4srcdir)/lib/ldb
117 tallocsrcdir := $(samba4srcdir)/../lib/talloc
118 comsrcdir := $(samba4srcdir)/lib/com
119 override ASN1C = bin/asn1_compile4
120 override ET_COMPILER = bin/compile_et4
121 include $(samba4srcdir)/build/make/python.mk
122 include samba4-data.mk
123 include $(samba4srcdir)/static_deps.mk
126 $(foreach SCRIPT,$(wildcard scripting/bin/*),$(eval $(call binary_install_template,$(SCRIPT))))
128 $(DESTDIR)$(bindir)/%4: bin/%4 installdirs
130 @echo Installing $(@F) as $@
131 @if test -f $@; then rm -f $@.old; mv $@ $@.old; fi
133 @chmod $(INSTALLPERMS) $@
135 $(DESTDIR)$(sbindir)/%4: bin/%4 installdirs
137 @echo Installing $(@F) as $@
138 @if test -f $@; then rm -f $@.old; mv $@ $@.old; fi
140 @chmod $(INSTALLPERMS) $@
143 @echo Removing samba 4 objects
144 @-find $(samba4srcdir) -name '*.o' -exec rm -f '{}' \;
145 @echo Removing samba 4 hostcc objects
146 @-find $(samba4srcdir) -name '*.ho' -exec rm -f '{}' \;
147 @echo Removing samba 4 libraries
148 @-rm -f $(STATIC_LIBS) $(SHARED_LIBS)
149 @-rm -f bin/static/*.a bin/shared/*.$(SHLIBEXT) bin/mergedobj/*.o
150 @echo Removing samba 4 modules
151 @-rm -f bin/modules/*/*.$(SHLIBEXT)
152 @-rm -f bin/*_init_module.c
153 @echo Removing samba 4 dummy targets
155 @echo Removing samba 4 generated files
156 @-rm -f bin/*_init_module.c
157 @-rm -rf $(samba4srcdir)/librpc/gen_*
159 proto:: $(PROTO_HEADERS)
162 pythonmods:: $(PYTHON_PYS) $(PYTHON_SO)
164 all:: bin/samba4 bin/regpatch4 bin/regdiff4 bin/regshell4 bin/regtree4 bin/smbclient4
165 torture:: bin/smbtorture4
166 everything:: $(patsubst %,%4,$(BINARIES))
168 SELFTEST4 = $(LD_LIBPATH_OVERRIDE) $(PERL) $(selftestdir)/selftest.pl --prefix=st4 \
169 --builddir=$(builddir) --srcdir=$(samba4srcdir) \
170 --expected-failures=$(samba4srcdir)/selftest/knownfail \
171 --format=$(SELFTEST_FORMAT) \
172 --exclude=$(samba4srcdir)/selftest/skip --testlist="$(samba4srcdir
)/selftest
/tests.sh|
" \
175 SELFTEST4_NOSLOW_OPTS = --exclude=$(samba4srcdir)/selftest/slow
176 SELFTEST4_QUICK_OPTS = $(SELFTEST4_NOSLOW_OPTS) --quick --include=$(samba4srcdir)/selftest/quick
178 slowtest4:: everything
179 $(SELFTEST4) $(DEFAULT_TEST_OPTIONS) --immediate $(TESTS)
182 $(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) --immediate \
185 testone4:: everything
186 $(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) $(DEFAULT_TEST_OPTIONS) --one $(TESTS)
188 test4-swrap:: everything
189 $(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper --immediate $(TESTS)
191 test4-swrap-pcap:: everything
192 $(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper-pcap --immediate $(TESTS)
194 test4-swrap-keep-pcap:: everything
195 $(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper-keep-pcap --immediate $(TESTS)
197 test4-noswrap:: everything
198 $(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --immediate $(TESTS)
201 $(SELFTEST4) $(SELFTEST4_QUICK_OPTS) --socket-wrapper --immediate $(TESTS)
204 $(SELFTEST4) $(SELFTEST4_QUICK_OPTS) --socket-wrapper --one $(TESTS)
206 testenv4:: everything
207 $(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv
209 testenv4-%:: everything
210 SELFTEST_TESTENV=$* $(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv
213 $(MAKE) test TESTS=$*
215 valgrindtest4:: valgrindtest-all
217 valgrindtest4-quick:: all
218 SMBD_VALGRIND="xterm
-n server
-e
$(selftestdir
)/valgrind_run
$(LD_LIBPATH_OVERRIDE
)" \
219 VALGRIND="valgrind
-q
--num-callers
=30 --log-file
=${selftest_prefix}/valgrind.log
" \
220 $(SELFTEST4) $(SELFTEST4_QUICK_OPTS) --immediate --socket-wrapper $(TESTS)
222 valgrindtest4-all:: everything
223 SMBD_VALGRIND="xterm
-n server
-e
$(selftestdir
)/valgrind_run
$(LD_LIBPATH_OVERRIDE
)" \
224 VALGRIND="valgrind
-q
--num-callers
=30 --log-file
=${selftest_prefix}/valgrind.log
" \
225 $(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --immediate --socket-wrapper $(TESTS)
227 valgrindtest4-env:: everything
228 SMBD_VALGRIND="xterm
-n server
-e
$(selftestdir
)/valgrind_run
$(LD_LIBPATH_OVERRIDE
)" \
229 VALGRIND="valgrind
-q
--num-callers
=30 --log-file
=${selftest_prefix}/valgrind.log
" \
230 $(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv
232 gdbtest4:: gdbtest4-all
235 SMBD_VALGRIND="xterm
-n server
-e
$(selftestdir
)/gdb_run
$(LD_LIBPATH_OVERRIDE
)" \
236 $(SELFTEST4) $(SELFTEST4_QUICK_OPTS) --immediate --socket-wrapper $(TESTS)
238 gdbtest4-all:: everything
239 SMBD_VALGRIND="xterm
-n server
-e
$(selftestdir
)/gdb_run
$(LD_LIBPATH_OVERRIDE
)" \
240 $(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --immediate --socket-wrapper $(TESTS)
242 gdbtest4-env:: everything
243 SMBD_VALGRIND="xterm
-n server
-e
$(selftestdir
)/gdb_run
$(LD_LIBPATH_OVERRIDE
)" \
244 $(SELFTEST4) $(SELFTEST4_NOSLOW_OPTS) --socket-wrapper --testenv