mount.cifs: print output to stderr
[Samba/bb.git] / source4 / Makefile
blob24e58bc37ab397185ccd0805220e6a080f97ee5f
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 libwbclientsrcdir := ../nsswitch/libwbclient
62 libsrcdir := lib
63 libsocketsrcdir := lib/socket
64 libcharsetsrcdir := ../lib/util/charset
65 ldb_sambasrcdir := lib/ldb-samba
66 tdbsrcdir := ../lib/tdb
67 ldbsrcdir := lib/ldb
68 libtlssrcdir := lib/tls
69 libregistrysrcdir := lib/registry
70 smbreadlinesrcdir := lib/smbreadline
71 libmessagingsrcdir := lib/messaging
72 libteventsrcdir := ../lib/tevent
73 libeventssrcdir := lib/events
74 libcmdlinesrcdir := lib/cmdline
75 poptsrcdir := ../lib/popt
76 socketwrappersrcdir := ../lib/socket_wrapper
77 nsswrappersrcdir := ../lib/nss_wrapper
78 uidwrappersrcdir := ../lib/uid_wrapper
79 appwebsrcdir := lib/appweb
80 libstreamsrcdir := lib/stream
81 libutilsrcdir := ../lib/util
82 libtdrsrcdir := ../lib/tdr
83 libcryptosrcdir := ../lib/crypto
84 libtorturesrcdir := ../lib/torture
85 smb_serversrcdir := smb_server
86 libcompressionsrcdir := ../lib/compression
87 libgencachesrcdir := lib
88 paramsrcdir := param
89 rpc_serversrcdir := rpc_server
90 ldap_serversrcdir := ldap_server
91 web_serversrcdir := web_server
92 winbindsrcdir := winbind
93 nbt_serversrcdir := nbt_server
94 wrepl_serversrcdir := wrepl_server
95 cldap_serversrcdir := cldap_server
96 utilssrcdir := utils
97 clientsrcdir := client
98 torturesrcdir := torture
99 ntvfssrcdir := ntvfs
100 ntptrsrcdir := ntptr
101 librpcsrcdir := librpc
102 libclisrcdir := libcli
103 libclicommonsrcdir := ../libcli
104 libclinbtsrcdir := ../libcli/nbt
105 pyscriptsrcdir := $(srcdir)/scripting/python
106 kdcsrcdir := kdc
107 ntp_signdsrcdir := ntp_signd
108 wmisrcdir := lib/wmi
109 tallocsrcdir := ../lib/talloc
110 comsrcdir := $(srcdir)/lib/com
111 libgpodir := libgpo
113 include data.mk
115 INSTALL_SCRIPTS = $(addprefix scripting/bin/, \
116 autoidl \
117 samba3dump \
118 rpcclient \
119 smbstatus)
121 $(foreach SCRIPT,$(INSTALL_SCRIPTS),$(eval $(call binary_install_template,$(SCRIPT))))
123 $(DESTDIR)$(bindir)/%: scripting/bin/% installdirs
124 @mkdir -p $(@D)
125 @echo Installing $(@F) as $@
126 @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
127 @cp $< $@
128 @chmod $(INSTALLPERMS) $@
130 pythonmods:: $(PYTHON_PYS) $(PYTHON_SO)
132 DEP_FILES = $(patsubst %.ho,%.hd,$(patsubst %.o,%.d,$(ALL_OBJS))) \
133 include/includes.d
135 ifeq ($(automatic_dependencies),yes)
136 ifneq ($(MAKECMDGOALS),clean)
137 ifneq ($(MAKECMDGOALS),distclean)
138 ifneq ($(MAKECMDGOALS),realdistclean)
139 ifneq ($(SKIP_DEP_FILES),yes)
140 -include $(DEP_FILES)
141 endif
142 endif
143 endif
144 endif
146 ifneq ($(SKIP_DEP_FILES),yes)
147 clean::
148 @echo Removing dependency files
149 @find . -name '*.d' -o -name '*.hd' | xargs rm -f
150 endif
151 else
152 include $(srcdir)/static_deps.mk
153 endif
155 clean::
156 @find ../lib ../libcli ../librpc ../libgpo ../nsswitch -name '*.o' -o -name '*.ho' | xargs rm -f
158 PUBLIC_HEADERS += ./version.h
160 libraries:: $(STATIC_LIBS) $(SHARED_LIBS)
161 modules:: $(PLUGINS)
162 headers:: $(PUBLIC_HEADERS)
163 manpages:: $(MANPAGES)
164 all:: showflags $(ALL_PREDEP) binaries modules pythonmods libraries headers
165 everything:: all
167 LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)=$(shliboutputdir):$$$(LIB_PATH_VAR)
169 # 'make testsuite' creates all binaries which are
170 # needed by samba3's 'make test' and the build-farm
171 # scripts use that it as fallback in case
172 # 'make everything' fails
173 testsuite:: bin/smbclient bin/cifsdd bin/smbtorture bin/nmblookup
175 showlayout::
176 @echo 'Samba will be installed into:'
177 @echo ' basedir: $(basedir)'
178 @echo ' bindir: $(bindir)'
179 @echo ' sbindir: $(sbindir)'
180 @echo ' libdir: $(libdir)'
181 @echo ' modulesdir: $(modulesdir)'
182 @echo ' includedir: $(includedir)'
183 @echo ' vardir: $(localstatedir)'
184 @echo ' privatedir: $(privatedir)'
185 @echo ' piddir: $(piddir)'
186 @echo ' lockdir: $(lockdir)'
187 @echo ' logfilebase: $(logfilebase)'
188 @echo ' setupdir: $(setupdir)'
189 @echo ' swatdir: $(swatdir)'
190 @echo ' mandir: $(mandir)'
191 @echo ' torturedir: $(torturedir)'
192 @echo ' datadir: $(datadir)'
193 @echo ' winbindd_socket_dir: $(winbindd_socket_dir)'
194 @echo ' ntp_signd_socket_dir: $(ntp_signd_socket_dir)'
196 showflags::
197 @echo ' srcdir = $(srcdir)'
198 @echo ' builddir = $(builddir)'
200 # The permissions to give the executables
201 INSTALLPERMS = 0755
203 install:: showlayout everything installbin installsbin installdat installmisc \
204 installlib installheader installpc installplugins
206 # DESTDIR is used here to prevent packagers wasting their time
207 # duplicating the Makefile. Remove it and you will have the privilege
208 # of packaging each samba release for multiple versions of multiple
209 # distributions and operating systems, or at least supplying patches
210 # to all the packaging files required for this, prior to committing
211 # the removal of DESTDIR. Do not remove it even though you think it
212 # is not used.
214 installdirs::
215 @$(SHELL) $(srcdir)/script/installdirs.sh \
216 $(DESTDIR)$(basedir) \
217 $(DESTDIR)$(bindir) \
218 $(DESTDIR)$(sbindir) \
219 $(DESTDIR)$(torturedir) \
220 $(DESTDIR)$(libdir) \
221 $(DESTDIR)$(modulesdir) \
222 $(DESTDIR)$(mandir) \
223 $(DESTDIR)$(localstatedir) \
224 $(DESTDIR)$(localstatedir)/lib \
225 $(DESTDIR)$(localstatedir)/run \
226 $(DESTDIR)$(privatedir) \
227 $(DESTDIR)$(datadir) \
228 $(DESTDIR)$(piddir) \
229 $(DESTDIR)$(lockdir) \
230 $(DESTDIR)$(logfilebase) \
231 $(DESTDIR)$(privatedir)/tls \
232 $(DESTDIR)$(includedir) \
233 $(DESTDIR)$(pkgconfigdir) \
234 $(DESTDIR)$(sysconfdir)
236 installbin:: installdirs
238 installplugins::
240 installlib:: $(SHARED_LIBS) $(STATIC_LIBS) installdirs
241 @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(SHLIBEXT)" $(SHARED_LIBS)
242 #@$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(STLIBEXT)" $(STATIC_LIBS)
244 installheader:: headers installdirs
245 @srcdir=$(srcdir) builddir=$(builddir) $(PERL) $(srcdir)/script/installheader.pl $(DESTDIR)$(includedir) $(PUBLIC_HEADERS)
247 installdat:: installdirs
248 @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(datadir) $(srcdir)
250 installman:: manpages installdirs
251 @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(mandir) $(MANPAGES)
253 installmisc:: installdirs
254 @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(setupdir)
256 installpc:: installdirs
257 @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(pkgconfigdir) $(PC_FILES)
259 uninstall:: uninstallbin uninstallsbin uninstalldat uninstallmisc uninstalllib uninstallheader \
260 uninstallman uninstallpc uninstallplugins
262 uninstallmisc::
263 @echo "Removing MISC files"
264 @rm -rf $(DESTDIR)$(setupdir)/*
266 $(DESTDIR)$(bindir)/%: bin/% installdirs
267 @mkdir -p $(@D)
268 @echo Installing $(@F) as $@
269 @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
270 @cp $< $@
271 @chmod $(INSTALLPERMS) $@
273 $(DESTDIR)$(sbindir)/%: bin/% installdirs
274 @mkdir -p $(@D)
275 @echo Installing $(@F) as $@
276 @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
277 @cp $< $@
278 @chmod $(INSTALLPERMS) $@
280 uninstalldat::
281 @echo "Removing DAT files"
282 @rm -fr $(DESTDIR)$(datadir)/*
284 uninstallbin::
286 uninstalllib::
287 @echo "Removing libraries"
288 @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS)
290 uninstallheader::
291 @echo "Removing headers"
292 @rm -fr $(DESTDIR)$(includedir)/*
294 uninstallman::
295 @echo "Removing manpages"
296 @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(mandir) $(MANPAGES)
298 uninstallplugins::
300 uninstallpc::
301 @echo "Removing package configurations"
302 @cd $(DESTDIR)$(pkgconfigdir); rm -f $(notdir $(PC_FILES))
304 config.status:
305 @echo "config.status does not exist. Please run ./configure."
306 @/bin/false
308 data.mk: config.status $(MK_FILES)
309 ./config.status
311 testcov-html::
313 include $(pidldir)/config.mk
314 selftestdir := $(srcdir)/../selftest
315 include $(srcdir)/selftest/config.mk
317 showflags::
318 @echo ' pwd = '`/bin/pwd`