Add variable for smbreadline directory.
[kai/samba-autobuild/.git] / source4 / 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 libtlssrcdir := lib/tls
65 libregistrysrcdir := lib/registry
66 smbreadlinesrcdir := lib/smbreadline
67 libmessagingsrcdir := lib/messaging
68 libeventssrcdir := lib/events
69 libcmdlinesrcdir := lib/cmdline
70 socketwrappersrcdir := lib/socket_wrapper
71 nsswrappersrcdir := lib/nss_wrapper
72 appwebsrcdir := lib/appweb
73 libstreamsrcdir := lib/stream
74 libutilsrcdir := lib/util
75 libtdrsrcdir := lib/tdr
76 libdbwrapsrcdir := lib/dbwrap
77 libcryptosrcdir := lib/crypto
78 libtorturesrcdir := lib/torture
79 smb_serversrcdir := smb_server
80 libcompressionsrcdir := lib/compression
81 libgencachesrcdir := lib
82 paramsrcdir := param
83 rpc_serversrcdir := rpc_server
84 ldap_serversrcdir := ldap_server
85 web_serversrcdir := web_server
86 winbindsrcdir := winbind
87 nbt_serversrcdir := nbt_server
88 wrepl_serversrcdir := wrepl_server
89 cldap_serversrcdir := cldap_server
90 utilssrcdir := utils
91 clientsrcdir := client
92 torturesrcdir := torture
93 ntvfssrcdir := ntvfs
94 ntptrsrcdir := ntptr
95 librpcsrcdir := librpc
96 libclisrcdir := libcli
97 ejsscriptsrcdir := scripting/ejs
98 pyscriptsrcdir := $(srcdir)/scripting/python
99 kdcsrcdir := kdc
100
101 include data.mk
102
103 BINARIES += $(BIN_PROGS) $(SBIN_PROGS)
104
105 pythonmods:: $(PYTHON_PYS) $(PYTHON_SO)
106
107 DEP_FILES = $(patsubst %.ho,%.hd,$(patsubst %.o,%.d,$(ALL_OBJS))) \
108                    include/includes.d
109
110 ifeq ($(automatic_dependencies),yes)
111 ifneq ($(MAKECMDGOALS),clean)
112 ifneq ($(MAKECMDGOALS),distclean)
113 ifneq ($(MAKECMDGOALS),realdistclean)
114 ifneq ($(SKIP_DEP_FILES),yes)
115 -include $(DEP_FILES)
116 endif
117 endif
118 endif
119 endif
120
121 ifneq ($(SKIP_DEP_FILES),yes)
122 clean::
123         @echo Removing dependency files
124         @find . -name '*.d' -o -name '*.hd' | xargs rm -f
125 endif
126 else
127 include $(srcdir)/static_deps.mk
128 endif
129
130 DEFAULT_HEADERS = $(srcdir)/lib/util/dlinklist.h \
131                   $(srcdir)/version.h
132
133 binaries:: $(BINARIES)
134 libraries:: $(STATIC_LIBS) $(SHARED_LIBS)
135 modules:: $(PLUGINS)
136 headers:: $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
137 manpages:: $(MANPAGES)
138 all:: showflags $(ALL_PREDEP) bin/asn1_compile bin/compile_et binaries modules pythonmods libraries headers
139 everything:: all
140
141 LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)=$(builddir)/bin/shared
142
143 # 'make testsuite' creates all binaries which are
144 # needed by samba3's 'make test' and the build-farm
145 # scripts use that it as fallback in case
146 # 'make everything' fails
147 testsuite:: bin/smbclient bin/cifsdd bin/smbtorture bin/nmblookup
148
149 showlayout:: 
150         @echo 'Samba will be installed into:'
151         @echo '  basedir:     $(BASEDIR)'
152         @echo '  bindir:      $(bindir)'
153         @echo '  sbindir:     $(sbindir)'
154         @echo '  libdir:      $(libdir)'
155         @echo '  modulesdir:  $(modulesdir)'
156         @echo '  includedir:  $(includedir)'
157         @echo '  vardir:      $(localstatedir)'
158         @echo '  privatedir:  $(privatedir)'
159         @echo '  piddir:      $(piddir)'
160         @echo '  lockdir:     $(lockdir)'
161         @echo '  logfilebase: $(logfilebase)'
162         @echo '  setupdir:    $(SETUPDIR)'
163         @echo '  jsdir:       $(JSDIR)'
164         @echo '  swatdir:     $(SWATDIR)'
165         @echo '  mandir:      $(mandir)'
166         @echo '  torturedir:  $(TORTUREDIR)'
167         @echo '  datadir:     $(datadir)'
168         @echo '  winbindd_socket_dir:  $(winbindd_socket_dir)'
169
170 showflags::
171         @echo '  srcdir     = $(srcdir)'
172         @echo '  builddir   = $(builddir)'
173
174 # The permissions to give the executables
175 INSTALLPERMS = 0755
176
177 install:: showlayout everything installbin installdat installswat installmisc \
178               installlib installheader installpc installplugins
179
180 # DESTDIR is used here to prevent packagers wasting their time
181 # duplicating the Makefile. Remove it and you will have the privilege
182 # of packaging each samba release for multiple versions of multiple
183 # distributions and operating systems, or at least supplying patches
184 # to all the packaging files required for this, prior to committing
185 # the removal of DESTDIR. Do not remove it even though you think it
186 # is not used.
187
188 installdirs::
189         @$(SHELL) $(srcdir)/script/installdirs.sh \
190                 $(DESTDIR)$(BASEDIR) \
191                 $(DESTDIR)$(bindir) \
192                 $(DESTDIR)$(sbindir) \
193                 $(DESTDIR)$(TORTUREDIR) \
194                 $(DESTDIR)$(libdir) \
195                 $(DESTDIR)$(modulesdir) \
196                 $(DESTDIR)$(mandir) \
197                 $(DESTDIR)$(localstatedir) \
198                 $(DESTDIR)$(privatedir) \
199                 $(DESTDIR)$(datadir) \
200                 $(DESTDIR)$(piddir) \
201                 $(DESTDIR)$(lockdir) \
202                 $(DESTDIR)$(logfilebase) \
203                 $(DESTDIR)$(privatedir)/tls \
204                 $(DESTDIR)$(includedir) \
205                 $(DESTDIR)$(PKGCONFIGDIR) \
206                 $(DESTDIR)$(sysconfdir) \
207
208 installbin:: $(SBIN_PROGS) $(BIN_PROGS) $(TORTURE_PROGS) installdirs
209         @$(SHELL) $(srcdir)/script/installbin.sh \
210                 $(INSTALLPERMS) \
211                 $(DESTDIR)$(BASEDIR) \
212                 $(DESTDIR)$(sbindir) \
213                 $(DESTDIR)$(libdir) \
214                 $(DESTDIR)$(localstatedir) \
215                 $(SBIN_PROGS)
216         @$(SHELL) $(srcdir)/script/installbin.sh \
217                 $(INSTALLPERMS) \
218                 $(DESTDIR)$(BASEDIR) \
219                 $(DESTDIR)$(bindir) \
220                 $(DESTDIR)$(libdir) \
221                 $(DESTDIR)$(localstatedir) \
222                 $(BIN_PROGS)
223         @$(SHELL) $(srcdir)/script/installtorture.sh \
224                 $(INSTALLPERMS) \
225                 $(DESTDIR)$(TORTUREDIR) \
226                 $(TORTURE_PROGS)
227
228 installplugins::
229
230 installlib:: $(SHARED_LIBS) $(STATIC_LIBS) installdirs
231         @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(SHLIBEXT)" $(SHARED_LIBS) 
232         #@$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(STLIBEXT)" $(STATIC_LIBS)
233
234 installheader:: headers installdirs
235         @srcdir=$(srcdir) builddir=$(builddir) $(PERL) $(srcdir)/script/installheader.pl $(DESTDIR)$(includedir) $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
236
237 installdat:: installdirs
238         @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(datadir) $(srcdir)
239
240 installswat:: installdirs
241 #SWAT has been disabled until further notice
242 #       @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
243
244 installman:: manpages installdirs
245         @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(mandir) $(MANPAGES)
246
247 installmisc:: installdirs
248         @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(JSDIR) $(DESTDIR)$(SETUPDIR) $(DESTDIR)$(bindir)
249
250 installpc:: installdirs
251         @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(PKGCONFIGDIR) $(PC_FILES)
252
253 uninstall:: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader \
254         uninstallplugins
255
256 uninstallmisc::
257         #FIXME
258
259 uninstallbin::
260         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(sbindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(SBIN_PROGS)
261         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(BIN_PROGS)
262         @$(SHELL) $(srcdir)/script/uninstalltorture.sh $(DESTDIR)$(TORTUREDIR) $(TORTURE_PROGS)
263
264 uninstalllib::
265         @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS)
266         #@$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(STATIC_LIBS) 
267
268 uninstallheader::
269         @$(SHELL) $(srcdir)/script/uninstallheader.sh $(DESTDIR)$(includedir) $(PUBLIC_HEADERS)
270
271 uninstallman::
272         @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(mandir) $(MANPAGES)
273
274 uninstallplugins::
275
276 config.status:
277         @echo "config.status does not exist. Please run ./configure."
278         @/bin/false
279
280 data.mk: config.status $(MK_FILES)
281         ./config.status
282
283 testcov-html:: 
284
285 include $(pidldir)/config.mk
286 include $(srcdir)/selftest/config.mk
287
288 showflags::
289         @echo '  pwd        = '`/bin/pwd`