Merge branch 'master' of ssh://git.samba.org/data/git/samba into wmi
[sfrench/samba-autobuild/.git] / source4 / Makefile
1 #!gmake
2 # The Samba 4 Makefile.
3 # This file is *NOT* autogenerated.
4 #
5 .DEFAULT_GOAL := all
6
7 default: all
8
9 include mkconfig.mk
10
11 pidldir := $(srcdir)/pidl
12
13 BASEDIR = $(prefix)
14 TORTUREDIR = $(libdir)/torture
15 SWATDIR = $(datadir)/swat
16 JSDIR = $(datadir)/js
17 SETUPDIR = $(datadir)/setup
18 NCALRPCDIR = $(localstatedir)/ncalrpc
19
20 BNLD = $(LD)
21 BNLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
22
23 HOSTCC_FLAGS = -D_SAMBA_HOSTCC_ $(CFLAGS)
24 HOSTLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
25
26 $(srcdir)/version.h: $(srcdir)/VERSION
27         @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
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 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 libsrcdir := lib
62 libsocketsrcdir := lib/socket
63 libcharsetsrcdir := lib/charset
64 ldb_sambasrcdir := lib/ldb-samba
65 tdbsrcdir := lib/tdb
66 ldbsrcdir := lib/ldb
67 libtlssrcdir := lib/tls
68 libregistrysrcdir := lib/registry
69 smbreadlinesrcdir := lib/smbreadline
70 libmessagingsrcdir := lib/messaging
71 libeventssrcdir := lib/events
72 libcmdlinesrcdir := lib/cmdline
73 poptsrcdir := lib/popt
74 socketwrappersrcdir := lib/socket_wrapper
75 nsswrappersrcdir := lib/nss_wrapper
76 appwebsrcdir := lib/appweb
77 libstreamsrcdir := lib/stream
78 libutilsrcdir := lib/util
79 libtdrsrcdir := lib/tdr
80 libdbwrapsrcdir := lib/dbwrap
81 libcryptosrcdir := lib/crypto
82 libtorturesrcdir := lib/torture
83 smb_serversrcdir := smb_server
84 libcompressionsrcdir := lib/compression
85 libgencachesrcdir := lib
86 paramsrcdir := param
87 rpc_serversrcdir := rpc_server
88 ldap_serversrcdir := ldap_server
89 web_serversrcdir := web_server
90 winbindsrcdir := winbind
91 nbt_serversrcdir := nbt_server
92 wrepl_serversrcdir := wrepl_server
93 cldap_serversrcdir := cldap_server
94 utilssrcdir := utils
95 clientsrcdir := client
96 torturesrcdir := torture
97 ntvfssrcdir := ntvfs
98 ntptrsrcdir := ntptr
99 librpcsrcdir := librpc
100 libclisrcdir := libcli
101 ejsscriptsrcdir := scripting/ejs
102 pyscriptsrcdir := $(srcdir)/scripting/python
103 kdcsrcdir := kdc
104 ntp_signdsrcdir := ntp_signd
105 wmisrcdir := lib/wmi
106
107 include data.mk
108
109 pythonmods:: $(PYTHON_PYS) $(PYTHON_SO)
110
111 DEP_FILES = $(patsubst %.ho,%.hd,$(patsubst %.o,%.d,$(ALL_OBJS))) \
112                    include/includes.d
113
114 ifeq ($(automatic_dependencies),yes)
115 ifneq ($(MAKECMDGOALS),clean)
116 ifneq ($(MAKECMDGOALS),distclean)
117 ifneq ($(MAKECMDGOALS),realdistclean)
118 ifneq ($(SKIP_DEP_FILES),yes)
119 -include $(DEP_FILES)
120 endif
121 endif
122 endif
123 endif
124
125 ifneq ($(SKIP_DEP_FILES),yes)
126 clean::
127         @echo Removing dependency files
128         @find . -name '*.d' -o -name '*.hd' | xargs rm -f
129 endif
130 else
131 include $(srcdir)/static_deps.mk
132 endif
133
134 DEFAULT_HEADERS = $(srcdir)/lib/util/dlinklist.h \
135                   $(srcdir)/version.h
136
137 libraries:: $(STATIC_LIBS) $(SHARED_LIBS)
138 modules:: $(PLUGINS)
139 headers:: $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
140 manpages:: $(MANPAGES)
141 all:: showflags $(ALL_PREDEP) 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 installsbin 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)$(localstatedir)/lib \
203                 $(DESTDIR)$(localstatedir)/run \
204                 $(DESTDIR)$(privatedir) \
205                 $(DESTDIR)$(datadir) \
206                 $(DESTDIR)$(piddir) \
207                 $(DESTDIR)$(lockdir) \
208                 $(DESTDIR)$(logfilebase) \
209                 $(DESTDIR)$(privatedir)/tls \
210                 $(DESTDIR)$(includedir) \
211                 $(DESTDIR)$(PKGCONFIGDIR) \
212                 $(DESTDIR)$(sysconfdir)
213
214 installbin:: installdirs
215
216 installplugins::
217
218 installlib:: $(SHARED_LIBS) $(STATIC_LIBS) installdirs
219         @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(SHLIBEXT)" $(SHARED_LIBS) 
220         #@$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(STLIBEXT)" $(STATIC_LIBS)
221
222 installheader:: headers installdirs
223         @srcdir=$(srcdir) builddir=$(builddir) $(PERL) $(srcdir)/script/installheader.pl $(DESTDIR)$(includedir) $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
224
225 installdat:: installdirs
226         @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(datadir) $(srcdir)
227
228 installswat:: installdirs
229 #SWAT has been disabled until further notice
230 #       @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
231
232 installman:: manpages installdirs
233         @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(mandir) $(MANPAGES)
234
235 installmisc:: installdirs
236         @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(JSDIR) $(DESTDIR)$(SETUPDIR) $(DESTDIR)$(bindir)
237
238 installpc:: installdirs
239         @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(PKGCONFIGDIR) $(PC_FILES)
240
241 uninstall:: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader \
242         uninstallplugins
243
244 uninstallmisc::
245         #FIXME
246
247 $(DESTDIR)$(bindir)/%: bin/% installdirs
248         @mkdir -p $(@D)
249         @echo Installing $(@F) as $@
250         @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
251         @cp $< $@
252         @chmod $(INSTALLPERMS) $@
253
254 $(DESTDIR)$(sbindir)/%: bin/% installdirs
255         @mkdir -p $(@D)
256         @echo Installing $(@F) as $@
257         @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
258         @cp $< $@
259         @chmod $(INSTALLPERMS) $@
260
261 uninstallbin::
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 selftestdir := $(srcdir)/selftest
286 include $(selftestdir)/config.mk
287
288 showflags::
289         @echo '  pwd        = '`/bin/pwd`