Fix merged build.
[ira/wip.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 SETUPDIR = $(datadir)/setup
17 NCALRPCDIR = $(localstatedir)/ncalrpc
18
19 BNLD = $(LD)
20 BNLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
21
22 HOSTCC_FLAGS = -D_SAMBA_HOSTCC_ $(CFLAGS)
23 HOSTLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
24
25 $(srcdir)/version.h: $(srcdir)/VERSION
26         @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
27
28 ifneq ($(automatic_dependencies),yes)
29 ALL_PREDEP = basics
30 .NOTPARALLEL:
31 endif
32
33 regen_version::
34         @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
35
36 clean_pch::
37         @echo "Removing precompiled headers"
38         @-rm -f include/includes.h.gch
39
40 pch:: clean_pch include/includes.h.gch
41
42 .DEFAULT_GOAL := all
43
44 ifneq ($(automatic_dependencies),yes)
45 ALL_PREDEP = basics
46 .NOTPARALLEL:
47 endif
48
49 include $(srcdir)/build/make/rules.mk
50 include $(srcdir)/build/make/python.mk
51 zlibsrcdir := lib/zlib
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 poptsrcdir := ../lib/popt
73 socketwrappersrcdir := ../lib/socket_wrapper
74 nsswrappersrcdir := ../lib/nss_wrapper
75 appwebsrcdir := lib/appweb
76 libstreamsrcdir := lib/stream
77 libutilsrcdir := lib/util
78 libtdrsrcdir := lib/tdr
79 libdbwrapsrcdir := lib/dbwrap
80 libcryptosrcdir := lib/crypto
81 libtorturesrcdir := lib/torture
82 smb_serversrcdir := smb_server
83 libcompressionsrcdir := ../lib/compression
84 libgencachesrcdir := lib
85 paramsrcdir := param
86 rpc_serversrcdir := rpc_server
87 ldap_serversrcdir := ldap_server
88 web_serversrcdir := web_server
89 winbindsrcdir := winbind
90 nbt_serversrcdir := nbt_server
91 wrepl_serversrcdir := wrepl_server
92 cldap_serversrcdir := cldap_server
93 utilssrcdir := utils
94 clientsrcdir := client
95 torturesrcdir := torture
96 ntvfssrcdir := ntvfs
97 ntptrsrcdir := ntptr
98 librpcsrcdir := librpc
99 libclisrcdir := libcli
100 pyscriptsrcdir := $(srcdir)/scripting/python
101 kdcsrcdir := kdc
102 ntp_signdsrcdir := ntp_signd
103 wmisrcdir := lib/wmi
104 tallocsrcdir := ../lib/talloc
105 comsrcdir := $(srcdir)/lib/com
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 '  swatdir:     $(SWATDIR)'
167         @echo '  mandir:      $(mandir)'
168         @echo '  torturedir:  $(TORTUREDIR)'
169         @echo '  datadir:     $(datadir)'
170         @echo '  winbindd_socket_dir:  $(winbindd_socket_dir)'
171         @echo '  ntp_signd_socket_dir:  $(ntp_signd_socket_dir)'
172
173 showflags::
174         @echo '  srcdir     = $(srcdir)'
175         @echo '  builddir   = $(builddir)'
176
177 # The permissions to give the executables
178 INSTALLPERMS = 0755
179
180 install:: showlayout everything installbin installsbin installdat installswat installmisc \
181               installlib installheader installpc installplugins
182
183 # DESTDIR is used here to prevent packagers wasting their time
184 # duplicating the Makefile. Remove it and you will have the privilege
185 # of packaging each samba release for multiple versions of multiple
186 # distributions and operating systems, or at least supplying patches
187 # to all the packaging files required for this, prior to committing
188 # the removal of DESTDIR. Do not remove it even though you think it
189 # is not used.
190
191 installdirs::
192         @$(SHELL) $(srcdir)/script/installdirs.sh \
193                 $(DESTDIR)$(BASEDIR) \
194                 $(DESTDIR)$(bindir) \
195                 $(DESTDIR)$(sbindir) \
196                 $(DESTDIR)$(TORTUREDIR) \
197                 $(DESTDIR)$(libdir) \
198                 $(DESTDIR)$(modulesdir) \
199                 $(DESTDIR)$(mandir) \
200                 $(DESTDIR)$(localstatedir) \
201                 $(DESTDIR)$(localstatedir)/lib \
202                 $(DESTDIR)$(localstatedir)/run \
203                 $(DESTDIR)$(privatedir) \
204                 $(DESTDIR)$(datadir) \
205                 $(DESTDIR)$(piddir) \
206                 $(DESTDIR)$(lockdir) \
207                 $(DESTDIR)$(logfilebase) \
208                 $(DESTDIR)$(privatedir)/tls \
209                 $(DESTDIR)$(includedir) \
210                 $(DESTDIR)$(PKGCONFIGDIR) \
211                 $(DESTDIR)$(sysconfdir)
212
213 installbin:: installdirs
214
215 installplugins::
216
217 installlib:: $(SHARED_LIBS) $(STATIC_LIBS) installdirs
218         @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(SHLIBEXT)" $(SHARED_LIBS) 
219         #@$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(STLIBEXT)" $(STATIC_LIBS)
220
221 installheader:: headers installdirs
222         @srcdir=$(srcdir) builddir=$(builddir) $(PERL) $(srcdir)/script/installheader.pl $(DESTDIR)$(includedir) $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
223
224 installdat:: installdirs
225         @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(datadir) $(srcdir)
226
227 installswat:: installdirs
228 #SWAT has been disabled until further notice
229 #       @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
230
231 installman:: manpages installdirs
232         @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(mandir) $(MANPAGES)
233
234 installmisc:: installdirs
235         @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(SETUPDIR) $(DESTDIR)$(bindir)
236
237 installpc:: installdirs
238         @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(PKGCONFIGDIR) $(PC_FILES)
239
240 uninstall:: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader \
241         uninstallplugins
242
243 uninstallmisc::
244         #FIXME
245
246 $(DESTDIR)$(bindir)/%: bin/% installdirs
247         @mkdir -p $(@D)
248         @echo Installing $(@F) as $@
249         @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
250         @cp $< $@
251         @chmod $(INSTALLPERMS) $@
252
253 $(DESTDIR)$(sbindir)/%: bin/% installdirs
254         @mkdir -p $(@D)
255         @echo Installing $(@F) as $@
256         @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
257         @cp $< $@
258         @chmod $(INSTALLPERMS) $@
259
260 uninstallbin::
261
262 uninstalllib::
263         @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS)
264         #@$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(STATIC_LIBS) 
265
266 uninstallheader::
267         @$(SHELL) $(srcdir)/script/uninstallheader.sh $(DESTDIR)$(includedir) $(PUBLIC_HEADERS)
268
269 uninstallman::
270         @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(mandir) $(MANPAGES)
271
272 uninstallplugins::
273
274 config.status:
275         @echo "config.status does not exist. Please run ./configure."
276         @/bin/false
277
278 data.mk: config.status $(MK_FILES)
279         ./config.status
280
281 testcov-html:: 
282
283 include $(pidldir)/config.mk
284 selftestdir := $(srcdir)/selftest
285 include $(selftestdir)/config.mk
286
287 showflags::
288         @echo '  pwd        = '`/bin/pwd`