1 all: basics bin/asn1_compile bin/compile_et binaries
3 include heimdal_build/config.mk
8 include smbd/process_model.mk
9 include libnet/config.mk
10 include auth/config.mk
11 include nsswitch/config.mk
13 include param/config.mk
14 include smb_server/config.mk
15 include rpc_server/config.mk
16 include ldap_server/config.mk
17 include web_server/config.mk
18 include winbind/config.mk
19 include nbt_server/config.mk
20 include wrepl_server/config.mk
21 include cldap_server/config.mk
22 include utils/net/config.mk
23 include utils/config.mk
24 include ntvfs/config.mk
25 include ntptr/config.mk
26 include torture/config.mk
27 include librpc/config.mk
28 include client/config.mk
29 include libcli/config.mk
30 include scripting/config.mk
32 include passdb/config.mk
34 DEFAULT_HEADERS = $(srcdir)/include/nterr.h $(srcdir)/include/nt_status.h \
35 $(srcdir)/include/smb.h $(srcdir)/include/core.h
38 libraries: $(STATIC_LIBS) $(SHARED_LIBS)
39 modules: $(SHARED_MODULES)
40 headers: $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
45 @echo 'Samba will be installed into:'
46 @echo ' basedir: $(BASEDIR)'
47 @echo ' bindir: $(BINDIR)'
48 @echo ' sbindir: $(SBINDIR)'
49 @echo ' libdir: $(LIBDIR)'
50 @echo ' modulesdir: $(MODULESDIR)'
51 @echo ' includedir: $(INCLUDEDIR)'
52 @echo ' vardir: $(VARDIR)'
53 @echo ' privatedir: $(PRIVATEDIR)'
54 @echo ' piddir: $(PIDDIR)'
55 @echo ' lockdir: $(LOCKDIR)'
56 @echo ' logfilebase: $(LOGFILEBASE)'
57 @echo ' setupdir: $(SETUPDIR)'
58 @echo ' jsdir: $(JSDIR)'
59 @echo ' swatdir: $(SWATDIR)'
60 @echo ' mandir: $(MANDIR)'
63 @echo 'Samba will be compiled with flags:'
64 @echo ' CFLAGS = $(CFLAGS)'
65 @echo ' LDFLAGS = $(LDFLAGS)'
66 @echo ' STLD_FLAGS = $(STLD_FLAGS)'
67 @echo ' SHLD_FLAGS = $(SHLD_FLAGS)'
68 @echo ' LIBS = $(LIBS)'
70 # The permissions to give the executables
73 # set these to where to find various files
74 # These can be overridden by command line switches (see smbd(8))
75 # or in smb.conf (see smb.conf(5))
76 CONFIGFILE = $(CONFIGDIR)/smb.conf
77 PKGCONFIGDIR = $(LIBDIR)/pkgconfig
78 LMHOSTSFILE = $(CONFIGDIR)/lmhosts
80 PATH_FLAGS = -DCONFIGFILE=\"$(CONFIGFILE)\" -DSBINDIR=\"$(SBINDIR)\" \
81 -DBINDIR=\"$(BINDIR)\" -DLMHOSTSFILE=\"$(LMHOSTSFILE)\" \
82 -DLOCKDIR=\"$(LOCKDIR)\" -DPIDDIR=\"$(PIDDIR)\" -DLIBDIR=\"$(LIBDIR)\" \
83 -DLOGFILEBASE=\"$(LOGFILEBASE)\" -DSHLIBEXT=\"$(SHLIBEXT)\" \
84 -DCONFIGDIR=\"$(CONFIGDIR)\" -DNCALRPCDIR=\"$(NCALRPCDIR)\" \
85 -DSWATDIR=\"$(SWATDIR)\" -DPRIVATE_DIR=\"$(PRIVATEDIR)\" \
86 -DMODULESDIR=\"$(MODULESDIR)\"
88 install: showlayout installbin installdat installswat installmisc installlib \
89 installheader installpc
91 # DESTDIR is used here to prevent packagers wasting their time
92 # duplicating the Makefile. Remove it and you will have the privilege
93 # of packaging each samba release for multiple versions of multiple
94 # distributions and operating systems, or at least supplying patches
95 # to all the packaging files required for this, prior to committing
96 # the removal of DESTDIR. Do not remove it even though you think it
100 @$(SHELL) $(srcdir)/script/installdirs.sh \
101 $(DESTDIR)$(BASEDIR) \
102 $(DESTDIR)$(BINDIR) \
103 $(DESTDIR)$(SBINDIR) \
104 $(DESTDIR)$(LIBDIR) \
105 $(DESTDIR)$(VARDIR) \
106 $(DESTDIR)$(PRIVATEDIR) \
107 $(DESTDIR)$(PIDDIR) \
108 $(DESTDIR)$(LOCKDIR) \
109 $(DESTDIR)$(LOGFILEBASE) \
110 $(DESTDIR)$(PRIVATEDIR)/tls \
111 $(DESTDIR)$(INCLUDEDIR) \
112 $(DESTDIR)$(PKGCONFIGDIR)
114 installbin: $(SBIN_PROGS) $(BIN_PROGS) installdirs
115 @$(SHELL) $(srcdir)/script/installbin.sh \
117 $(DESTDIR)$(BASEDIR) \
118 $(DESTDIR)$(SBINDIR) \
119 $(DESTDIR)$(LIBDIR) \
120 $(DESTDIR)$(VARDIR) \
122 @$(SHELL) $(srcdir)/script/installbin.sh \
124 $(DESTDIR)$(BASEDIR) \
125 $(DESTDIR)$(BINDIR) \
126 $(DESTDIR)$(LIBDIR) \
127 $(DESTDIR)$(VARDIR) \
130 installlib: libraries installdirs
131 @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(LIBDIR) $(SHARED_LIBS)
132 @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(LIBDIR) $(STATIC_LIBS)
134 installheader: headers installdirs
135 @$(SHELL) $(srcdir)/script/installheader.sh $(DESTDIR)$(INCLUDEDIR) $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
137 installdat: installdirs
138 @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(LIBDIR) $(srcdir)
140 installswat: installdirs
141 @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir) $(DESTDIR)$(LIBDIR)
143 installman: installdirs
144 @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(MANDIR) $(MANPAGES)
146 installmisc: installdirs
147 @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(JSDIR) $(DESTDIR)$(SETUPDIR) $(DESTDIR)$(BINDIR)
149 installpc: installdirs
150 @$(SHELL) $(srcdir)/script/installpc.sh $(srcdir) $(DESTDIR)$(PKGCONFIGDIR) $(PC_FILES)
152 uninstall: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader
158 @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(SBIN_PROGS)
159 @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(BIN_PROGS)
162 @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(LIBDIR) $(SHARED_LIBS)
163 @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(LIBDIR) $(STATIC_LIBS)
166 @$(SHELL) $(srcdir)/script/uninstallheader.sh $(DESTDIR)$(INCLUDEDIR) $(PUBLIC_HEADERS)
169 @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(MANPAGES)
171 Makefile: config.status $(MK_FILES)
175 etags `find $(srcdir) -name "*.[ch]"`
178 ctags `find $(srcdir) -name "*.[ch]"`
180 pidl/Makefile: pidl/Makefile.PL
181 cd pidl && $(PERL) Makefile.PL
183 installpidl: pidl/Makefile
184 cd pidl && $(MAKE) install
186 IDL_FILES = $(wildcard librpc/idl/*.idl)
187 IDL_HEADER_FILES = $(patsubst librpc/idl/%.idl,librpc/gen_ndr/%.h,$(IDL_FILES))
188 IDL_NDR_HEADER_FILES = $(patsubst librpc/idl/%.idl,librpc/gen_ndr/ndr_%.h,$(IDL_FILES))
189 IDL_NDR_PARSE_C_FILES = $(patsubst librpc/idl/%.idl,librpc/gen_ndr/ndr_%.c,$(IDL_FILES))
190 IDL_NDR_CLIENT_C_FILES = $(patsubst librpc/idl/%.idl,librpc/gen_ndr/ndr_%_c.c,$(IDL_FILES))
191 IDL_NDR_SERVER_C_FILES = $(patsubst librpc/idl/%.idl,librpc/gen_ndr/ndr_%_s.c,$(IDL_FILES))
192 IDL_NDR_EJS_C_FILES = $(patsubst librpc/idl/%.idl,librpc/gen_ndr/ndr_%_ejs.c,$(IDL_FILES))
193 IDL_NDR_EJS_H_FILES = $(patsubst librpc/idl/%.idl,librpc/gen_ndr/ndr_%_ejs.h,$(IDL_FILES))
195 $(IDL_HEADER_FILES): idl
196 $(IDL_NDR_HEADER_FILES): idl
197 $(IDL_NDR_PARSE_C_FILES): idl
198 $(IDL_NDR_CLIENT_C_FILES): idl
199 $(IDL_NDR_SERVER_C_FILES): idl
200 $(IDL_NDR_EJS_C_FILES): idl
201 $(IDL_NDR_EJS_H_FILES): idl
203 idl_full: pidl/lib/Parse/Pidl/IDL.pm
204 @CPP="$(CPP)" PERL="$(PERL)" script/build_idl.sh FULL $(PIDL_ARGS)
206 idl: pidl/lib/Parse/Pidl/IDL.pm
207 @CPP="$(CPP)" PERL="$(PERL)" script/build_idl.sh PARTIAL $(PIDL_ARGS)
209 pidl/lib/Parse/Pidl/IDL.pm: pidl/idl.yp
210 -$(YAPP) -s -m 'Parse::Pidl::IDL' -o pidl/lib/Parse/Pidl/IDL.pm pidl/idl.yp
212 smb_interfaces: pidl/smb_interfaces.pm
213 $(PERL) -Ipidl script/build_smb_interfaces.pl \
214 include/smb_interfaces.h
216 pidl/smb_interfaces.pm: pidl/smb_interfaces.yp
217 -$(YAPP) -s -m 'smb_interfaces' -o pidl/smb_interfaces.pm pidl/smb_interfaces.yp
220 @echo "include/config.h not present"
221 @echo "You need to rerun ./autogen.sh and ./configure"
224 include/proto.h: $(PROTO_OBJS:.o=.c)
225 @echo "Creating include/proto.h"
226 @$(PERL) $(srcdir)/script/mkproto.pl --public-define=_PROTO_H_ \
227 --public=include/proto.h --private=include/proto.h \
230 proto: include/proto.h
232 librpc/gen_ndr/misc.h: idl
233 librpc/ndr/libndr.h: librpc/ndr/libndr_proto.h librpc/gen_ndr/misc.h
234 librpc/rpc/dcerpc.h: librpc/rpc/dcerpc_proto.h
235 auth/credentials/credentials.h: auth/credentials/credentials_proto.h
236 libcli/nbt/libnbt.h: libcli/nbt/nbt_proto.h
237 lib/charset/charset.h: lib/charset/charset_proto.h
239 include/includes.h: \
242 librpc/ndr/libndr.h \
243 librpc/rpc/dcerpc.h \
244 auth/credentials/credentials_proto.h \
245 libcli/nbt/libnbt.h \
247 lib/charset/charset.h
250 -rm -f include/includes.h.gch
252 pch: clean_pch include/includes.h.gch
254 basics: include/includes.h \
259 clean: heimdal_clean clean_pch
260 @echo Removing headers
261 @-rm -f include/proto.h
262 @echo Removing objects
263 @-find . -name '*.o' -exec rm -f '{}' \;
264 @echo Removing hostcc objects
265 @-find . -name '*.ho' -exec rm -f '{}' \;
266 @echo Removing binaries
267 @-rm -f $(BIN_PROGS) $(SBIN_PROGS)
268 @echo Removing libraries
269 @-rm -f bin/*.$(SHLIBEXT).*
270 @echo Removing dummy targets
272 @echo Removing generated files
273 @-rm -rf librpc/gen_*
274 @-rm -f lib/registry/regf.h lib/registry/tdr_regf*
275 @echo Removing proto headers
276 @-rm -f $(PROTO_HEADERS)
279 -rm -f include/config.h include/smb_build.h
282 -rm -f config.log config.cache
283 -rm -f samba4-deps.dot
284 -rm -f config.pm config.mk
287 -rm -f *.bak *~ */*.bak */*~ */*/*.bak */*/*~ */*/*/*.bak */*/*/*~
289 realdistclean: distclean removebackup
290 -rm -f include/config.h.in
291 -rm -f include/version.h
295 test: $(DEFAULT_TEST_TARGET)
298 ./script/tests/selftest.sh ${selftest_prefix}/st all SOCKET_WRAPPER
301 ./script/tests/selftest.sh ${selftest_prefix}/st all
304 ./script/tests/selftest.sh ${selftest_prefix}/st quick SOCKET_WRAPPER
307 SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
308 VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/st/valgrind.log" \
309 ./script/tests/selftest.sh ${selftest_prefix}/st quick SOCKET_WRAPPER
312 SMBD_VALGRIND="xterm -n smbd -e gdb --args " \
313 ./script/tests/selftest.sh ${selftest_prefix}/st quick SOCKET_WRAPPER
316 ./script/find_unused_macros.pl `find . -name "*.[ch]"` | sort
318 ###############################################################################
320 ###############################################################################
323 @echo "Generating dependencies for $<"
324 @$(CC) -MM -MG -MT $(<:.c=.o) -MF $@ $(CFLAGS) $<
327 @echo "Building $< with $(YACC)"
328 @-$(srcdir)/script/yacc_compile.sh "$(YACC)" "$<" "$@"
331 @echo "Building $< with $(LEX)"
332 @-$(srcdir)/script/lex_compile.sh "$(LEX)" "$<" "$@"
334 DOCBOOK_MANPAGE_URL = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
337 $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
340 $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
343 $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
346 $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
349 $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<