Use variable for selftest directory.
[tprouty/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 VPATH = $(builddir):$(srcdir):$(srcdir)/heimdal_build:$(heimdalsrcdir)/lib/asn1:$(heimdalsrcdir)/lib/krb5:$(heimdalsrcdir)/lib/gssapi:$(heimdalsrcdir)/lib/hdb:$(heimdalsrcdir)/lib/roken:$(heimdalsrcdir)/lib/des
14
15 BASEDIR = $(prefix)
16 TORTUREDIR = $(libdir)/torture
17 SWATDIR = $(datadir)/swat
18 JSDIR = $(datadir)/js
19 SETUPDIR = $(datadir)/setup
20 NCALRPCDIR = $(localstatedir)/ncalrpc
21
22 BNLD = $(LD)
23 BNLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
24
25 HOSTCC_FLAGS = -D_SAMBA_HOSTCC_ $(CFLAGS)
26 HOSTLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
27
28 $(srcdir)/version.h: $(srcdir)/VERSION
29         @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
30
31 ifneq ($(automatic_dependencies),yes)
32 ALL_PREDEP = basics
33 .NOTPARALLEL:
34 endif
35
36 regen_version::
37         @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
38
39 clean_pch::
40         @echo "Removing precompiled headers"
41         @-rm -f include/includes.h.gch
42
43 pch:: clean_pch include/includes.h.gch
44
45 .DEFAULT_GOAL := all
46
47 ifneq ($(automatic_dependencies),yes)
48 ALL_PREDEP = basics
49 .NOTPARALLEL:
50 endif
51
52 include $(srcdir)/build/make/rules.mk
53 include $(srcdir)/build/make/python.mk
54 dynconfigsrcdir := dynconfig
55 heimdalsrcdir := heimdal
56 dsdbsrcdir := dsdb
57 smbdsrcdir := smbd
58 clustersrcdir := cluster
59 libnetsrcdir := libnet
60 authsrcdir := auth
61 nsswitchsrcdir := nsswitch
62 libsrcdir := lib
63 libsocketsrcdir := lib/socket
64 libcharsetsrcdir := lib/charset
65 ldb_sambasrcdir := lib/ldb-samba
66 tdbsrcdir := lib/tdb
67 ldbsrcdir := lib/ldb
68 libtlssrcdir := lib/tls
69 libregistrysrcdir := lib/registry
70 smbreadlinesrcdir := lib/smbreadline
71 libmessagingsrcdir := lib/messaging
72 libeventssrcdir := lib/events
73 libcmdlinesrcdir := lib/cmdline
74 poptsrcdir := lib/popt
75 socketwrappersrcdir := lib/socket_wrapper
76 nsswrappersrcdir := lib/nss_wrapper
77 appwebsrcdir := lib/appweb
78 libstreamsrcdir := lib/stream
79 libutilsrcdir := lib/util
80 libtdrsrcdir := lib/tdr
81 libdbwrapsrcdir := lib/dbwrap
82 libcryptosrcdir := lib/crypto
83 libtorturesrcdir := lib/torture
84 smb_serversrcdir := smb_server
85 libcompressionsrcdir := lib/compression
86 libgencachesrcdir := lib
87 paramsrcdir := param
88 rpc_serversrcdir := rpc_server
89 ldap_serversrcdir := ldap_server
90 web_serversrcdir := web_server
91 winbindsrcdir := winbind
92 nbt_serversrcdir := nbt_server
93 wrepl_serversrcdir := wrepl_server
94 cldap_serversrcdir := cldap_server
95 utilssrcdir := utils
96 clientsrcdir := client
97 torturesrcdir := torture
98 ntvfssrcdir := ntvfs
99 ntptrsrcdir := ntptr
100 librpcsrcdir := librpc
101 libclisrcdir := libcli
102 ejsscriptsrcdir := scripting/ejs
103 pyscriptsrcdir := $(srcdir)/scripting/python
104 kdcsrcdir := kdc
105 ntp_signdsrcdir := ntp_signd
106
107 include data.mk
108
109 BINARIES += $(BIN_PROGS) $(SBIN_PROGS)
110
111 pythonmods:: $(PYTHON_PYS) $(PYTHON_SO)
112
113 DEP_FILES = $(patsubst %.ho,%.hd,$(patsubst %.o,%.d,$(ALL_OBJS))) \
114                    include/includes.d
115
116 ifeq ($(automatic_dependencies),yes)
117 ifneq ($(MAKECMDGOALS),clean)
118 ifneq ($(MAKECMDGOALS),distclean)
119 ifneq ($(MAKECMDGOALS),realdistclean)
120 ifneq ($(SKIP_DEP_FILES),yes)
121 -include $(DEP_FILES)
122 endif
123 endif
124 endif
125 endif
126
127 ifneq ($(SKIP_DEP_FILES),yes)
128 clean::
129         @echo Removing dependency files
130         @find . -name '*.d' -o -name '*.hd' | xargs rm -f
131 endif
132 else
133 include $(srcdir)/static_deps.mk
134 endif
135
136 DEFAULT_HEADERS = $(srcdir)/lib/util/dlinklist.h \
137                   $(srcdir)/version.h
138
139 binaries:: $(BINARIES)
140 libraries:: $(STATIC_LIBS) $(SHARED_LIBS)
141 modules:: $(PLUGINS)
142 headers:: $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
143 manpages:: $(MANPAGES)
144 all:: showflags $(ALL_PREDEP) bin/asn1_compile bin/compile_et binaries modules pythonmods libraries headers
145 everything:: all
146
147 LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)=$(builddir)/bin/shared
148
149 # 'make testsuite' creates all binaries which are
150 # needed by samba3's 'make test' and the build-farm
151 # scripts use that it as fallback in case
152 # 'make everything' fails
153 testsuite:: bin/smbclient bin/cifsdd bin/smbtorture bin/nmblookup
154
155 showlayout:: 
156         @echo 'Samba will be installed into:'
157         @echo '  basedir:     $(BASEDIR)'
158         @echo '  bindir:      $(bindir)'
159         @echo '  sbindir:     $(sbindir)'
160         @echo '  libdir:      $(libdir)'
161         @echo '  modulesdir:  $(modulesdir)'
162         @echo '  includedir:  $(includedir)'
163         @echo '  vardir:      $(localstatedir)'
164         @echo '  privatedir:  $(privatedir)'
165         @echo '  piddir:      $(piddir)'
166         @echo '  lockdir:     $(lockdir)'
167         @echo '  logfilebase: $(logfilebase)'
168         @echo '  setupdir:    $(SETUPDIR)'
169         @echo '  jsdir:       $(JSDIR)'
170         @echo '  swatdir:     $(SWATDIR)'
171         @echo '  mandir:      $(mandir)'
172         @echo '  torturedir:  $(TORTUREDIR)'
173         @echo '  datadir:     $(datadir)'
174         @echo '  winbindd_socket_dir:  $(winbindd_socket_dir)'
175         @echo '  ntp_signd_socket_dir:  $(ntp_signd_socket_dir)'
176
177 showflags::
178         @echo '  srcdir     = $(srcdir)'
179         @echo '  builddir   = $(builddir)'
180
181 # The permissions to give the executables
182 INSTALLPERMS = 0755
183
184 install:: showlayout everything installbin installdat installswat installmisc \
185               installlib installheader installpc installplugins
186
187 # DESTDIR is used here to prevent packagers wasting their time
188 # duplicating the Makefile. Remove it and you will have the privilege
189 # of packaging each samba release for multiple versions of multiple
190 # distributions and operating systems, or at least supplying patches
191 # to all the packaging files required for this, prior to committing
192 # the removal of DESTDIR. Do not remove it even though you think it
193 # is not used.
194
195 installdirs::
196         @$(SHELL) $(srcdir)/script/installdirs.sh \
197                 $(DESTDIR)$(BASEDIR) \
198                 $(DESTDIR)$(bindir) \
199                 $(DESTDIR)$(sbindir) \
200                 $(DESTDIR)$(TORTUREDIR) \
201                 $(DESTDIR)$(libdir) \
202                 $(DESTDIR)$(modulesdir) \
203                 $(DESTDIR)$(mandir) \
204                 $(DESTDIR)$(localstatedir) \
205                 $(DESTDIR)$(privatedir) \
206                 $(DESTDIR)$(datadir) \
207                 $(DESTDIR)$(piddir) \
208                 $(DESTDIR)$(lockdir) \
209                 $(DESTDIR)$(logfilebase) \
210                 $(DESTDIR)$(privatedir)/tls \
211                 $(DESTDIR)$(includedir) \
212                 $(DESTDIR)$(PKGCONFIGDIR) \
213                 $(DESTDIR)$(sysconfdir) \
214
215 installbin:: $(SBIN_PROGS) $(BIN_PROGS) $(TORTURE_PROGS) installdirs
216         @$(SHELL) $(srcdir)/script/installbin.sh \
217                 $(INSTALLPERMS) \
218                 $(DESTDIR)$(BASEDIR) \
219                 $(DESTDIR)$(sbindir) \
220                 $(DESTDIR)$(libdir) \
221                 $(DESTDIR)$(localstatedir) \
222                 $(SBIN_PROGS)
223         @$(SHELL) $(srcdir)/script/installbin.sh \
224                 $(INSTALLPERMS) \
225                 $(DESTDIR)$(BASEDIR) \
226                 $(DESTDIR)$(bindir) \
227                 $(DESTDIR)$(libdir) \
228                 $(DESTDIR)$(localstatedir) \
229                 $(BIN_PROGS)
230         @$(SHELL) $(srcdir)/script/installtorture.sh \
231                 $(INSTALLPERMS) \
232                 $(DESTDIR)$(TORTUREDIR) \
233                 $(TORTURE_PROGS)
234
235 installplugins::
236
237 installlib:: $(SHARED_LIBS) $(STATIC_LIBS) installdirs
238         @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(SHLIBEXT)" $(SHARED_LIBS) 
239         #@$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(STLIBEXT)" $(STATIC_LIBS)
240
241 installheader:: headers installdirs
242         @srcdir=$(srcdir) builddir=$(builddir) $(PERL) $(srcdir)/script/installheader.pl $(DESTDIR)$(includedir) $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
243
244 installdat:: installdirs
245         @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(datadir) $(srcdir)
246
247 installswat:: installdirs
248 #SWAT has been disabled until further notice
249 #       @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
250
251 installman:: manpages installdirs
252         @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(mandir) $(MANPAGES)
253
254 installmisc:: installdirs
255         @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(JSDIR) $(DESTDIR)$(SETUPDIR) $(DESTDIR)$(bindir)
256
257 installpc:: installdirs
258         @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(PKGCONFIGDIR) $(PC_FILES)
259
260 uninstall:: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader \
261         uninstallplugins
262
263 uninstallmisc::
264         #FIXME
265
266 uninstallbin::
267         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(sbindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(SBIN_PROGS)
268         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(BIN_PROGS)
269         @$(SHELL) $(srcdir)/script/uninstalltorture.sh $(DESTDIR)$(TORTUREDIR) $(TORTURE_PROGS)
270
271 uninstalllib::
272         @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS)
273         #@$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(STATIC_LIBS) 
274
275 uninstallheader::
276         @$(SHELL) $(srcdir)/script/uninstallheader.sh $(DESTDIR)$(includedir) $(PUBLIC_HEADERS)
277
278 uninstallman::
279         @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(mandir) $(MANPAGES)
280
281 uninstallplugins::
282
283 config.status:
284         @echo "config.status does not exist. Please run ./configure."
285         @/bin/false
286
287 data.mk: config.status $(MK_FILES)
288         ./config.status
289
290 testcov-html:: 
291
292 include $(pidldir)/config.mk
293 selftestdir := $(srcdir)/selftest
294 include $(selftestdir)/config.mk
295
296 showflags::
297         @echo '  pwd        = '`/bin/pwd`