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