2 # The Samba 4 Makefile.
3 # This file is *NOT* autogenerated.
11 pidldir := $(srcdir)/pidl
14 TORTUREDIR = $(libdir)/torture
15 SWATDIR = $(datadir)/swat
17 SETUPDIR = $(datadir)/setup
18 NCALRPCDIR = $(localstatedir)/ncalrpc
21 BNLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
23 HOSTCC_FLAGS = -D_SAMBA_HOSTCC_ $(CFLAGS)
24 HOSTLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
26 $(srcdir)/version.h: $(srcdir)/VERSION
27 @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
29 ifneq ($(automatic_dependencies),yes)
35 @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
38 @echo "Removing precompiled headers"
39 @-rm -f include/includes.h.gch
41 pch:: clean_pch include/includes.h.gch
45 ifneq ($(automatic_dependencies),yes)
50 include $(srcdir)/build/make/rules.mk
51 include $(srcdir)/build/make/python.mk
52 zlibsrcdir := lib/zlib
53 dynconfigsrcdir := dynconfig
54 heimdalsrcdir := heimdal
57 clustersrcdir := cluster
58 libnetsrcdir := libnet
60 nsswitchsrcdir := nsswitch
62 libsocketsrcdir := lib/socket
63 libcharsetsrcdir := lib/charset
64 ldb_sambasrcdir := lib/ldb-samba
67 libtlssrcdir := lib/tls
68 libregistrysrcdir := lib/registry
69 smbreadlinesrcdir := lib/smbreadline
70 libmessagingsrcdir := lib/messaging
71 libeventssrcdir := lib/events
72 libcmdlinesrcdir := lib/cmdline
73 poptsrcdir := lib/popt
74 socketwrappersrcdir := lib/socket_wrapper
75 nsswrappersrcdir := lib/nss_wrapper
76 appwebsrcdir := lib/appweb
77 libstreamsrcdir := lib/stream
78 libutilsrcdir := lib/util
79 libtdrsrcdir := lib/tdr
80 libdbwrapsrcdir := lib/dbwrap
81 libcryptosrcdir := lib/crypto
82 libtorturesrcdir := lib/torture
83 smb_serversrcdir := smb_server
84 libcompressionsrcdir := lib/compression
85 libgencachesrcdir := lib
87 rpc_serversrcdir := rpc_server
88 ldap_serversrcdir := ldap_server
89 web_serversrcdir := web_server
90 winbindsrcdir := winbind
91 nbt_serversrcdir := nbt_server
92 wrepl_serversrcdir := wrepl_server
93 cldap_serversrcdir := cldap_server
95 clientsrcdir := client
96 torturesrcdir := torture
99 librpcsrcdir := librpc
100 libclisrcdir := libcli
101 ejsscriptsrcdir := scripting/ejs
102 pyscriptsrcdir := $(srcdir)/scripting/python
104 ntp_signdsrcdir := ntp_signd
108 pythonmods:: $(PYTHON_PYS) $(PYTHON_SO)
110 DEP_FILES = $(patsubst %.ho,%.hd,$(patsubst %.o,%.d,$(ALL_OBJS))) \
113 ifeq ($(automatic_dependencies),yes)
114 ifneq ($(MAKECMDGOALS),clean)
115 ifneq ($(MAKECMDGOALS),distclean)
116 ifneq ($(MAKECMDGOALS),realdistclean)
117 ifneq ($(SKIP_DEP_FILES),yes)
118 -include $(DEP_FILES)
124 ifneq ($(SKIP_DEP_FILES),yes)
126 @echo Removing dependency files
127 @find . -name '*.d' -o -name '*.hd' | xargs rm -f
130 include $(srcdir)/static_deps.mk
133 DEFAULT_HEADERS = $(srcdir)/lib/util/dlinklist.h \
136 libraries:: $(STATIC_LIBS) $(SHARED_LIBS)
138 headers:: $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
139 manpages:: $(MANPAGES)
140 all:: showflags $(ALL_PREDEP) binaries modules pythonmods libraries headers
143 LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)=$(builddir)/bin/shared
145 # 'make testsuite' creates all binaries which are
146 # needed by samba3's 'make test' and the build-farm
147 # scripts use that it as fallback in case
148 # 'make everything' fails
149 testsuite:: bin/smbclient bin/cifsdd bin/smbtorture bin/nmblookup
152 @echo 'Samba will be installed into:'
153 @echo ' basedir: $(BASEDIR)'
154 @echo ' bindir: $(bindir)'
155 @echo ' sbindir: $(sbindir)'
156 @echo ' libdir: $(libdir)'
157 @echo ' modulesdir: $(modulesdir)'
158 @echo ' includedir: $(includedir)'
159 @echo ' vardir: $(localstatedir)'
160 @echo ' privatedir: $(privatedir)'
161 @echo ' piddir: $(piddir)'
162 @echo ' lockdir: $(lockdir)'
163 @echo ' logfilebase: $(logfilebase)'
164 @echo ' setupdir: $(SETUPDIR)'
165 @echo ' jsdir: $(JSDIR)'
166 @echo ' swatdir: $(SWATDIR)'
167 @echo ' mandir: $(mandir)'
168 @echo ' torturedir: $(TORTUREDIR)'
169 @echo ' datadir: $(datadir)'
170 @echo ' winbindd_socket_dir: $(winbindd_socket_dir)'
171 @echo ' ntp_signd_socket_dir: $(ntp_signd_socket_dir)'
174 @echo ' srcdir = $(srcdir)'
175 @echo ' builddir = $(builddir)'
177 # The permissions to give the executables
180 install:: showlayout everything installbin installsbin installdat installswat installmisc \
181 installlib installheader installpc installplugins
183 # DESTDIR is used here to prevent packagers wasting their time
184 # duplicating the Makefile. Remove it and you will have the privilege
185 # of packaging each samba release for multiple versions of multiple
186 # distributions and operating systems, or at least supplying patches
187 # to all the packaging files required for this, prior to committing
188 # the removal of DESTDIR. Do not remove it even though you think it
192 @$(SHELL) $(srcdir)/script/installdirs.sh \
193 $(DESTDIR)$(BASEDIR) \
194 $(DESTDIR)$(bindir) \
195 $(DESTDIR)$(sbindir) \
196 $(DESTDIR)$(TORTUREDIR) \
197 $(DESTDIR)$(libdir) \
198 $(DESTDIR)$(modulesdir) \
199 $(DESTDIR)$(mandir) \
200 $(DESTDIR)$(localstatedir) \
201 $(DESTDIR)$(localstatedir)/lib \
202 $(DESTDIR)$(localstatedir)/run \
203 $(DESTDIR)$(privatedir) \
204 $(DESTDIR)$(datadir) \
205 $(DESTDIR)$(piddir) \
206 $(DESTDIR)$(lockdir) \
207 $(DESTDIR)$(logfilebase) \
208 $(DESTDIR)$(privatedir)/tls \
209 $(DESTDIR)$(includedir) \
210 $(DESTDIR)$(PKGCONFIGDIR) \
211 $(DESTDIR)$(sysconfdir)
213 installbin:: installdirs
217 installlib:: $(SHARED_LIBS) $(STATIC_LIBS) installdirs
218 @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(SHLIBEXT)" $(SHARED_LIBS)
219 #@$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(STLIBEXT)" $(STATIC_LIBS)
221 installheader:: headers installdirs
222 @srcdir=$(srcdir) builddir=$(builddir) $(PERL) $(srcdir)/script/installheader.pl $(DESTDIR)$(includedir) $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
224 installdat:: installdirs
225 @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(datadir) $(srcdir)
227 installswat:: installdirs
228 #SWAT has been disabled until further notice
229 # @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
231 installman:: manpages installdirs
232 @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(mandir) $(MANPAGES)
234 installmisc:: installdirs
235 @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(JSDIR) $(DESTDIR)$(SETUPDIR) $(DESTDIR)$(bindir)
237 installpc:: installdirs
238 @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(PKGCONFIGDIR) $(PC_FILES)
240 uninstall:: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader \
246 $(DESTDIR)$(bindir)/%: bin/% installdirs
248 @echo Installing $(@F) as $@
249 @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
251 @chmod $(INSTALLPERMS) $@
253 $(DESTDIR)$(sbindir)/%: bin/% installdirs
255 @echo Installing $(@F) as $@
256 @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
258 @chmod $(INSTALLPERMS) $@
263 @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS)
264 #@$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(STATIC_LIBS)
267 @$(SHELL) $(srcdir)/script/uninstallheader.sh $(DESTDIR)$(includedir) $(PUBLIC_HEADERS)
270 @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(mandir) $(MANPAGES)
275 @echo "config.status does not exist. Please run ./configure."
278 data.mk: config.status $(MK_FILES)
283 include $(pidldir)/config.mk
284 selftestdir := $(srcdir)/selftest
285 include $(selftestdir)/config.mk
288 @echo ' pwd = '`/bin/pwd`