s4-srvsvc: merge srvsvc_NetFileEnum from s3 idl.
[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/util/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 libclinbtsrcdir := ../libcli/nbt
101 pyscriptsrcdir := $(srcdir)/scripting/python
102 kdcsrcdir := kdc
103 ntp_signdsrcdir := ntp_signd
104 wmisrcdir := lib/wmi
105 tallocsrcdir := ../lib/talloc
106 comsrcdir := $(srcdir)/lib/com
107
108 include data.mk
109
110 $(foreach SCRIPT,$(wildcard scripting/bin/*),$(eval $(call binary_install_template,$(SCRIPT))))
111
112 $(DESTDIR)$(bindir)/%: scripting/bin/% installdirs
113         @mkdir -p $(@D)
114         @echo Installing $(@F) as $@
115         @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
116         @cp $< $@
117         @chmod $(INSTALLPERMS) $@
118
119 pythonmods:: $(PYTHON_PYS) $(PYTHON_SO)
120
121 DEP_FILES = $(patsubst %.ho,%.hd,$(patsubst %.o,%.d,$(ALL_OBJS))) \
122                    include/includes.d
123
124 ifeq ($(automatic_dependencies),yes)
125 ifneq ($(MAKECMDGOALS),clean)
126 ifneq ($(MAKECMDGOALS),distclean)
127 ifneq ($(MAKECMDGOALS),realdistclean)
128 ifneq ($(SKIP_DEP_FILES),yes)
129 -include $(DEP_FILES)
130 endif
131 endif
132 endif
133 endif
134
135 ifneq ($(SKIP_DEP_FILES),yes)
136 clean::
137         @echo Removing dependency files
138         @find . -name '*.d' -o -name '*.hd' | xargs rm -f
139 endif
140 else
141 include $(srcdir)/static_deps.mk
142 endif
143
144 clean::
145         @find ../lib ../libcli -name '*.o' -o -name '*.ho' | xargs rm -f
146
147 DEFAULT_HEADERS = $(srcdir)/../lib/util/dlinklist.h \
148                   $(srcdir)/version.h
149
150 libraries:: $(STATIC_LIBS) $(SHARED_LIBS)
151 modules:: $(PLUGINS)
152 headers:: $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
153 manpages:: $(MANPAGES)
154 all:: showflags $(ALL_PREDEP) binaries modules pythonmods libraries headers
155 everything:: all
156
157 LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)=$(builddir)/bin/shared
158
159 # 'make testsuite' creates all binaries which are
160 # needed by samba3's 'make test' and the build-farm
161 # scripts use that it as fallback in case
162 # 'make everything' fails
163 testsuite:: bin/smbclient bin/cifsdd bin/smbtorture bin/nmblookup
164
165 showlayout:: 
166         @echo 'Samba will be installed into:'
167         @echo '  basedir:     $(basedir)'
168         @echo '  bindir:      $(bindir)'
169         @echo '  sbindir:     $(sbindir)'
170         @echo '  libdir:      $(libdir)'
171         @echo '  modulesdir:  $(modulesdir)'
172         @echo '  includedir:  $(includedir)'
173         @echo '  vardir:      $(localstatedir)'
174         @echo '  privatedir:  $(privatedir)'
175         @echo '  piddir:      $(piddir)'
176         @echo '  lockdir:     $(lockdir)'
177         @echo '  logfilebase: $(logfilebase)'
178         @echo '  setupdir:    $(setupdir)'
179         @echo '  swatdir:     $(swatdir)'
180         @echo '  mandir:      $(mandir)'
181         @echo '  torturedir:  $(torturedir)'
182         @echo '  datadir:     $(datadir)'
183         @echo '  winbindd_socket_dir:  $(winbindd_socket_dir)'
184         @echo '  ntp_signd_socket_dir:  $(ntp_signd_socket_dir)'
185
186 showflags::
187         @echo '  srcdir     = $(srcdir)'
188         @echo '  builddir   = $(builddir)'
189
190 # The permissions to give the executables
191 INSTALLPERMS = 0755
192
193 install:: showlayout everything installbin installsbin installdat installmisc \
194               installlib installheader installpc installplugins
195
196 # DESTDIR is used here to prevent packagers wasting their time
197 # duplicating the Makefile. Remove it and you will have the privilege
198 # of packaging each samba release for multiple versions of multiple
199 # distributions and operating systems, or at least supplying patches
200 # to all the packaging files required for this, prior to committing
201 # the removal of DESTDIR. Do not remove it even though you think it
202 # is not used.
203
204 installdirs::
205         @$(SHELL) $(srcdir)/script/installdirs.sh \
206                 $(DESTDIR)$(basedir) \
207                 $(DESTDIR)$(bindir) \
208                 $(DESTDIR)$(sbindir) \
209                 $(DESTDIR)$(torturedir) \
210                 $(DESTDIR)$(libdir) \
211                 $(DESTDIR)$(modulesdir) \
212                 $(DESTDIR)$(mandir) \
213                 $(DESTDIR)$(localstatedir) \
214                 $(DESTDIR)$(localstatedir)/lib \
215                 $(DESTDIR)$(localstatedir)/run \
216                 $(DESTDIR)$(privatedir) \
217                 $(DESTDIR)$(datadir) \
218                 $(DESTDIR)$(piddir) \
219                 $(DESTDIR)$(lockdir) \
220                 $(DESTDIR)$(logfilebase) \
221                 $(DESTDIR)$(privatedir)/tls \
222                 $(DESTDIR)$(includedir) \
223                 $(DESTDIR)$(pkgconfigdir) \
224                 $(DESTDIR)$(sysconfdir)
225
226 installbin:: installdirs
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 installman:: manpages installdirs
241         @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(mandir) $(MANPAGES)
242
243 installmisc:: installdirs
244         @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(setupdir)
245
246 installpc:: installdirs
247         @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(pkgconfigdir) $(PC_FILES)
248
249 uninstall:: uninstallbin uninstallsbin uninstalldat uninstallmisc uninstalllib uninstallheader \
250                         uninstallman uninstallpc uninstallplugins
251
252 uninstallmisc::
253         @echo "Removing MISC files"
254         @rm -rf $(DESTDIR)$(setupdir)/*
255
256 $(DESTDIR)$(bindir)/%: bin/% installdirs
257         @mkdir -p $(@D)
258         @echo Installing $(@F) as $@
259         @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
260         @cp $< $@
261         @chmod $(INSTALLPERMS) $@
262
263 $(DESTDIR)$(sbindir)/%: bin/% installdirs
264         @mkdir -p $(@D)
265         @echo Installing $(@F) as $@
266         @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
267         @cp $< $@
268         @chmod $(INSTALLPERMS) $@
269
270 uninstalldat::
271         @echo "Removing DAT files"
272         @rm -fr $(DESTDIR)$(datadir)/*
273
274 uninstallbin::
275
276 uninstalllib::
277         @echo "Removing libraries"
278         @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS)
279
280 uninstallheader::
281         @echo "Removing headers"
282         @rm -fr $(DESTDIR)$(includedir)/*
283
284 uninstallman::
285         @echo "Removing manpages"
286         @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(mandir) $(MANPAGES)
287
288 uninstallplugins::
289
290 uninstallpc::
291         @echo "Removing package configurations"
292         @cd $(DESTDIR)$(pkgconfigdir); rm -f $(notdir $(PC_FILES))
293
294 config.status:
295         @echo "config.status does not exist. Please run ./configure."
296         @/bin/false
297
298 data.mk: config.status $(MK_FILES)
299         ./config.status
300
301 testcov-html:: 
302
303 include $(pidldir)/config.mk
304 selftestdir := $(srcdir)/../selftest
305 include $(srcdir)/selftest/config.mk
306
307 showflags::
308         @echo '  pwd        = '`/bin/pwd`