1 all: showflags
$(ALL_PREDEP
) bin
/asn1_compile bin
/compile_et binaries libraries modules
4 include heimdal_build
/config.mk
9 include smbd
/process_model.mk
10 include libnet
/config.mk
11 include auth
/config.mk
12 include nsswitch
/config.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
34 include passdb
/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
' swatdir: $(SWATDIR)'
63 @echo
' mandir: $(MANDIR)'
64 @echo
' datadir: $(DATADIR)'
65 @echo
' winbindd_socket_dir: $(WINBINDD_SOCKET_DIR)'
68 @echo
'Samba will be compiled with flags:'
70 @echo
' CPPFLAGS = $(CPPFLAGS)'
72 @echo
' CFLAGS = $(CFLAGS)'
73 @echo
' PICFLAG = $(PICFLAG)'
75 @echo
' LDFLAGS = $(LDFLAGS)'
76 @echo
' STLD = $(STLD)'
77 @echo
' STLD_FLAGS = $(STLD_FLAGS)'
78 @echo
' SHLD = $(SHLD)'
79 @echo
' SHLD_FLAGS = $(SHLD_FLAGS)'
80 @echo
' SHLIBEXT = $(SHLIBEXT)'
82 # The permissions to give the executables
85 # set these to where to find various files
86 # These can be overridden by command line switches (see smbd(8))
87 # or in smb.conf (see smb.conf(5))
88 CONFIGFILE
= $(CONFIGDIR
)/smb.conf
89 PKGCONFIGDIR
= $(LIBDIR
)/pkgconfig
90 LMHOSTSFILE
= $(CONFIGDIR
)/lmhosts
92 install: showlayout installbin installdat installswat installmisc installlib \
93 installheader installpc installplugins
95 # DESTDIR is used here to prevent packagers wasting their time
96 # duplicating the Makefile. Remove it and you will have the privilege
97 # of packaging each samba release for multiple versions of multiple
98 # distributions and operating systems, or at least supplying patches
99 # to all the packaging files required for this, prior to committing
100 # the removal of DESTDIR. Do not remove it even though you think it
104 @
$(SHELL
) $(srcdir)/script
/installdirs.sh \
105 $(DESTDIR
)$(BASEDIR
) \
106 $(DESTDIR
)$(BINDIR
) \
107 $(DESTDIR
)$(SBINDIR
) \
108 $(DESTDIR
)$(LIBDIR
) \
109 $(DESTDIR
)$(MODULESDIR
) \
110 $(DESTDIR
)$(MANDIR
) \
111 $(DESTDIR
)$(VARDIR
) \
112 $(DESTDIR
)$(PRIVATEDIR
) \
113 $(DESTDIR
)$(DATADIR
) \
114 $(DESTDIR
)$(PIDDIR
) \
115 $(DESTDIR
)$(LOCKDIR
) \
116 $(DESTDIR
)$(LOGFILEBASE
) \
117 $(DESTDIR
)$(PRIVATEDIR
)/tls \
118 $(DESTDIR
)$(INCLUDEDIR
) \
119 $(DESTDIR
)$(PKGCONFIGDIR
) \
120 $(DESTDIR
)$(CONFIGDIR
) \
122 installbin
: $(SBIN_PROGS
) $(BIN_PROGS
) installdirs
123 @
$(SHELL
) $(srcdir)/script
/installbin.sh \
125 $(DESTDIR
)$(BASEDIR
) \
126 $(DESTDIR
)$(SBINDIR
) \
127 $(DESTDIR
)$(LIBDIR
) \
128 $(DESTDIR
)$(VARDIR
) \
130 @
$(SHELL
) $(srcdir)/script
/installbin.sh \
132 $(DESTDIR
)$(BASEDIR
) \
133 $(DESTDIR
)$(BINDIR
) \
134 $(DESTDIR
)$(LIBDIR
) \
135 $(DESTDIR
)$(VARDIR
) \
138 installlib
: $(INSTALLABLE_SHARED_LIBS
) $(STATIC_LIBS
) installdirs
139 @
$(SHELL
) $(srcdir)/script
/installlib.sh
$(DESTDIR
)$(LIBDIR
) "$(SHLIBEXT)" $(INSTALLABLE_SHARED_LIBS
)
140 @
$(SHELL
) $(srcdir)/script
/installlib.sh
$(DESTDIR
)$(LIBDIR
) "$(STLIBEXT)" $(STATIC_LIBS
)
142 installheader
: headers
installdirs
143 @
$(PERL
) $(srcdir)/script
/installheader.pl
$(DESTDIR
)$(INCLUDEDIR
) $(PUBLIC_HEADERS
) $(DEFAULT_HEADERS
)
145 installdat
: installdirs
146 @
$(SHELL
) $(srcdir)/script
/installdat.sh
$(DESTDIR
)$(DATADIR
) $(srcdir)
148 installswat
: installdirs
149 @
$(SHELL
) $(srcdir)/script
/installswat.sh
$(DESTDIR
)$(SWATDIR
) $(srcdir)
151 installman
: manpages
installdirs
152 @
$(SHELL
) $(srcdir)/script
/installman.sh
$(DESTDIR
)$(MANDIR
) $(MANPAGES
)
154 installmisc
: installdirs
155 @
$(SHELL
) $(srcdir)/script
/installmisc.sh
$(srcdir) $(DESTDIR
)$(JSDIR
) $(DESTDIR
)$(SETUPDIR
) $(DESTDIR
)$(BINDIR
)
157 installpc
: installdirs
158 @
$(SHELL
) $(srcdir)/script
/installpc.sh
$(builddir
) $(DESTDIR
)$(PKGCONFIGDIR
) $(PC_FILES
)
160 uninstall: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader \
167 @
$(SHELL
) $(srcdir)/script
/uninstallbin.sh
$(INSTALLPERMS
) $(DESTDIR
)$(BASEDIR
) $(DESTDIR
)$(SBINDIR
) $(DESTDIR
)$(LIBDIR
) $(DESTDIR
)$(VARDIR
) $(DESTDIR
)$(SBIN_PROGS
)
168 @
$(SHELL
) $(srcdir)/script
/uninstallbin.sh
$(INSTALLPERMS
) $(DESTDIR
)$(BASEDIR
) $(DESTDIR
)$(BINDIR
) $(DESTDIR
)$(LIBDIR
) $(DESTDIR
)$(VARDIR
) $(DESTDIR
)$(BIN_PROGS
)
171 @
$(SHELL
) $(srcdir)/script
/uninstalllib.sh
$(DESTDIR
)$(LIBDIR
) $(SHARED_LIBS
)
172 @
$(SHELL
) $(srcdir)/script
/uninstalllib.sh
$(DESTDIR
)$(LIBDIR
) $(STATIC_LIBS
)
175 @
$(SHELL
) $(srcdir)/script
/uninstallheader.sh
$(DESTDIR
)$(INCLUDEDIR
) $(PUBLIC_HEADERS
)
178 @
$(SHELL
) $(srcdir)/script
/uninstallman.sh
$(DESTDIR
)$(MANDIR
) $(MANPAGES
)
180 Makefile
: config.status
$(MK_FILES
)
184 etags
`find $(srcdir) -name "*.[ch]"`
187 ctags
`find $(srcdir) -name "*.[ch]"`
189 pidl
/Makefile
: pidl
/Makefile.PL
190 cd pidl
&& $(PERL
) Makefile.PL
192 installpidl
: pidl
/Makefile
193 $(MAKE
) -C pidl
install
195 uninstallpidl
: pidl
/Makefile
196 $(MAKE
) -C pidl
uninstall
198 $(IDL_HEADER_FILES
) \
199 $(IDL_NDR_PARSE_H_FILES
) $(IDL_NDR_PARSE_C_FILES
) \
200 $(IDL_NDR_CLIENT_C_FILES
) $(IDL_NDR_CLIENT_H_FILES
) \
201 $(IDL_NDR_SERVER_C_FILES
) $(IDL_SWIG_FILES
) \
202 $(IDL_NDR_EJS_C_FILES
) $(IDL_NDR_EJS_H_FILES
): idl
204 idl_full
: pidl
/lib
/Parse
/Pidl
/IDL.pm
205 @CPP
="$(CPP)" PERL
="$(PERL)" srcdir=$(srcdir) $(srcdir)/script
/build_idl.sh FULL
$(PIDL_ARGS
)
207 idl
: pidl
/lib
/Parse
/Pidl
/IDL.pm
208 @CPP
="$(CPP)" PERL
="$(PERL)" srcdir=$(srcdir) $(srcdir)/script
/build_idl.sh PARTIAL
$(PIDL_ARGS
)
210 pidl
/lib
/Parse
/Pidl
/IDL.pm
: pidl
/idl.yp
211 -$(YAPP
) -s
-m
'Parse::Pidl::IDL' -o pidl
/lib
/Parse
/Pidl
/IDL.pm pidl
/idl.yp ||\
212 touch pidl
/lib
/Parse
/Pidl
/IDL.pm
214 smb_interfaces
: pidl
/smb_interfaces.pm
215 $(PERL
) -Ipidl
$(srcdir)/script
/build_smb_interfaces.pl \
216 include/smb_interfaces.h
218 pidl
/smb_interfaces.pm
: pidl
/smb_interfaces.yp
219 -$(YAPP
) -s
-m
'smb_interfaces' -o pidl
/smb_interfaces.pm pidl
/smb_interfaces.yp ||\
220 touch pidl
/smb_interfaces.pm
223 @echo
"include/config.h not present"
224 @echo
"You need to rerun ./autogen.sh and ./configure"
227 $(srcdir)/version.h
: $(srcdir)/VERSION
228 @
$(SHELL
) script
/mkversion.sh VERSION
$(srcdir)/version.h
$(srcdir)/
231 @
$(SHELL
) script
/mkversion.sh VERSION
$(srcdir)/version.h
$(srcdir)/
234 @echo
"Removing precompiled headers"
235 @
-rm -f
include/includes.h.gch
237 pch
: clean_pch
include/includes.h.gch
240 @echo Removing objects
241 @
-find .
-name
'*.o' -exec
rm -f
'{}' \
;
242 @echo Removing hostcc objects
243 @
-find .
-name
'*.ho' -exec
rm -f
'{}' \
;
244 @echo Removing binaries
245 @
-rm -f
$(BIN_PROGS
) $(SBIN_PROGS
) $(BINARIES
)
246 @echo Removing libraries
247 @
-rm -f
$(STATIC_LIBRARIES
) $(SHARED_LIBRARIES
)
248 @
-rm -f bin
/*.
$(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
270 -rm -f
*.bak
*~
*/*.bak
*/*~
*/*/*.bak
*/*/*~
*/*/*/*.bak
*/*/*/*~
272 realdistclean
: distclean removebackup
273 -rm -f
include/config_tmp.h.in
278 test: $(DEFAULT_TEST_TARGET
)
281 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} all SOCKET_WRAPPER
284 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} all
287 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} quick SOCKET_WRAPPER
290 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} xterm SOCKET_WRAPPER
292 valgrindtest
: valgrindtest-quick
294 valgrindtest-quick
: all
295 SMBD_VALGRIND
="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
296 VALGRIND
="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
297 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} quick SOCKET_WRAPPER
299 valgrindtest-all
: 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 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} all SOCKET_WRAPPER
304 gdbtest
: gdbtest-quick
307 SMBD_VALGRIND
="xterm -n smbd -e gdb --args " \
308 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} quick SOCKET_WRAPPER
311 SMBD_VALGRIND
="xterm -n smbd -e gdb --args " \
312 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} all SOCKET_WRAPPER
315 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} win
318 $(srcdir)/script
/find_unused_macros.pl
`find . -name "*.[ch]"` |
sort
320 ###############################################################################
322 ###############################################################################
324 .SUFFIXES
: .x .c .et .y .l .d .o .h .h.gch .a .so
.1 .1.xml
.3 .3.xml
.5 .5.xml
.7 .7.xml
.8 .8.xml .ho .idl .hd
327 @echo
"Generating dependencies for $<"
328 @
$(CC
) -M
-MG
-MP
-MT
$(<:.c
=.o
) -MT
$@
`$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS
) $< -o
$@
331 @echo
"Generating host-compiler dependencies for $<"
332 @
$(CC
) -M
-MG
-MP
-MT
$(<:.c
=.ho
) -MT
$@
`$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS
) $< -o
$@
334 include/includes.d
: include/includes.h
335 @echo
"Generating dependencies for $<"
336 @
$(CC
) -M
-MG
-MT
include/includes.h.gch
-MT
$@
$(CFLAGS
) $< -o
$@
339 # $< is broken in older BSD versions:
340 # when $@ is foo/bar.o, $< could be torture/foo/bar.c
341 # if it also exists. So better use $* which is foo/bar
342 # and append .c manually to get foo/bar.c
345 @if
test -n
"$(CC_CHECKER)"; then \
346 echo
"Checking $*.c with '$(CC_CHECKER)'"; \
347 $(CC_CHECKER
) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS
) $(PICFLAG
) -c
$*.c
-o
$@
; \
349 @echo
"Compiling $*.c"
350 @
$(CC
) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS
) $(PICFLAG
) -c
$*.c
-o
$@
&& exit
0;\
351 echo
"The following command failed:" 1>&2;\
352 echo
"$(CC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) $(PICFLAG) -c $*.c -o $@" 1>&2;\
353 $(CC
) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS
) $(PICFLAG
) -c
$*.c
-o
$@
>/dev
/null
2>&1
356 @echo
"Compiling $*.c with host compiler"
357 @
$(HOSTCC
) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS
) -c
$*.c
-o
$@
&& exit
0;\
358 echo
"The following command failed:" 1>&2;\
359 echo
"$(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS) -c $*.c -o $@" 1>&2;\
360 $(HOSTCC
) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS
) -c
$*.c
-o
$@
>/dev
/null
2>&1
363 @echo
"Precompiling $<"
364 @
$(CC
) -Ilib
/replace
`$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS
) $(PICFLAG
) -c
$< -o
$@
367 @echo
"Building $< with $(YACC)"
368 @
-$(srcdir)/script
/yacc_compile.sh
"$(YACC)" "$<" "$@"
371 @echo
"Building $< with $(LEX)"
372 @
-$(srcdir)/script
/lex_compile.sh
"$(LEX)" "$<" "$@"
374 DOCBOOK_MANPAGE_URL
= http
://docbook.sourceforge.net
/release
/xsl
/current
/manpages
/docbook.xsl
377 $(XSLTPROC
) -o
$@
$(DOCBOOK_MANPAGE_URL
) $<
380 $(XSLTPROC
) -o
$@
$(DOCBOOK_MANPAGE_URL
) $<
383 $(XSLTPROC
) -o
$@
$(DOCBOOK_MANPAGE_URL
) $<
386 $(XSLTPROC
) -o
$@
$(DOCBOOK_MANPAGE_URL
) $<
389 $(XSLTPROC
) -o
$@
$(DOCBOOK_MANPAGE_URL
) $<
391 DEP_FILES
= $(patsubst %.ho
,%.hd
,$(patsubst %.o
,%.d
,$(ALL_OBJS
))) \
394 dist:: distclean idl_full manpages configure
400 @echo Removing dependency files
401 @find .
-name \
*.d
-o
-name \
*.hd | xargs
rm -f