1 all: showflags
$(ALL_PREDEP
) bin
/asn1_compile bin
/compile_et binaries modules
2 everything
: all libraries
5 include heimdal_build
/config.mk
9 include cluster
/config.mk
10 include smbd
/process_model.mk
11 include libnet
/config.mk
12 include auth
/config.mk
13 include nsswitch
/config.mk
15 include param
/config.mk
16 include smb_server
/config.mk
17 include rpc_server
/config.mk
18 include ldap_server
/config.mk
19 include web_server
/config.mk
20 include winbind
/config.mk
21 include nbt_server
/config.mk
22 include wrepl_server
/config.mk
23 include cldap_server
/config.mk
24 include utils
/net
/config.mk
25 include utils
/config.mk
26 include ntvfs
/config.mk
27 include ntptr
/config.mk
28 include torture
/config.mk
29 include librpc
/config.mk
30 include client
/config.mk
31 include libcli
/config.mk
32 include scripting
/ejs
/config.mk
33 include scripting
/swig
/config.mk
36 DEFAULT_HEADERS
= $(srcdir)/include/core.h \
37 $(srcdir)/lib
/util
/dlinklist.h \
41 libraries
: $(STATIC_LIBS
) $(SHARED_LIBS
)
42 modules
: $(SHARED_MODULES
)
43 headers
: $(PUBLIC_HEADERS
) $(DEFAULT_HEADERS
)
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)'
70 @echo
'Samba will be compiled with flags:'
72 @echo
' CPPFLAGS = $(CPPFLAGS)'
74 @echo
' CFLAGS = $(CFLAGS)'
75 @echo
' PICFLAG = $(PICFLAG)'
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
90 install: showlayout 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
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 \
124 $(DESTDIR
)$(BASEDIR
) \
125 $(DESTDIR
)$(SBINDIR
) \
126 $(DESTDIR
)$(LIBDIR
) \
127 $(DESTDIR
)$(VARDIR
) \
129 @
$(SHELL
) $(srcdir)/script
/installbin.sh \
131 $(DESTDIR
)$(BASEDIR
) \
132 $(DESTDIR
)$(BINDIR
) \
133 $(DESTDIR
)$(LIBDIR
) \
134 $(DESTDIR
)$(VARDIR
) \
136 @
$(SHELL
) $(srcdir)/script
/installtorture.sh \
138 $(DESTDIR
)$(TORTUREDIR
) \
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 \
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
)
176 @
$(SHELL
) $(srcdir)/script
/uninstalllib.sh
$(DESTDIR
)$(LIBDIR
) $(SHARED_LIBS
)
177 @
$(SHELL
) $(srcdir)/script
/uninstalllib.sh
$(DESTDIR
)$(LIBDIR
) $(STATIC_LIBS
)
180 @
$(SHELL
) $(srcdir)/script
/uninstallheader.sh
$(DESTDIR
)$(INCLUDEDIR
) $(PUBLIC_HEADERS
)
183 @
$(SHELL
) $(srcdir)/script
/uninstallman.sh
$(DESTDIR
)$(MANDIR
) $(MANPAGES
)
185 Makefile
: config.status
$(MK_FILES
)
189 etags
`find $(srcdir) -name "*.[ch]"`
192 ctags
`find $(srcdir) -name "*.[ch]"`
194 pidl
/Makefile
: pidl
/Makefile.PL
195 cd pidl
&& $(PERL
) Makefile.PL
197 installpidl
: pidl
/Makefile
198 $(MAKE
) -C pidl
install
200 uninstallpidl
: pidl
/Makefile
201 $(MAKE
) -C pidl
uninstall
203 $(IDL_HEADER_FILES
) \
204 $(IDL_NDR_PARSE_H_FILES
) $(IDL_NDR_PARSE_C_FILES
) \
205 $(IDL_NDR_CLIENT_C_FILES
) $(IDL_NDR_CLIENT_H_FILES
) \
206 $(IDL_NDR_SERVER_C_FILES
) $(IDL_SWIG_FILES
) \
207 $(IDL_NDR_EJS_C_FILES
) $(IDL_NDR_EJS_H_FILES
): idl
209 idl_full
: pidl
/lib
/Parse
/Pidl
/IDL.pm pidl
/lib
/Parse
/Pidl
/Expr.pm
210 @CPP
="$(CPP)" PERL
="$(PERL)" srcdir=$(srcdir) $(srcdir)/script
/build_idl.sh FULL
212 idl
: pidl
/lib
/Parse
/Pidl
/IDL.pm pidl
/lib
/Parse
/Pidl
/Expr.pm
213 @CPP
="$(CPP)" PERL
="$(PERL)" srcdir=$(srcdir) $(srcdir)/script
/build_idl.sh PARTIAL
215 pidl
/lib
/Parse
/Pidl
/IDL.pm
: pidl
/idl.yp
216 -$(YAPP
) -m
'Parse::Pidl::IDL' -o pidl
/lib
/Parse
/Pidl
/IDL.pm pidl
/idl.yp ||\
217 touch pidl
/lib
/Parse
/Pidl
/IDL.pm
219 pidl
/lib
/Parse
/Pidl
/Expr.pm
: pidl
/idl.yp
220 -$(YAPP
) -m
'Parse::Pidl::Expr' -o pidl
/lib
/Parse
/Pidl
/Expr.pm pidl
/expr.yp ||\
221 touch pidl
/lib
/Parse
/Pidl
/Expr.pm
224 @echo
"include/config.h not present"
225 @echo
"You need to rerun ./autogen.sh and ./configure"
228 $(srcdir)/version.h
: $(srcdir)/VERSION
229 @
$(SHELL
) script
/mkversion.sh VERSION
$(srcdir)/version.h
$(srcdir)/
232 @
$(SHELL
) script
/mkversion.sh VERSION
$(srcdir)/version.h
$(srcdir)/
235 @echo
"Removing precompiled headers"
236 @
-rm -f
include/includes.h.gch
238 pch
: clean_pch
include/includes.h.gch
241 @echo Removing objects
242 @
-find .
-name
'*.o' -exec
rm -f
'{}' \
;
243 @echo Removing hostcc objects
244 @
-find .
-name
'*.ho' -exec
rm -f
'{}' \
;
245 @echo Removing binaries
246 @
-rm -f
$(BIN_PROGS
) $(SBIN_PROGS
) $(BINARIES
) $(TORTURE_PROGS
)
247 @echo Removing libraries
248 @
-rm -f
$(STATIC_LIBRARIES
) $(SHARED_LIBRARIES
)
249 @
-rm -f bin
/static
/*.a bin
/shared
/*.
$(SHLIBEXT
)
250 @echo Removing modules
251 @
-rm -f bin
/modules
/*/*.
$(SHLIBEXT
)
252 @
-rm -f bin
/*_init_module.c
253 @echo Removing dummy targets
255 @echo Removing generated files
256 @
-rm -f bin
/*_init_module.c
257 @
-rm -rf librpc
/gen_
*
258 @echo Removing proto headers
259 @
-rm -f
$(PROTO_HEADERS
)
262 -rm -f
include/config.h
include/config_tmp.h
include/build.h
265 -rm -f config.log config.cache
266 -rm -f config.pm config.mk
267 -rm -rf webapps
/qooxdoo-
*-sdk
/frontend
/framework
/.cache
271 -rm -f
*.bak
*~
*/*.bak
*/*~
*/*/*.bak
*/*/*~
*/*/*/*.bak
*/*/*/*~
273 realdistclean
: distclean removebackup
274 -rm -f
include/config_tmp.h.in
280 test: $(DEFAULT_TEST_TARGET
)
282 SELFTEST
= builddir
=$(builddir
) srcdir=$(srcdir) \
283 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix}
285 test-swrap
: all libraries
286 $(SELFTEST
) all SOCKET_WRAPPER
288 test-noswrap
: all libraries
292 $(SELFTEST
) quick SOCKET_WRAPPER
294 testenv
: all libraries
295 $(SELFTEST
) xterm SOCKET_WRAPPER
297 valgrindtest
: valgrindtest-quick
299 valgrindtest-quick
: all
300 SMBD_VALGRIND
="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
301 VALGRIND
="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
302 $(SELFTEST
) quick SOCKET_WRAPPER
304 valgrindtest-all
: all libraries
305 SMBD_VALGRIND
="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
306 VALGRIND
="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
307 $(SELFTEST
) all SOCKET_WRAPPER
309 valgrindtest-env
: all libraries
310 SMBD_VALGRIND
="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
311 VALGRIND
="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
312 $(SELFTEST
) xterm SOCKET_WRAPPER
314 gdbtest
: gdbtest-quick
317 SMBD_VALGRIND
="xterm -n smbd -e gdb --args " \
318 $(SELFTEST
) quick SOCKET_WRAPPER
320 gdbtest-all
: all libraries
321 SMBD_VALGRIND
="xterm -n smbd -e gdb --args " \
322 $(SELFTEST
) all SOCKET_WRAPPER
328 $(srcdir)/script
/find_unused_macros.pl
`find . -name "*.[ch]"` |
sort
330 ###############################################################################
332 ###############################################################################
334 .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
336 # Dependencies command
337 DEPENDS
= $(CC
) -M
-MG
-MP
-MT
$(<:.c
=.o
) -MT
$@ \
338 `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS
) $< -o
$@
339 # Dependencies for host objects
340 HDEPENDS
= $(CC
) -M
-MG
-MP
-MT
$(<:.c
=.ho
) -MT
$@ \
341 `$(PERL) $(srcdir)/script/cflags.pl $@` $(HOSTCC_CFLAGS
) $< -o
$@
342 # Dependencies for precompiled headers
343 PCHDEPENDS
= $(CC
) -M
-MG
-MT
include/includes.h.gch
-MT
$@ \
347 @echo
"Generating dependencies for $<"
351 @echo
"Generating host-compiler dependencies for $<"
354 include/includes.d
: include/includes.h
355 @echo
"Generating dependencies for $<"
359 # $< is broken in older BSD versions:
360 # when $@ is foo/bar.o, $< could be torture/foo/bar.c
361 # if it also exists. So better use $* which is foo/bar
362 # and append .c manually to get foo/bar.c
365 # Run a static analysis checker
366 CHECK
= $(CC_CHECKER
) `$(PERL) $(srcdir)/script/cflags.pl $@` \
367 $(CFLAGS
) $(PICFLAG
) -c
$*.c
-o
$@
369 # Run the configured compiler
370 COMPILE
= $(CC
) `$(PERL) $(srcdir)/script/cflags.pl $@` \
371 $(CFLAGS
) $(PICFLAG
) -c
$*.c
-o
$@
373 # Run the compiler for the build host
374 HCOMPILE
= $(HOSTCC
) `$(PERL) $(srcdir)/script/cflags.pl $@` \
375 $(HOSTCC_CFLAGS
) -c
$*.c
-o
$@
378 PCHCOMPILE
= @
$(CC
) -Ilib
/replace \
379 `$(PERL) $(srcdir)/script/cflags.pl $@` \
380 $(CFLAGS
) $(PICFLAG
) -c
$*.c
-o
$@
383 @if
test -n
"$(CC_CHECKER)"; then \
384 echo
"Checking $< with '$(CC_CHECKER)'"; \
388 @
-mkdir
-p
`dirname $@`
389 @
$(COMPILE
) && exit
0 ; \
390 echo
"The following command failed:" 1>&2;\
391 echo
"$(COMPILE)" 1>&2;\
392 $(COMPILE
) >/dev
/null
2>&1
395 @echo
"Compiling $< with host compiler"
396 @
-mkdir
-p
`dirname $@`
397 @
$(HCOMPILE
) && exit
0;\
398 echo
"The following command failed:" 1>&2;\
399 echo
"$(HCOMPILE)" 1>&2;\
400 $(HCOMPILE
) >/dev
/null
2>&1
403 @echo
"Precompiling $<"
407 @echo
"Building $< with $(YACC)"
408 @
-$(srcdir)/script
/yacc_compile.sh
"$(YACC)" "$<" "$@"
411 @echo
"Building $< with $(LEX)"
412 @
-$(srcdir)/script
/lex_compile.sh
"$(LEX)" "$<" "$@"
414 DOCBOOK_MANPAGE_URL
= http
://docbook.sourceforge.net
/release
/xsl
/current
/manpages
/docbook.xsl
417 $(XSLTPROC
) -o
$@
$(DOCBOOK_MANPAGE_URL
) $<
420 $(XSLTPROC
) -o
$@
$(DOCBOOK_MANPAGE_URL
) $<
423 $(XSLTPROC
) -o
$@
$(DOCBOOK_MANPAGE_URL
) $<
426 $(XSLTPROC
) -o
$@
$(DOCBOOK_MANPAGE_URL
) $<
429 $(XSLTPROC
) -o
$@
$(DOCBOOK_MANPAGE_URL
) $<
431 DEP_FILES
= $(patsubst %.ho
,%.hd
,$(patsubst %.o
,%.d
,$(ALL_OBJS
))) \
434 dist:: distclean idl_full manpages configure
440 @echo Removing dependency files
441 @find .
-name \
*.d
-o
-name \
*.hd | xargs
rm -f