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