Make cli_unlock and cli_unlock64 async. Fix POSIX lock test.
[Samba/aatanasov.git] / source4 / Makefile
blobd6ae88706665f3ec8483367b4f4b9b382d5d41b7
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 appwebsrcdir := lib/appweb
79 libstreamsrcdir := lib/stream
80 libutilsrcdir := ../lib/util
81 libtdrsrcdir := ../lib/tdr
82 libcryptosrcdir := ../lib/crypto
83 libtorturesrcdir := ../lib/torture
84 smb_serversrcdir := smb_server
85 libcompressionsrcdir := ../lib/compression
86 libgencachesrcdir := lib
87 paramsrcdir := param
88 rpc_serversrcdir := rpc_server
89 ldap_serversrcdir := ldap_server
90 web_serversrcdir := web_server
91 winbindsrcdir := winbind
92 nbt_serversrcdir := nbt_server
93 wrepl_serversrcdir := wrepl_server
94 cldap_serversrcdir := cldap_server
95 utilssrcdir := utils
96 clientsrcdir := client
97 torturesrcdir := torture
98 ntvfssrcdir := ntvfs
99 ntptrsrcdir := ntptr
100 librpcsrcdir := librpc
101 libclisrcdir := libcli
102 libclicommonsrcdir := ../libcli
103 libclinbtsrcdir := ../libcli/nbt
104 pyscriptsrcdir := $(srcdir)/scripting/python
105 kdcsrcdir := kdc
106 ntp_signdsrcdir := ntp_signd
107 wmisrcdir := lib/wmi
108 tallocsrcdir := ../lib/talloc
109 comsrcdir := $(srcdir)/lib/com
110 libgpodir := libgpo
112 include data.mk
114 INSTALL_SCRIPTS = $(addprefix scripting/bin/, \
115 autoidl \
116 samba3dump \
117 rpcclient \
118 smbstatus)
120 $(foreach SCRIPT,$(INSTALL_SCRIPTS),$(eval $(call binary_install_template,$(SCRIPT))))
122 $(DESTDIR)$(bindir)/%: scripting/bin/% installdirs
123 @mkdir -p $(@D)
124 @echo Installing $(@F) as $@
125 @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
126 @cp $< $@
127 @chmod $(INSTALLPERMS) $@
129 pythonmods:: $(PYTHON_PYS) $(PYTHON_SO)
131 DEP_FILES = $(patsubst %.ho,%.hd,$(patsubst %.o,%.d,$(ALL_OBJS))) \
132 include/includes.d
134 ifeq ($(automatic_dependencies),yes)
135 ifneq ($(MAKECMDGOALS),clean)
136 ifneq ($(MAKECMDGOALS),distclean)
137 ifneq ($(MAKECMDGOALS),realdistclean)
138 ifneq ($(SKIP_DEP_FILES),yes)
139 -include $(DEP_FILES)
140 endif
141 endif
142 endif
143 endif
145 ifneq ($(SKIP_DEP_FILES),yes)
146 clean::
147 @echo Removing dependency files
148 @find . -name '*.d' -o -name '*.hd' | xargs rm -f
149 endif
150 else
151 include $(srcdir)/static_deps.mk
152 endif
154 clean::
155 @find ../lib ../libcli ../librpc ../libgpo ../nsswitch -name '*.o' -o -name '*.ho' | xargs rm -f
157 PUBLIC_HEADERS += ./version.h
159 libraries:: $(STATIC_LIBS) $(SHARED_LIBS)
160 modules:: $(PLUGINS)
161 headers:: $(PUBLIC_HEADERS)
162 manpages:: $(MANPAGES)
163 all:: showflags $(ALL_PREDEP) binaries modules pythonmods libraries headers
164 everything:: all
166 LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)=$(shliboutputdir):$$$(LIB_PATH_VAR)
168 # 'make testsuite' creates all binaries which are
169 # needed by samba3's 'make test' and the build-farm
170 # scripts use that it as fallback in case
171 # 'make everything' fails
172 testsuite:: bin/smbclient bin/cifsdd bin/smbtorture bin/nmblookup
174 showlayout::
175 @echo 'Samba will be installed into:'
176 @echo ' basedir: $(basedir)'
177 @echo ' bindir: $(bindir)'
178 @echo ' sbindir: $(sbindir)'
179 @echo ' libdir: $(libdir)'
180 @echo ' modulesdir: $(modulesdir)'
181 @echo ' includedir: $(includedir)'
182 @echo ' vardir: $(localstatedir)'
183 @echo ' privatedir: $(privatedir)'
184 @echo ' piddir: $(piddir)'
185 @echo ' lockdir: $(lockdir)'
186 @echo ' logfilebase: $(logfilebase)'
187 @echo ' setupdir: $(setupdir)'
188 @echo ' swatdir: $(swatdir)'
189 @echo ' mandir: $(mandir)'
190 @echo ' torturedir: $(torturedir)'
191 @echo ' datadir: $(datadir)'
192 @echo ' winbindd_socket_dir: $(winbindd_socket_dir)'
193 @echo ' ntp_signd_socket_dir: $(ntp_signd_socket_dir)'
195 showflags::
196 @echo ' srcdir = $(srcdir)'
197 @echo ' builddir = $(builddir)'
199 # The permissions to give the executables
200 INSTALLPERMS = 0755
202 install:: showlayout everything installbin installsbin installdat installmisc \
203 installlib installheader installpc installplugins
205 # DESTDIR is used here to prevent packagers wasting their time
206 # duplicating the Makefile. Remove it and you will have the privilege
207 # of packaging each samba release for multiple versions of multiple
208 # distributions and operating systems, or at least supplying patches
209 # to all the packaging files required for this, prior to committing
210 # the removal of DESTDIR. Do not remove it even though you think it
211 # is not used.
213 installdirs::
214 @$(SHELL) $(srcdir)/script/installdirs.sh \
215 $(DESTDIR)$(basedir) \
216 $(DESTDIR)$(bindir) \
217 $(DESTDIR)$(sbindir) \
218 $(DESTDIR)$(torturedir) \
219 $(DESTDIR)$(libdir) \
220 $(DESTDIR)$(modulesdir) \
221 $(DESTDIR)$(mandir) \
222 $(DESTDIR)$(localstatedir) \
223 $(DESTDIR)$(localstatedir)/lib \
224 $(DESTDIR)$(localstatedir)/run \
225 $(DESTDIR)$(privatedir) \
226 $(DESTDIR)$(datadir) \
227 $(DESTDIR)$(piddir) \
228 $(DESTDIR)$(lockdir) \
229 $(DESTDIR)$(logfilebase) \
230 $(DESTDIR)$(privatedir)/tls \
231 $(DESTDIR)$(includedir) \
232 $(DESTDIR)$(pkgconfigdir) \
233 $(DESTDIR)$(sysconfdir)
235 installbin:: installdirs
237 installplugins::
239 installlib:: $(SHARED_LIBS) $(STATIC_LIBS) installdirs
240 @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(SHLIBEXT)" $(SHARED_LIBS)
241 #@$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(STLIBEXT)" $(STATIC_LIBS)
243 installheader:: headers installdirs
244 @srcdir=$(srcdir) builddir=$(builddir) $(PERL) $(srcdir)/script/installheader.pl $(DESTDIR)$(includedir) $(PUBLIC_HEADERS)
246 installdat:: installdirs
247 @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(datadir) $(srcdir)
249 installman:: manpages installdirs
250 @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(mandir) $(MANPAGES)
252 installmisc:: installdirs
253 @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(setupdir)
255 installpc:: installdirs
256 @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(pkgconfigdir) $(PC_FILES)
258 uninstall:: uninstallbin uninstallsbin uninstalldat uninstallmisc uninstalllib uninstallheader \
259 uninstallman uninstallpc uninstallplugins
261 uninstallmisc::
262 @echo "Removing MISC files"
263 @rm -rf $(DESTDIR)$(setupdir)/*
265 $(DESTDIR)$(bindir)/%: 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 $(DESTDIR)$(sbindir)/%: bin/% installdirs
273 @mkdir -p $(@D)
274 @echo Installing $(@F) as $@
275 @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
276 @cp $< $@
277 @chmod $(INSTALLPERMS) $@
279 uninstalldat::
280 @echo "Removing DAT files"
281 @rm -fr $(DESTDIR)$(datadir)/*
283 uninstallbin::
285 uninstalllib::
286 @echo "Removing libraries"
287 @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS)
289 uninstallheader::
290 @echo "Removing headers"
291 @rm -fr $(DESTDIR)$(includedir)/*
293 uninstallman::
294 @echo "Removing manpages"
295 @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(mandir) $(MANPAGES)
297 uninstallplugins::
299 uninstallpc::
300 @echo "Removing package configurations"
301 @cd $(DESTDIR)$(pkgconfigdir); rm -f $(notdir $(PC_FILES))
303 config.status:
304 @echo "config.status does not exist. Please run ./configure."
305 @/bin/false
307 data.mk: config.status $(MK_FILES)
308 ./config.status
310 testcov-html::
312 include $(pidldir)/config.mk
313 selftestdir := $(srcdir)/../selftest
314 include $(srcdir)/selftest/config.mk
316 showflags::
317 @echo ' pwd = '`/bin/pwd`