Fix an uninitialized variable
[Samba.git] / source4 / Makefile
blob7bc48b9fe4bb4cd71d2c423a9474aa25f7046cd0
1 #!gmake
2 # The Samba 4 Makefile.
3 # This file is *NOT* autogenerated.
5 .DEFAULT_GOAL := all
7 default: all
9 include mkconfig.mk
11 pidldir := $(srcdir)/../pidl
13 basedir = $(prefix)
14 torturedir = ../lib/torture
15 swatdir = $(datadir)/swat
16 setupdir = $(datadir)/setup
17 ncalrpcdir = $(localstatedir)/ncalrpc
18 shliboutputdir = $(builddir)/bin/shared
20 BNLD = $(LD)
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)
30 ALL_PREDEP = basics
31 .NOTPARALLEL:
32 endif
34 regen_version::
35 @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
37 clean_pch::
38 @echo "Removing precompiled headers"
39 @-rm -f include/includes.h.gch
41 pch:: clean_pch include/includes.h.gch
43 .DEFAULT_GOAL := all
45 ifneq ($(automatic_dependencies),yes)
46 ALL_PREDEP = basics
47 .NOTPARALLEL:
48 endif
50 include $(srcdir)/build/make/rules.mk
51 include $(srcdir)/build/make/python.mk
52 zlibsrcdir := ../lib/zlib
53 dynconfigsrcdir := dynconfig
54 heimdalsrcdir := heimdal
55 dsdbsrcdir := dsdb
56 smbdsrcdir := smbd
57 clustersrcdir := cluster
58 libnetsrcdir := libnet
59 authsrcdir := auth
60 nsswitchsrcdir := ../nsswitch
61 libsrcdir := lib
62 libsocketsrcdir := lib/socket
63 libcharsetsrcdir := ../lib/util/charset
64 ldb_sambasrcdir := lib/ldb-samba
65 tdbsrcdir := ../lib/tdb
66 ldbsrcdir := lib/ldb
67 libtlssrcdir := lib/tls
68 libregistrysrcdir := lib/registry
69 smbreadlinesrcdir := lib/smbreadline
70 libmessagingsrcdir := lib/messaging
71 libteventsrcdir := ../lib/tevent
72 libeventssrcdir := lib/events
73 libcmdlinesrcdir := lib/cmdline
74 poptsrcdir := ../lib/popt
75 socketwrappersrcdir := ../lib/socket_wrapper
76 nsswrappersrcdir := ../lib/nss_wrapper
77 appwebsrcdir := lib/appweb
78 libstreamsrcdir := lib/stream
79 libutilsrcdir := ../lib/util
80 libtdrsrcdir := ../lib/tdr
81 libcryptosrcdir := ../lib/crypto
82 libtorturesrcdir := ../lib/torture
83 smb_serversrcdir := smb_server
84 libcompressionsrcdir := ../lib/compression
85 libgencachesrcdir := lib
86 paramsrcdir := param
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
94 utilssrcdir := utils
95 clientsrcdir := client
96 torturesrcdir := torture
97 ntvfssrcdir := ntvfs
98 ntptrsrcdir := ntptr
99 librpcsrcdir := librpc
100 libclisrcdir := libcli
101 libclicommonsrcdir := ../libcli
102 libclinbtsrcdir := ../libcli/nbt
103 pyscriptsrcdir := $(srcdir)/scripting/python
104 kdcsrcdir := kdc
105 ntp_signdsrcdir := ntp_signd
106 wmisrcdir := lib/wmi
107 tallocsrcdir := ../lib/talloc
108 comsrcdir := $(srcdir)/lib/com
109 libgpodir := libgpo
111 include data.mk
113 $(foreach SCRIPT,$(wildcard scripting/bin/*),$(eval $(call binary_install_template,$(SCRIPT))))
115 $(DESTDIR)$(bindir)/%: scripting/bin/% installdirs
116 @mkdir -p $(@D)
117 @echo Installing $(@F) as $@
118 @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
119 @cp $< $@
120 @chmod $(INSTALLPERMS) $@
122 pythonmods:: $(PYTHON_PYS) $(PYTHON_SO)
124 DEP_FILES = $(patsubst %.ho,%.hd,$(patsubst %.o,%.d,$(ALL_OBJS))) \
125 include/includes.d
127 ifeq ($(automatic_dependencies),yes)
128 ifneq ($(MAKECMDGOALS),clean)
129 ifneq ($(MAKECMDGOALS),distclean)
130 ifneq ($(MAKECMDGOALS),realdistclean)
131 ifneq ($(SKIP_DEP_FILES),yes)
132 -include $(DEP_FILES)
133 endif
134 endif
135 endif
136 endif
138 ifneq ($(SKIP_DEP_FILES),yes)
139 clean::
140 @echo Removing dependency files
141 @find . -name '*.d' -o -name '*.hd' | xargs rm -f
142 endif
143 else
144 include $(srcdir)/static_deps.mk
145 endif
147 clean::
148 @find ../lib ../libcli ../librpc ../libgpo ../nsswitch -name '*.o' -o -name '*.ho' | xargs rm -f
150 PUBLIC_HEADERS += ./version.h
152 libraries:: $(STATIC_LIBS) $(SHARED_LIBS)
153 modules:: $(PLUGINS)
154 headers:: $(PUBLIC_HEADERS)
155 manpages:: $(MANPAGES)
156 all:: showflags $(ALL_PREDEP) binaries modules pythonmods libraries headers
157 everything:: all
159 LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)=$(shliboutputdir)
161 # 'make testsuite' creates all binaries which are
162 # needed by samba3's 'make test' and the build-farm
163 # scripts use that it as fallback in case
164 # 'make everything' fails
165 testsuite:: bin/smbclient bin/cifsdd bin/smbtorture bin/nmblookup
167 showlayout::
168 @echo 'Samba will be installed into:'
169 @echo ' basedir: $(basedir)'
170 @echo ' bindir: $(bindir)'
171 @echo ' sbindir: $(sbindir)'
172 @echo ' libdir: $(libdir)'
173 @echo ' modulesdir: $(modulesdir)'
174 @echo ' includedir: $(includedir)'
175 @echo ' vardir: $(localstatedir)'
176 @echo ' privatedir: $(privatedir)'
177 @echo ' piddir: $(piddir)'
178 @echo ' lockdir: $(lockdir)'
179 @echo ' logfilebase: $(logfilebase)'
180 @echo ' setupdir: $(setupdir)'
181 @echo ' swatdir: $(swatdir)'
182 @echo ' mandir: $(mandir)'
183 @echo ' torturedir: $(torturedir)'
184 @echo ' datadir: $(datadir)'
185 @echo ' winbindd_socket_dir: $(winbindd_socket_dir)'
186 @echo ' ntp_signd_socket_dir: $(ntp_signd_socket_dir)'
188 showflags::
189 @echo ' srcdir = $(srcdir)'
190 @echo ' builddir = $(builddir)'
192 # The permissions to give the executables
193 INSTALLPERMS = 0755
195 install:: showlayout everything installbin installsbin installdat installmisc \
196 installlib installheader installpc installplugins
198 # DESTDIR is used here to prevent packagers wasting their time
199 # duplicating the Makefile. Remove it and you will have the privilege
200 # of packaging each samba release for multiple versions of multiple
201 # distributions and operating systems, or at least supplying patches
202 # to all the packaging files required for this, prior to committing
203 # the removal of DESTDIR. Do not remove it even though you think it
204 # is not used.
206 installdirs::
207 @$(SHELL) $(srcdir)/script/installdirs.sh \
208 $(DESTDIR)$(basedir) \
209 $(DESTDIR)$(bindir) \
210 $(DESTDIR)$(sbindir) \
211 $(DESTDIR)$(torturedir) \
212 $(DESTDIR)$(libdir) \
213 $(DESTDIR)$(modulesdir) \
214 $(DESTDIR)$(mandir) \
215 $(DESTDIR)$(localstatedir) \
216 $(DESTDIR)$(localstatedir)/lib \
217 $(DESTDIR)$(localstatedir)/run \
218 $(DESTDIR)$(privatedir) \
219 $(DESTDIR)$(datadir) \
220 $(DESTDIR)$(piddir) \
221 $(DESTDIR)$(lockdir) \
222 $(DESTDIR)$(logfilebase) \
223 $(DESTDIR)$(privatedir)/tls \
224 $(DESTDIR)$(includedir) \
225 $(DESTDIR)$(pkgconfigdir) \
226 $(DESTDIR)$(sysconfdir)
228 installbin:: installdirs
230 installplugins::
232 installlib:: $(SHARED_LIBS) $(STATIC_LIBS) installdirs
233 @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(SHLIBEXT)" $(SHARED_LIBS)
234 #@$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(STLIBEXT)" $(STATIC_LIBS)
236 installheader:: headers installdirs
237 @srcdir=$(srcdir) builddir=$(builddir) $(PERL) $(srcdir)/script/installheader.pl $(DESTDIR)$(includedir) $(PUBLIC_HEADERS)
239 installdat:: installdirs
240 @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(datadir) $(srcdir)
242 installman:: manpages installdirs
243 @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(mandir) $(MANPAGES)
245 installmisc:: installdirs
246 @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(setupdir)
248 installpc:: installdirs
249 @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(pkgconfigdir) $(PC_FILES)
251 uninstall:: uninstallbin uninstallsbin uninstalldat uninstallmisc uninstalllib uninstallheader \
252 uninstallman uninstallpc uninstallplugins
254 uninstallmisc::
255 @echo "Removing MISC files"
256 @rm -rf $(DESTDIR)$(setupdir)/*
258 $(DESTDIR)$(bindir)/%: bin/% installdirs
259 @mkdir -p $(@D)
260 @echo Installing $(@F) as $@
261 @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
262 @cp $< $@
263 @chmod $(INSTALLPERMS) $@
265 $(DESTDIR)$(sbindir)/%: bin/% installdirs
266 @mkdir -p $(@D)
267 @echo Installing $(@F) as $@
268 @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
269 @cp $< $@
270 @chmod $(INSTALLPERMS) $@
272 uninstalldat::
273 @echo "Removing DAT files"
274 @rm -fr $(DESTDIR)$(datadir)/*
276 uninstallbin::
278 uninstalllib::
279 @echo "Removing libraries"
280 @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS)
282 uninstallheader::
283 @echo "Removing headers"
284 @rm -fr $(DESTDIR)$(includedir)/*
286 uninstallman::
287 @echo "Removing manpages"
288 @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(mandir) $(MANPAGES)
290 uninstallplugins::
292 uninstallpc::
293 @echo "Removing package configurations"
294 @cd $(DESTDIR)$(pkgconfigdir); rm -f $(notdir $(PC_FILES))
296 config.status:
297 @echo "config.status does not exist. Please run ./configure."
298 @/bin/false
300 data.mk: config.status $(MK_FILES)
301 ./config.status
303 testcov-html::
305 include $(pidldir)/config.mk
306 selftestdir := $(srcdir)/../selftest
307 include $(srcdir)/selftest/config.mk
309 showflags::
310 @echo ' pwd = '`/bin/pwd`