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