r22875: We want to skip this test, it will fail unless run against IPC$ (which the...
[Samba.git] / source / main.mk
blob8d1f0467aef637be84709f326eae4400cb404b51
1 default: all
3 include dynconfig.mk
4 include heimdal_build/config.mk
5 include config.mk
6 include dsdb/config.mk
7 include smbd/config.mk
8 include cluster/config.mk
9 include smbd/process_model.mk
10 include libnet/config.mk
11 include auth/config.mk
12 include nsswitch/config.mk
13 include lib/basic.mk
14 include param/config.mk
15 include smb_server/config.mk
16 include rpc_server/config.mk
17 include ldap_server/config.mk
18 include web_server/config.mk
19 include winbind/config.mk
20 include nbt_server/config.mk
21 include wrepl_server/config.mk
22 include cldap_server/config.mk
23 include utils/net/config.mk
24 include utils/config.mk
25 include ntvfs/config.mk
26 include ntptr/config.mk
27 include torture/config.mk
28 include librpc/config.mk
29 include client/config.mk
30 include libcli/config.mk
31 include scripting/ejs/config.mk
32 include scripting/swig/config.mk
33 include kdc/config.mk
35 DEFAULT_HEADERS = $(srcdir)/include/core.h \
36 $(srcdir)/lib/util/dlinklist.h \
37 $(srcdir)/version.h
39 binaries: $(BINARIES)
40 libraries: $(STATIC_LIBS) $(SHARED_LIBS)
41 modules: $(SHARED_MODULES)
42 headers: $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
43 manpages: $(MANPAGES)
44 all: showflags $(ALL_PREDEP) bin/asn1_compile bin/compile_et binaries modules
45 everything: all libraries headers
47 showlayout:
48 @echo 'Samba will be installed into:'
49 @echo ' basedir: $(BASEDIR)'
50 @echo ' bindir: $(BINDIR)'
51 @echo ' sbindir: $(SBINDIR)'
52 @echo ' libdir: $(LIBDIR)'
53 @echo ' modulesdir: $(MODULESDIR)'
54 @echo ' includedir: $(INCLUDEDIR)'
55 @echo ' vardir: $(VARDIR)'
56 @echo ' privatedir: $(PRIVATEDIR)'
57 @echo ' piddir: $(PIDDIR)'
58 @echo ' lockdir: $(LOCKDIR)'
59 @echo ' logfilebase: $(LOGFILEBASE)'
60 @echo ' setupdir: $(SETUPDIR)'
61 @echo ' jsdir: $(JSDIR)'
62 @echo ' webappsdir: $(WEBAPPSDIR)'
63 @echo ' servicesdir: $(SERVICESDIR)'
64 @echo ' mandir: $(MANDIR)'
65 @echo ' torturedir: $(TORTUREDIR)'
66 @echo ' datadir: $(DATADIR)'
67 @echo ' winbindd_socket_dir: $(WINBINDD_SOCKET_DIR)'
69 showflags:
70 @echo 'Samba will be compiled with flags:'
71 @echo ' CPP = $(CPP)'
72 @echo ' CPPFLAGS = $(CPPFLAGS)'
73 @echo ' CC = $(CC)'
74 @echo ' CFLAGS = $(CFLAGS)'
75 @echo ' PICFLAG = $(PICFLAG)'
76 @echo ' LD = $(LD)'
77 @echo ' LDFLAGS = $(LDFLAGS)'
78 @echo ' STLD = $(STLD)'
79 @echo ' STLD_FLAGS = $(STLD_FLAGS)'
80 @echo ' SHLD = $(SHLD)'
81 @echo ' SHLD_FLAGS = $(SHLD_FLAGS)'
82 @echo ' SHLIBEXT = $(SHLIBEXT)'
83 @echo ' srcdir = $(srcdir)'
84 @echo ' builddir = $(builddir)'
85 @echo ' pwd = '`/bin/pwd`
87 # The permissions to give the executables
88 INSTALLPERMS = 0755
90 install: showlayout everything installbin installdat installwebapps installmisc installlib \
91 installheader installpc installplugins
93 # DESTDIR is used here to prevent packagers wasting their time
94 # duplicating the Makefile. Remove it and you will have the privilege
95 # of packaging each samba release for multiple versions of multiple
96 # distributions and operating systems, or at least supplying patches
97 # to all the packaging files required for this, prior to committing
98 # the removal of DESTDIR. Do not remove it even though you think it
99 # is not used.
101 installdirs:
102 @$(SHELL) $(srcdir)/script/installdirs.sh \
103 $(DESTDIR)$(BASEDIR) \
104 $(DESTDIR)$(BINDIR) \
105 $(DESTDIR)$(SBINDIR) \
106 $(DESTDIR)$(TORTUREDIR) \
107 $(DESTDIR)$(LIBDIR) \
108 $(DESTDIR)$(MODULESDIR) \
109 $(DESTDIR)$(MANDIR) \
110 $(DESTDIR)$(VARDIR) \
111 $(DESTDIR)$(PRIVATEDIR) \
112 $(DESTDIR)$(DATADIR) \
113 $(DESTDIR)$(PIDDIR) \
114 $(DESTDIR)$(LOCKDIR) \
115 $(DESTDIR)$(LOGFILEBASE) \
116 $(DESTDIR)$(PRIVATEDIR)/tls \
117 $(DESTDIR)$(INCLUDEDIR) \
118 $(DESTDIR)$(PKGCONFIGDIR) \
119 $(DESTDIR)$(CONFIGDIR) \
121 installbin: $(SBIN_PROGS) $(BIN_PROGS) $(TORTURE_PROGS) installdirs
122 @$(SHELL) $(srcdir)/script/installbin.sh \
123 $(INSTALLPERMS) \
124 $(DESTDIR)$(BASEDIR) \
125 $(DESTDIR)$(SBINDIR) \
126 $(DESTDIR)$(LIBDIR) \
127 $(DESTDIR)$(VARDIR) \
128 $(SBIN_PROGS)
129 @$(SHELL) $(srcdir)/script/installbin.sh \
130 $(INSTALLPERMS) \
131 $(DESTDIR)$(BASEDIR) \
132 $(DESTDIR)$(BINDIR) \
133 $(DESTDIR)$(LIBDIR) \
134 $(DESTDIR)$(VARDIR) \
135 $(BIN_PROGS)
136 @$(SHELL) $(srcdir)/script/installtorture.sh \
137 $(INSTALLPERMS) \
138 $(DESTDIR)$(TORTUREDIR) \
139 $(TORTURE_PROGS)
141 installlib: $(INSTALLABLE_SHARED_LIBS) $(STATIC_LIBS) installdirs
142 @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(LIBDIR) "$(SHLIBEXT)" $(INSTALLABLE_SHARED_LIBS)
143 #@$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(LIBDIR) "$(STLIBEXT)" $(STATIC_LIBS)
145 installheader: headers installdirs
146 @srcdir=$(srcdir) builddir=$(builddir) $(PERL) $(srcdir)/script/installheader.pl $(DESTDIR)$(INCLUDEDIR) $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
148 installdat: installdirs
149 @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(DATADIR) $(srcdir)
151 installwebapps: installdirs
152 @$(SHELL) $(srcdir)/script/installwebapps.sh $(DESTDIR)$(WEBAPPSDIR) $(srcdir)
153 @$(SHELL) $(srcdir)/script/installjsonrpc.sh $(DESTDIR)$(SERVICESDIR) $(srcdir)
155 installman: manpages installdirs
156 @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(MANDIR) $(MANPAGES)
158 installmisc: installdirs
159 @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(JSDIR) $(DESTDIR)$(SETUPDIR) $(DESTDIR)$(BINDIR)
161 installpc: installdirs
162 @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(PKGCONFIGDIR) $(PC_FILES)
164 uninstall: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader \
165 uninstallplugins
167 uninstallmisc:
168 #FIXME
170 uninstallbin:
171 @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(SBIN_PROGS)
172 @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(BIN_PROGS)
173 @$(SHELL) $(srcdir)/script/uninstalltorture.sh $(DESTDIR)$(TORTUREDIR) $(TORTURE_PROGS)
175 uninstalllib:
176 @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(LIBDIR) $(SHARED_LIBS)
177 #@$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(LIBDIR) $(STATIC_LIBS)
179 uninstallheader:
180 @$(SHELL) $(srcdir)/script/uninstallheader.sh $(DESTDIR)$(INCLUDEDIR) $(PUBLIC_HEADERS)
182 uninstallman:
183 @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(MANPAGES)
185 Makefile: config.status $(MK_FILES)
186 ./config.status
188 etags:
189 etags `find $(srcdir) -name "*.[ch]"`
191 ctags:
192 ctags `find $(srcdir) -name "*.[ch]"`
194 pidl/Makefile: pidl/Makefile.PL
195 cd pidl && $(PERL) Makefile.PL
197 testcov-html:: pidl-testcov
199 pidl-testcov: pidl/Makefile
200 cd pidl && cover -test
202 installpidl: pidl/Makefile
203 $(MAKE) -C pidl install
205 uninstallpidl: pidl/Makefile
206 $(MAKE) -C pidl uninstall
208 $(IDL_HEADER_FILES) \
209 $(IDL_NDR_PARSE_H_FILES) $(IDL_NDR_PARSE_C_FILES) \
210 $(IDL_NDR_CLIENT_C_FILES) $(IDL_NDR_CLIENT_H_FILES) \
211 $(IDL_NDR_SERVER_C_FILES) $(IDL_SWIG_FILES) \
212 $(IDL_NDR_EJS_C_FILES) $(IDL_NDR_EJS_H_FILES): idl
214 idl_full: pidl/lib/Parse/Pidl/IDL.pm pidl/lib/Parse/Pidl/Expr.pm
215 @CPP="$(CPP)" PERL="$(PERL)" srcdir=$(srcdir) $(srcdir)/script/build_idl.sh FULL
217 idl: pidl/lib/Parse/Pidl/IDL.pm pidl/lib/Parse/Pidl/Expr.pm
218 @CPP="$(CPP)" PERL="$(PERL)" srcdir=$(srcdir) $(srcdir)/script/build_idl.sh PARTIAL
220 pidl/lib/Parse/Pidl/IDL.pm: pidl/idl.yp
221 -$(YAPP) -m 'Parse::Pidl::IDL' -o pidl/lib/Parse/Pidl/IDL.pm pidl/idl.yp ||\
222 touch pidl/lib/Parse/Pidl/IDL.pm
224 pidl/lib/Parse/Pidl/Expr.pm: pidl/idl.yp
225 -$(YAPP) -m 'Parse::Pidl::Expr' -o pidl/lib/Parse/Pidl/Expr.pm pidl/expr.yp ||\
226 touch pidl/lib/Parse/Pidl/Expr.pm
228 include/config.h:
229 @echo "include/config.h not present"
230 @echo "You need to rerun ./autogen.sh and ./configure"
231 @/bin/false
233 $(srcdir)/version.h: $(srcdir)/VERSION
234 @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
236 regen_version:
237 @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
239 clean_pch:
240 @echo "Removing precompiled headers"
241 @-rm -f include/includes.h.gch
243 pch: clean_pch include/includes.h.gch
245 clean:: clean_pch
246 @echo Removing objects
247 @-find . -name '*.o' -exec rm -f '{}' \;
248 @echo Removing hostcc objects
249 @-find . -name '*.ho' -exec rm -f '{}' \;
250 @echo Removing binaries
251 @-rm -f $(BIN_PROGS) $(SBIN_PROGS) $(BINARIES) $(TORTURE_PROGS)
252 @echo Removing libraries
253 @-rm -f $(STATIC_LIBRARIES) $(SHARED_LIBRARIES)
254 @-rm -f bin/static/*.a bin/shared/*.$(SHLIBEXT)
255 @echo Removing modules
256 @-rm -f bin/modules/*/*.$(SHLIBEXT)
257 @-rm -f bin/*_init_module.c
258 @echo Removing dummy targets
259 @-rm -f bin/.*_*
260 @echo Removing generated files
261 @-rm -f bin/*_init_module.c
262 @-rm -rf librpc/gen_*
263 @echo Removing proto headers
264 @-rm -f $(PROTO_HEADERS)
266 distclean: clean
267 -rm -f include/config.h include/config_tmp.h include/build.h
268 -rm -f Makefile
269 -rm -f config.status
270 -rm -f config.log config.cache
271 -rm -f config.pm config.mk
272 -rm -rf webapps/qooxdoo-*-sdk/frontend/framework/.cache
273 -rm -f $(PC_FILES)
275 removebackup:
276 -rm -f *.bak *~ */*.bak */*~ */*/*.bak */*/*~ */*/*/*.bak */*/*/*~
278 realdistclean: distclean removebackup
279 -rm -f include/config_tmp.h.in
280 -rm -f version.h
281 -rm -f configure
282 -rm -f $(MANPAGES)
284 check:: test
286 SELFTEST = $(PERL) $(srcdir)/selftest/selftest.pl --prefix=${selftest_prefix} \
287 --builddir=$(builddir) --srcdir=$(srcdir) \
288 --expected-failures=$(srcdir)/samba4-knownfail \
289 --skip=$(srcdir)/samba4-skip \
290 $(TEST_OPTIONS)
292 test: everything
293 $(SELFTEST) $(DEFAULT_TEST_OPTIONS) --immediate $(TESTS)
295 testone: everything
296 $(SELFTEST) $(DEFAULT_TEST_OPTIONS) --one $(TESTS)
298 test-swrap: everything
299 $(SELFTEST) --socket-wrapper --immediate $(TESTS)
301 test-noswrap: everything
302 $(SELFTEST) --immediate $(TESTS)
304 quicktest: all
305 $(SELFTEST) --quick --socket-wrapper --immediate $(TESTS)
307 quicktestone: all
308 $(SELFTEST) --quick --socket-wrapper --one $(TESTS)
310 testenv: everything
311 $(SELFTEST) --socket-wrapper --testenv
313 valgrindtest: valgrindtest-quick
315 valgrindtest-quick: all
316 SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
317 VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
318 $(SELFTEST) --quick --immediate --socket-wrapper $(TESTS)
320 valgrindtest-all: everything
321 SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
322 VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
323 $(SELFTEST) --immediate --socket-wrapper $(TESTS)
325 valgrindtest-env: everything
326 SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
327 VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
328 $(SELFTEST) --socket-wrapper --testenv
330 gdbtest: gdbtest-quick
332 gdbtest-quick: all
333 SMBD_VALGRIND="xterm -n smbd -e $(srcdir)/script/gdb_run " \
334 $(SELFTEST) --immediate --quick --socket-wrapper $(TESTS)
336 gdbtest-all: everything
337 SMBD_VALGRIND="xterm -n smbd -e $(srcdir)/script/gdb_run " \
338 $(SELFTEST) --immediate --socket-wrapper $(TESTS)
340 gdbtest-env: everything
341 SMBD_VALGRIND="xterm -n smbd -e $(srcdir)/script/gdb_run " \
342 $(SELFTEST) --socket-wrapper --testenv
344 wintest: all
345 $(SELFTEST) win
347 unused_macros:
348 $(srcdir)/script/find_unused_macros.pl `find . -name "*.[ch]"` | sort
350 ###############################################################################
351 # File types
352 ###############################################################################
354 .SUFFIXES: .x .c .et .y .l .d .o .h .h.gch .a .$(SHLIBEXT) .1 .1.xml .3 .3.xml .5 .5.xml .7 .7.xml .8 .8.xml .ho .idl .hd
356 .c.d:
357 @echo "Generating dependencies for $<"
358 @$(DEPENDS)
360 .c.hd:
361 @echo "Generating host-compiler dependencies for $<"
362 @$(HDEPENDS)
364 include/includes.d: include/includes.h
365 @echo "Generating dependencies for $<"
366 @$(PCHDEPENDS)
368 .c.o:
369 @if test -n "$(CC_CHECKER)"; then \
370 echo "Checking $< with '$(CC_CHECKER)'"; \
371 $(CHECK) ; \
373 @echo "Compiling $<"
374 @-mkdir -p `dirname $@`
375 @$(COMPILE) && exit 0 ; \
376 echo "The following command failed:" 1>&2;\
377 echo "$(COMPILE)" 1>&2;\
378 $(COMPILE) >/dev/null 2>&1
380 .c.ho:
381 @echo "Compiling $< with host compiler"
382 @-mkdir -p `dirname $@`
383 @$(HCOMPILE) && exit 0;\
384 echo "The following command failed:" 1>&2;\
385 echo "$(HCOMPILE)" 1>&2;\
386 $(HCOMPILE) >/dev/null 2>&1
388 .h.h.gch:
389 @echo "Precompiling $<"
390 @$(PCHCOMPILE)
392 .y.c:
393 @echo "Building $< with $(YACC)"
394 @-$(srcdir)/script/yacc_compile.sh "$(YACC)" "$<" "$@"
396 .l.c:
397 @echo "Building $< with $(LEX)"
398 @-$(srcdir)/script/lex_compile.sh "$(LEX)" "$<" "$@"
400 DOCBOOK_MANPAGE_URL = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
402 .1.xml.1:
403 $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
405 .3.xml.3:
406 $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
408 .5.xml.5:
409 $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
411 .7.xml.7:
412 $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
414 .8.xml.8:
415 $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
417 DEP_FILES = $(patsubst %.ho,%.hd,$(patsubst %.o,%.d,$(ALL_OBJS))) \
418 include/includes.d
420 dist:: distclean idl_full manpages configure
422 configure:
423 ./autogen.sh