1 all: $(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)/include/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:'
69 @echo
' CFLAGS = $(CFLAGS)'
70 @echo
' LDFLAGS = $(LDFLAGS)'
71 @echo
' STLD_FLAGS = $(STLD_FLAGS)'
72 @echo
' SHLD_FLAGS = $(SHLD_FLAGS)'
73 @echo
' LIBS = $(LIBS)'
75 # The permissions to give the executables
78 # set these to where to find various files
79 # These can be overridden by command line switches (see smbd(8))
80 # or in smb.conf (see smb.conf(5))
81 CONFIGFILE
= $(CONFIGDIR
)/smb.conf
82 PKGCONFIGDIR
= $(LIBDIR
)/pkgconfig
83 LMHOSTSFILE
= $(CONFIGDIR
)/lmhosts
85 install: showlayout installbin installdat installswat installmisc installlib \
86 installheader installpc installplugins
88 # DESTDIR is used here to prevent packagers wasting their time
89 # duplicating the Makefile. Remove it and you will have the privilege
90 # of packaging each samba release for multiple versions of multiple
91 # distributions and operating systems, or at least supplying patches
92 # to all the packaging files required for this, prior to committing
93 # the removal of DESTDIR. Do not remove it even though you think it
97 @
$(SHELL
) $(srcdir)/script
/installdirs.sh \
98 $(DESTDIR
)$(BASEDIR
) \
100 $(DESTDIR
)$(SBINDIR
) \
101 $(DESTDIR
)$(LIBDIR
) \
102 $(DESTDIR
)$(MODULESDIR
) \
103 $(DESTDIR
)$(MANDIR
) \
104 $(DESTDIR
)$(VARDIR
) \
105 $(DESTDIR
)$(PRIVATEDIR
) \
106 $(DESTDIR
)$(DATADIR
) \
107 $(DESTDIR
)$(PIDDIR
) \
108 $(DESTDIR
)$(LOCKDIR
) \
109 $(DESTDIR
)$(LOGFILEBASE
) \
110 $(DESTDIR
)$(PRIVATEDIR
)/tls \
111 $(DESTDIR
)$(INCLUDEDIR
) \
112 $(DESTDIR
)$(PKGCONFIGDIR
) \
113 $(DESTDIR
)$(CONFIGDIR
) \
115 installbin
: $(SBIN_PROGS
) $(BIN_PROGS
) installdirs
116 @
$(SHELL
) $(srcdir)/script
/installbin.sh \
118 $(DESTDIR
)$(BASEDIR
) \
119 $(DESTDIR
)$(SBINDIR
) \
120 $(DESTDIR
)$(LIBDIR
) \
121 $(DESTDIR
)$(VARDIR
) \
123 @
$(SHELL
) $(srcdir)/script
/installbin.sh \
125 $(DESTDIR
)$(BASEDIR
) \
126 $(DESTDIR
)$(BINDIR
) \
127 $(DESTDIR
)$(LIBDIR
) \
128 $(DESTDIR
)$(VARDIR
) \
131 installlib
: $(INSTALLABLE_SHARED_LIBS
) $(STATIC_LIBS
) installdirs
132 @
$(SHELL
) $(srcdir)/script
/installlib.sh
$(DESTDIR
)$(LIBDIR
) "$(SHLIBEXT)" $(INSTALLABLE_SHARED_LIBS
)
133 @
$(SHELL
) $(srcdir)/script
/installlib.sh
$(DESTDIR
)$(LIBDIR
) "$(STLIBEXT)" $(STATIC_LIBS
)
135 installheader
: headers
installdirs
136 @
$(PERL
) $(srcdir)/script
/installheader.pl
$(DESTDIR
)$(INCLUDEDIR
) $(PUBLIC_HEADERS
) $(DEFAULT_HEADERS
)
138 installdat
: installdirs
139 @
$(SHELL
) $(srcdir)/script
/installdat.sh
$(DESTDIR
)$(DATADIR
) $(srcdir)
141 installswat
: installdirs
142 @
$(SHELL
) $(srcdir)/script
/installswat.sh
$(DESTDIR
)$(SWATDIR
) $(srcdir)
144 installman
: manpages
installdirs
145 @
$(SHELL
) $(srcdir)/script
/installman.sh
$(DESTDIR
)$(MANDIR
) $(MANPAGES
)
147 installmisc
: installdirs
148 @
$(SHELL
) $(srcdir)/script
/installmisc.sh
$(srcdir) $(DESTDIR
)$(JSDIR
) $(DESTDIR
)$(SETUPDIR
) $(DESTDIR
)$(BINDIR
)
150 installpc
: installdirs
151 @
$(SHELL
) $(srcdir)/script
/installpc.sh
$(builddir
) $(DESTDIR
)$(PKGCONFIGDIR
) $(PC_FILES
)
153 uninstall: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader \
160 @
$(SHELL
) $(srcdir)/script
/uninstallbin.sh
$(INSTALLPERMS
) $(DESTDIR
)$(BASEDIR
) $(DESTDIR
)$(SBINDIR
) $(DESTDIR
)$(LIBDIR
) $(DESTDIR
)$(VARDIR
) $(DESTDIR
)$(SBIN_PROGS
)
161 @
$(SHELL
) $(srcdir)/script
/uninstallbin.sh
$(INSTALLPERMS
) $(DESTDIR
)$(BASEDIR
) $(DESTDIR
)$(BINDIR
) $(DESTDIR
)$(LIBDIR
) $(DESTDIR
)$(VARDIR
) $(DESTDIR
)$(BIN_PROGS
)
164 @
$(SHELL
) $(srcdir)/script
/uninstalllib.sh
$(DESTDIR
)$(LIBDIR
) $(SHARED_LIBS
)
165 @
$(SHELL
) $(srcdir)/script
/uninstalllib.sh
$(DESTDIR
)$(LIBDIR
) $(STATIC_LIBS
)
168 @
$(SHELL
) $(srcdir)/script
/uninstallheader.sh
$(DESTDIR
)$(INCLUDEDIR
) $(PUBLIC_HEADERS
)
171 @
$(SHELL
) $(srcdir)/script
/uninstallman.sh
$(DESTDIR
)$(MANDIR
) $(MANPAGES
)
173 Makefile
: config.status
$(MK_FILES
)
177 etags
`find $(srcdir) -name "*.[ch]"`
180 ctags
`find $(srcdir) -name "*.[ch]"`
182 pidl
/Makefile
: pidl
/Makefile.PL
183 cd pidl
&& $(PERL
) Makefile.PL
185 installpidl
: pidl
/Makefile
186 $(MAKE
) -C pidl
install
188 uninstallpidl
: pidl
/Makefile
189 $(MAKE
) -C pidl
uninstall
191 include heimdal_build
/perl_path_wrapper.sh ..
/librpc
/idl-deps.pl librpc
/idl
/*.idl|
193 $(IDL_HEADER_FILES
) \
194 $(IDL_NDR_PARSE_H_FILES
) $(IDL_NDR_PARSE_C_FILES
) \
195 $(IDL_NDR_CLIENT_C_FILES
) $(IDL_NDR_CLIENT_H_FILES
) \
196 $(IDL_NDR_SERVER_C_FILES
) $(IDL_SWIG_FILES
) \
197 $(IDL_NDR_EJS_C_FILES
) $(IDL_NDR_EJS_H_FILES
): idl
199 idl_full
: pidl
/lib
/Parse
/Pidl
/IDL.pm
200 @CPP
="$(CPP)" PERL
="$(PERL)" srcdir=$(srcdir) $(srcdir)/script
/build_idl.sh FULL
$(PIDL_ARGS
)
202 idl
: pidl
/lib
/Parse
/Pidl
/IDL.pm
203 @CPP
="$(CPP)" PERL
="$(PERL)" srcdir=$(srcdir) $(srcdir)/script
/build_idl.sh PARTIAL
$(PIDL_ARGS
)
205 pidl
/lib
/Parse
/Pidl
/IDL.pm
: pidl
/idl.yp
206 -$(YAPP
) -s
-m
'Parse::Pidl::IDL' -o pidl
/lib
/Parse
/Pidl
/IDL.pm pidl
/idl.yp
208 smb_interfaces
: pidl
/smb_interfaces.pm
209 $(PERL
) -Ipidl
$(srcdir)/script
/build_smb_interfaces.pl \
210 include/smb_interfaces.h
212 pidl
/smb_interfaces.pm
: pidl
/smb_interfaces.yp
213 -$(YAPP
) -s
-m
'smb_interfaces' -o pidl
/smb_interfaces.pm pidl
/smb_interfaces.yp
216 @echo
"include/config.h not present"
217 @echo
"You need to rerun ./autogen.sh and ./configure"
221 @echo
"Removing precompiled headers"
222 @
-rm -f
include/includes.h.gch
224 pch
: clean_pch
include/includes.h.gch
227 @echo Removing objects
228 @
-find .
-name
'*.o' -exec
rm -f
'{}' \
;
229 @echo Removing hostcc objects
230 @
-find .
-name
'*.ho' -exec
rm -f
'{}' \
;
231 @echo Removing binaries
232 @
-rm -f
$(BIN_PROGS
) $(SBIN_PROGS
) $(BINARIES
)
233 @echo Removing libraries
234 @
-rm -f
$(STATIC_LIBRARIES
) $(SHARED_LIBRARIES
)
235 @
-rm -f bin
/*.
$(SHLIBEXT
)*
237 @echo Removing modules
238 @
-rm -f bin
/modules
/*/*.
$(SHLIBEXT
)
239 @
-rm -f bin
/*_init_module.c
240 @echo Removing dummy targets
242 @echo Removing generated files
243 @
-rm -f bin
/*_init_module.c
244 @
-rm -rf librpc
/gen_
*
245 @echo Removing proto headers
246 @
-rm -f
$(PROTO_HEADERS
)
249 -rm -f
include/config.h
include/config_tmp.h
include/build.h
252 -rm -f config.log config.cache
253 -rm -f config.pm config.mk
257 -rm -f
*.bak
*~
*/*.bak
*/*~
*/*/*.bak
*/*/*~
*/*/*/*.bak
*/*/*/*~
259 realdistclean
: distclean removebackup
260 -rm -f
include/config_tmp.h.in
265 test: $(DEFAULT_TEST_TARGET
)
268 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} all SOCKET_WRAPPER
271 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} all
274 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} quick SOCKET_WRAPPER
276 valgrindtest
: valgrindtest-quick
278 valgrindtest-quick
: all
279 SMBD_VALGRIND
="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
280 VALGRIND
="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
281 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} quick SOCKET_WRAPPER
283 valgrindtest-all
: all
284 SMBD_VALGRIND
="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
285 VALGRIND
="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
286 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} all SOCKET_WRAPPER
288 gdbtest
: gdbtest-quick
291 SMBD_VALGRIND
="xterm -n smbd -e gdb --args " \
292 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} quick SOCKET_WRAPPER
295 SMBD_VALGRIND
="xterm -n smbd -e gdb --args " \
296 $(srcdir)/script
/tests
/selftest.sh
${selftest_prefix} all SOCKET_WRAPPER
299 $(srcdir)/script
/find_unused_macros.pl
`find . -name "*.[ch]"` |
sort
301 ###############################################################################
303 ###############################################################################
305 .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
308 @echo
"Compiling $< with host compiler"
309 @
$(HOSTCC
) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS
) -c
$< -o
$@
312 @echo
"Generating dependencies for $<"
313 @
$(CC
) -M
-MG
-MP
-MT
$(<:.c
=.o
) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS
) $< -o
$@
316 @echo
"Generating host-compiler dependencies for $<"
317 @
$(CC
) -M
-MG
-MP
-MT
$(<:.c
=.ho
) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS
) $< -o
$@
319 include/includes.d
: include/includes.h
320 @echo
"Generating dependencies for $<"
321 @
$(CC
) -M
-MG
-MT
include/includes.h.gch
$(CFLAGS
) $< -o
$@
324 @if
test -n
"$(CC_CHECKER)"; then \
325 echo
"Checking $< with '$(CC_CHECKER)'"; \
326 $(CC_CHECKER
) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS
) $(PICFLAG
) -c
$< -o
$@
; \
329 @
$(CC
) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS
) $(PICFLAG
) -c
$< -o
$@
332 @echo
"Precompiling $<"
333 @
$(CC
) `$(PERL) $(srcdir)/script/cflags.pl $@` $(CFLAGS
) $(PICFLAG
) -c
$< -o
$@
336 @echo
"Building $< with $(YACC)"
337 @
-$(srcdir)/script
/yacc_compile.sh
"$(YACC)" "$<" "$@"
340 @echo
"Building $< with $(LEX)"
341 @
-$(srcdir)/script
/lex_compile.sh
"$(LEX)" "$<" "$@"
343 DOCBOOK_MANPAGE_URL
= http
://docbook.sourceforge.net
/release
/xsl
/current
/manpages
/docbook.xsl
346 $(XSLTPROC
) -o
$@
$(DOCBOOK_MANPAGE_URL
) $<
349 $(XSLTPROC
) -o
$@
$(DOCBOOK_MANPAGE_URL
) $<
352 $(XSLTPROC
) -o
$@
$(DOCBOOK_MANPAGE_URL
) $<
355 $(XSLTPROC
) -o
$@
$(DOCBOOK_MANPAGE_URL
) $<
358 $(XSLTPROC
) -o
$@
$(DOCBOOK_MANPAGE_URL
) $<
360 DEP_FILES
= $(patsubst %.ho
,%.hd
,$(patsubst %.o
,%.d
,$(ALL_OBJS
))) \
363 dist:: distclean idl_full manpages configure
369 @echo Removing dependency files
370 @find .
-name \
*.d
-o
-name \
*.hd | xargs
rm -f