Use variables for source dir of python ldb bindings.
[metze/samba/wip.git] / source / Makefile
1 #!gmake
2 # The Samba 4 Makefile.
3 # This file is *NOT* autogenerated.
4
5 include mkconfig.mk
6
7 pidldir := $(srcdir)/pidl
8
9 VPATH = $(builddir):$(srcdir):$(srcdir)/heimdal_build:$(heimdalsrcdir)/lib/asn1:$(heimdalsrcdir)/lib/krb5:$(heimdalsrcdir)/lib/gssapi:$(heimdalsrcdir)/lib/hdb:$(heimdalsrcdir)/lib/roken:$(heimdalsrcdir)/lib/des
10
11 BASEDIR = $(prefix)
12 TORTUREDIR = $(libdir)/torture
13 SWATDIR = $(datadir)/swat
14 JSDIR = $(datadir)/js
15 SETUPDIR = $(datadir)/setup
16 NCALRPCDIR = $(localstatedir)/ncalrpc
17
18 BNLD = $(LD)
19 BNLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
20
21 HOSTCC_FLAGS = -D_SAMBA_HOSTCC_ $(CFLAGS)
22 HOSTLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
23
24 $(srcdir)/version.h: $(srcdir)/VERSION
25         @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
26
27 .DEFAULT_GOAL := all
28
29 ifneq ($(automatic_dependencies),yes)
30 ALL_PREDEP = basics
31 .NOTPARALLEL:
32 endif
33
34 regen_version::
35         @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
36
37 clean_pch::
38         @echo "Removing precompiled headers"
39         @-rm -f include/includes.h.gch
40
41 pch:: clean_pch include/includes.h.gch
42
43 .DEFAULT_GOAL := all
44
45 ifneq ($(automatic_dependencies),yes)
46 ALL_PREDEP = basics
47 .NOTPARALLEL:
48 endif
49
50 include $(srcdir)/build/make/rules.mk
51 include $(srcdir)/build/make/python.mk
52 dynconfigsrcdir := dynconfig
53 heimdalsrcdir := heimdal
54 dsdbsrcdir := dsdb
55 smbdsrcdir := smbd
56 clustersrcdir := cluster
57 libnetsrcdir := libnet
58 authsrcdir := auth
59 nsswitchsrcdir := nsswitch
60 libsrcdir := lib
61 libsocketsrcdir := lib/socket
62 libcharsetsrcdir := lib/charset
63 ldb_sambasrcdir := lib/ldb-samba
64 tdbsrcdir := lib/tdb
65 ldbsrcdir := lib/ldb
66 libtlssrcdir := lib/tls
67 libregistrysrcdir := lib/registry
68 smbreadlinesrcdir := lib/smbreadline
69 libmessagingsrcdir := lib/messaging
70 libeventssrcdir := lib/events
71 libcmdlinesrcdir := lib/cmdline
72 socketwrappersrcdir := lib/socket_wrapper
73 nsswrappersrcdir := lib/nss_wrapper
74 appwebsrcdir := lib/appweb
75 libstreamsrcdir := lib/stream
76 libutilsrcdir := lib/util
77 libtdrsrcdir := lib/tdr
78 libdbwrapsrcdir := lib/dbwrap
79 libcryptosrcdir := lib/crypto
80 libtorturesrcdir := lib/torture
81 smb_serversrcdir := smb_server
82 libcompressionsrcdir := lib/compression
83 libgencachesrcdir := lib
84 paramsrcdir := param
85 rpc_serversrcdir := rpc_server
86 ldap_serversrcdir := ldap_server
87 web_serversrcdir := web_server
88 winbindsrcdir := winbind
89 nbt_serversrcdir := nbt_server
90 wrepl_serversrcdir := wrepl_server
91 cldap_serversrcdir := cldap_server
92 utilssrcdir := utils
93 clientsrcdir := client
94 torturesrcdir := torture
95 ntvfssrcdir := ntvfs
96 ntptrsrcdir := ntptr
97 librpcsrcdir := librpc
98 libclisrcdir := libcli
99 ejsscriptsrcdir := scripting/ejs
100 pyscriptsrcdir := $(srcdir)/scripting/python
101 kdcsrcdir := kdc
102 ntp_signdsrcdir := ntp_signd
103
104 include data.mk
105
106 BINARIES += $(BIN_PROGS) $(SBIN_PROGS)
107
108 pythonmods:: $(PYTHON_PYS) $(PYTHON_SO)
109
110 DEP_FILES = $(patsubst %.ho,%.hd,$(patsubst %.o,%.d,$(ALL_OBJS))) \
111                    include/includes.d
112
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)
119 endif
120 endif
121 endif
122 endif
123
124 ifneq ($(SKIP_DEP_FILES),yes)
125 clean::
126         @echo Removing dependency files
127         @find . -name '*.d' -o -name '*.hd' | xargs rm -f
128 endif
129 else
130 include $(srcdir)/static_deps.mk
131 endif
132
133 DEFAULT_HEADERS = $(srcdir)/lib/util/dlinklist.h \
134                   $(srcdir)/version.h
135
136 binaries:: $(BINARIES)
137 libraries:: $(STATIC_LIBS) $(SHARED_LIBS)
138 modules:: $(PLUGINS)
139 headers:: $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
140 manpages:: $(MANPAGES)
141 all:: showflags $(ALL_PREDEP) bin/asn1_compile bin/compile_et binaries modules pythonmods libraries headers
142 everything:: all
143
144 LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)=$(builddir)/bin/shared
145
146 # 'make testsuite' creates all binaries which are
147 # needed by samba3's 'make test' and the build-farm
148 # scripts use that it as fallback in case
149 # 'make everything' fails
150 testsuite:: bin/smbclient bin/cifsdd bin/smbtorture bin/nmblookup
151
152 showlayout:: 
153         @echo 'Samba will be installed into:'
154         @echo '  basedir:     $(BASEDIR)'
155         @echo '  bindir:      $(bindir)'
156         @echo '  sbindir:     $(sbindir)'
157         @echo '  libdir:      $(libdir)'
158         @echo '  modulesdir:  $(modulesdir)'
159         @echo '  includedir:  $(includedir)'
160         @echo '  vardir:      $(localstatedir)'
161         @echo '  privatedir:  $(privatedir)'
162         @echo '  piddir:      $(piddir)'
163         @echo '  lockdir:     $(lockdir)'
164         @echo '  logfilebase: $(logfilebase)'
165         @echo '  setupdir:    $(SETUPDIR)'
166         @echo '  jsdir:       $(JSDIR)'
167         @echo '  swatdir:     $(SWATDIR)'
168         @echo '  mandir:      $(mandir)'
169         @echo '  torturedir:  $(TORTUREDIR)'
170         @echo '  datadir:     $(datadir)'
171         @echo '  winbindd_socket_dir:  $(winbindd_socket_dir)'
172         @echo '  ntp_signd_socket_dir:  $(ntp_signd_socket_dir)'
173
174 showflags::
175         @echo '  srcdir     = $(srcdir)'
176         @echo '  builddir   = $(builddir)'
177
178 # The permissions to give the executables
179 INSTALLPERMS = 0755
180
181 install:: showlayout everything installbin installdat installswat installmisc \
182               installlib installheader installpc installplugins
183
184 # DESTDIR is used here to prevent packagers wasting their time
185 # duplicating the Makefile. Remove it and you will have the privilege
186 # of packaging each samba release for multiple versions of multiple
187 # distributions and operating systems, or at least supplying patches
188 # to all the packaging files required for this, prior to committing
189 # the removal of DESTDIR. Do not remove it even though you think it
190 # is not used.
191
192 installdirs::
193         @$(SHELL) $(srcdir)/script/installdirs.sh \
194                 $(DESTDIR)$(BASEDIR) \
195                 $(DESTDIR)$(bindir) \
196                 $(DESTDIR)$(sbindir) \
197                 $(DESTDIR)$(TORTUREDIR) \
198                 $(DESTDIR)$(libdir) \
199                 $(DESTDIR)$(modulesdir) \
200                 $(DESTDIR)$(mandir) \
201                 $(DESTDIR)$(localstatedir) \
202                 $(DESTDIR)$(privatedir) \
203                 $(DESTDIR)$(datadir) \
204                 $(DESTDIR)$(piddir) \
205                 $(DESTDIR)$(lockdir) \
206                 $(DESTDIR)$(logfilebase) \
207                 $(DESTDIR)$(privatedir)/tls \
208                 $(DESTDIR)$(includedir) \
209                 $(DESTDIR)$(PKGCONFIGDIR) \
210                 $(DESTDIR)$(sysconfdir) \
211
212 installbin:: $(SBIN_PROGS) $(BIN_PROGS) $(TORTURE_PROGS) installdirs
213         @$(SHELL) $(srcdir)/script/installbin.sh \
214                 $(INSTALLPERMS) \
215                 $(DESTDIR)$(BASEDIR) \
216                 $(DESTDIR)$(sbindir) \
217                 $(DESTDIR)$(libdir) \
218                 $(DESTDIR)$(localstatedir) \
219                 $(SBIN_PROGS)
220         @$(SHELL) $(srcdir)/script/installbin.sh \
221                 $(INSTALLPERMS) \
222                 $(DESTDIR)$(BASEDIR) \
223                 $(DESTDIR)$(bindir) \
224                 $(DESTDIR)$(libdir) \
225                 $(DESTDIR)$(localstatedir) \
226                 $(BIN_PROGS)
227         @$(SHELL) $(srcdir)/script/installtorture.sh \
228                 $(INSTALLPERMS) \
229                 $(DESTDIR)$(TORTUREDIR) \
230                 $(TORTURE_PROGS)
231
232 installplugins::
233
234 installlib:: $(SHARED_LIBS) $(STATIC_LIBS) installdirs
235         @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(SHLIBEXT)" $(SHARED_LIBS) 
236         #@$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(STLIBEXT)" $(STATIC_LIBS)
237
238 installheader:: headers installdirs
239         @srcdir=$(srcdir) builddir=$(builddir) $(PERL) $(srcdir)/script/installheader.pl $(DESTDIR)$(includedir) $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
240
241 installdat:: installdirs
242         @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(datadir) $(srcdir)
243
244 installswat:: installdirs
245 #SWAT has been disabled until further notice
246 #       @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
247
248 installman:: manpages installdirs
249         @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(mandir) $(MANPAGES)
250
251 installmisc:: installdirs
252         @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(JSDIR) $(DESTDIR)$(SETUPDIR) $(DESTDIR)$(bindir)
253
254 installpc:: installdirs
255         @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(PKGCONFIGDIR) $(PC_FILES)
256
257 uninstall:: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader \
258         uninstallplugins
259
260 uninstallmisc::
261         #FIXME
262
263 uninstallbin::
264         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(sbindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(SBIN_PROGS)
265         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(BIN_PROGS)
266         @$(SHELL) $(srcdir)/script/uninstalltorture.sh $(DESTDIR)$(TORTUREDIR) $(TORTURE_PROGS)
267
268 uninstalllib::
269         @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS)
270         #@$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(STATIC_LIBS) 
271
272 uninstallheader::
273         @$(SHELL) $(srcdir)/script/uninstallheader.sh $(DESTDIR)$(includedir) $(PUBLIC_HEADERS)
274
275 uninstallman::
276         @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(mandir) $(MANPAGES)
277
278 uninstallplugins::
279
280 config.status:
281         @echo "config.status does not exist. Please run ./configure."
282         @/bin/false
283
284 data.mk: config.status $(MK_FILES)
285         ./config.status
286
287 testcov-html:: 
288
289 include $(pidldir)/config.mk
290 include $(srcdir)/selftest/config.mk
291
292 showflags::
293         @echo '  pwd        = '`/bin/pwd`