Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-python
[ira/wip.git] / source / main.mk
1 VPATH = $(builddir):$(srcdir):heimdal_build:heimdal/lib/asn1:heimdal/lib/krb5:heimdal/lib/gssapi:heimdal/lib/hdb:heimdal/lib/roken:heimdal/lib/des
2
3 BASEDIR = $(prefix)
4 TORTUREDIR = $(libdir)/torture
5 SWATDIR = $(datadir)/swat
6 JSDIR = $(datadir)/js
7 SETUPDIR = $(datadir)/setup
8 NCALRPCDIR = $(localstatedir)/ncalrpc
9
10 BNLD = $(LD)
11 BNLD_FLAGS = $(LDFLAGS)
12
13 HOSTCC_FLAGS = -D_SAMBA_HOSTCC_ $(CFLAGS)
14 HOSTLD_FLAGS = $(LDFLAGS)
15
16 default: all
17
18 include dynconfig.mk
19 include heimdal_build/config.mk
20 include config.mk
21 include dsdb/config.mk
22 include smbd/config.mk
23 include cluster/config.mk
24 include smbd/process_model.mk
25 include libnet/config.mk
26 include auth/config.mk
27 include nsswitch/config.mk
28 include lib/basic.mk
29 include param/config.mk
30 include smb_server/config.mk
31 include rpc_server/config.mk
32 include ldap_server/config.mk
33 include web_server/config.mk
34 include winbind/config.mk
35 include nbt_server/config.mk
36 include wrepl_server/config.mk
37 include cldap_server/config.mk
38 include utils/net/config.mk
39 include utils/config.mk
40 include ntvfs/config.mk
41 include ntptr/config.mk
42 include torture/config.mk
43 include librpc/config.mk
44 include client/config.mk
45 include libcli/config.mk
46 include scripting/ejs/config.mk
47 include scripting/python/config.mk
48 include kdc/config.mk
49
50 DEFAULT_HEADERS = $(srcdir)/lib/util/dlinklist.h \
51                   $(srcdir)/version.h
52
53 binaries:: $(BINARIES)
54 libraries:: $(STATIC_LIBS) $(SHARED_LIBS)
55 modules:: $(SHARED_MODULES)
56 headers:: $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
57 manpages:: $(MANPAGES)
58 all:: showflags $(ALL_PREDEP) bin/asn1_compile bin/compile_et binaries modules pythonmods
59 everything:: all libraries headers
60
61 LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)=$(builddir)/bin/shared
62
63 # 'make testsuite' creates all binaries which are
64 # needed by samba3's 'make test' and the build-farm
65 # scripts use that it as fallback in case
66 # 'make everything' fails
67 testsuite:: bin/smbclient bin/cifsdd bin/smbtorture bin/nmblookup
68
69 showlayout:: 
70         @echo 'Samba will be installed into:'
71         @echo '  basedir:     $(BASEDIR)'
72         @echo '  bindir:      $(bindir)'
73         @echo '  sbindir:     $(sbindir)'
74         @echo '  libdir:      $(libdir)'
75         @echo '  modulesdir:  $(modulesdir)'
76         @echo '  includedir:  $(includedir)'
77         @echo '  vardir:      $(localstatedir)'
78         @echo '  privatedir:  $(privatedir)'
79         @echo '  piddir:      $(piddir)'
80         @echo '  lockdir:     $(lockdir)'
81         @echo '  logfilebase: $(logfilebase)'
82         @echo '  setupdir:    $(SETUPDIR)'
83         @echo '  jsdir:       $(JSDIR)'
84         @echo '  swatdir:     $(SWATDIR)'
85         @echo '  mandir:      $(mandir)'
86         @echo '  torturedir:  $(TORTUREDIR)'
87         @echo '  datadir:     $(datadir)'
88         @echo '  winbindd_socket_dir:  $(winbindd_socket_dir)'
89
90 showflags::
91         @echo '  srcdir     = $(srcdir)'
92         @echo '  builddir   = $(builddir)'
93
94 # The permissions to give the executables
95 INSTALLPERMS = 0755
96
97 install:: showlayout everything installbin installdat installswat installmisc installlib \
98         installheader installpc installplugins
99
100 # DESTDIR is used here to prevent packagers wasting their time
101 # duplicating the Makefile. Remove it and you will have the privilege
102 # of packaging each samba release for multiple versions of multiple
103 # distributions and operating systems, or at least supplying patches
104 # to all the packaging files required for this, prior to committing
105 # the removal of DESTDIR. Do not remove it even though you think it
106 # is not used.
107
108 installdirs::
109         @$(SHELL) $(srcdir)/script/installdirs.sh \
110                 $(DESTDIR)$(BASEDIR) \
111                 $(DESTDIR)$(bindir) \
112                 $(DESTDIR)$(sbindir) \
113                 $(DESTDIR)$(TORTUREDIR) \
114                 $(DESTDIR)$(libdir) \
115                 $(DESTDIR)$(modulesdir) \
116                 $(DESTDIR)$(mandir) \
117                 $(DESTDIR)$(localstatedir) \
118                 $(DESTDIR)$(privatedir) \
119                 $(DESTDIR)$(datadir) \
120                 $(DESTDIR)$(piddir) \
121                 $(DESTDIR)$(lockdir) \
122                 $(DESTDIR)$(logfilebase) \
123                 $(DESTDIR)$(privatedir)/tls \
124                 $(DESTDIR)$(includedir) \
125                 $(DESTDIR)$(PKGCONFIGDIR) \
126                 $(DESTDIR)$(sysconfdir) \
127
128 installbin:: $(SBIN_PROGS) $(BIN_PROGS) $(TORTURE_PROGS) installdirs
129         @$(SHELL) $(srcdir)/script/installbin.sh \
130                 $(INSTALLPERMS) \
131                 $(DESTDIR)$(BASEDIR) \
132                 $(DESTDIR)$(sbindir) \
133                 $(DESTDIR)$(libdir) \
134                 $(DESTDIR)$(localstatedir) \
135                 $(SBIN_PROGS)
136         @$(SHELL) $(srcdir)/script/installbin.sh \
137                 $(INSTALLPERMS) \
138                 $(DESTDIR)$(BASEDIR) \
139                 $(DESTDIR)$(bindir) \
140                 $(DESTDIR)$(libdir) \
141                 $(DESTDIR)$(localstatedir) \
142                 $(BIN_PROGS)
143         @$(SHELL) $(srcdir)/script/installtorture.sh \
144                 $(INSTALLPERMS) \
145                 $(DESTDIR)$(TORTUREDIR) \
146                 $(TORTURE_PROGS)
147
148 installlib:: $(INSTALLABLE_SHARED_LIBS) $(STATIC_LIBS) installdirs
149         @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(SHLIBEXT)" $(INSTALLABLE_SHARED_LIBS) 
150         #@$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(STLIBEXT)" $(STATIC_LIBS)
151
152 installheader:: headers installdirs
153         @srcdir=$(srcdir) builddir=$(builddir) $(PERL) $(srcdir)/script/installheader.pl $(DESTDIR)$(includedir) $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
154
155 installdat:: installdirs
156         @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(datadir) $(srcdir)
157
158 installswat:: installdirs
159         @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
160
161 installman:: manpages installdirs
162         @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(mandir) $(MANPAGES)
163
164 installmisc:: installdirs
165         @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(JSDIR) $(DESTDIR)$(SETUPDIR) $(DESTDIR)$(bindir)
166
167 installpc:: installdirs
168         @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(PKGCONFIGDIR) $(PC_FILES)
169
170 uninstall:: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader \
171         uninstallplugins
172
173 uninstallmisc::
174         #FIXME
175
176 uninstallbin::
177         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(sbindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(SBIN_PROGS)
178         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(BIN_PROGS)
179         @$(SHELL) $(srcdir)/script/uninstalltorture.sh $(DESTDIR)$(TORTUREDIR) $(TORTURE_PROGS)
180
181 uninstalllib::
182         @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS)
183         #@$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(STATIC_LIBS) 
184
185 uninstallheader::
186         @$(SHELL) $(srcdir)/script/uninstallheader.sh $(DESTDIR)$(includedir) $(PUBLIC_HEADERS)
187
188 uninstallman::
189         @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(mandir) $(MANPAGES)
190
191 Makefile: config.status $(MK_FILES)
192         ./config.status
193
194 pidl/Makefile: pidl/Makefile.PL
195         cd pidl && $(PERL) Makefile.PL 
196
197 testcov-html:: pidl-testcov
198
199 pidl-testcov: pidl/Makefile
200         cd pidl && cover -test
201
202 installpidl:: pidl/Makefile
203         $(MAKE) -C pidl install
204
205 uninstallpidl:: pidl/Makefile
206         $(MAKE) -C pidl uninstall
207
208 $(IDL_HEADER_FILES) \
209         $(IDL_NDR_PARSE_H_FILES) $(IDL_NDR_PARSE_C_FILES) \
210         $(IDL_NDR_CLIENT_C_FILES) $(IDL_NDR_CLIENT_H_FILES) \
211         $(IDL_NDR_SERVER_C_FILES) $(IDL_SWIG_FILES) \
212         $(IDL_NDR_EJS_C_FILES) $(IDL_NDR_EJS_H_FILES) \
213         $(IDL_NDR_PY_C_FILES) $(IDL_NDR_PY_H_FILES): idl
214
215 idl_full:: pidl/lib/Parse/Pidl/IDL.pm pidl/lib/Parse/Pidl/Expr.pm 
216         @CPP="$(CPP)" PERL="$(PERL)" srcdir=$(srcdir) $(srcdir)/script/build_idl.sh FULL
217
218 idl:: pidl/lib/Parse/Pidl/IDL.pm pidl/lib/Parse/Pidl/Expr.pm 
219         @CPP="$(CPP)" PERL="$(PERL)" srcdir=$(srcdir) $(srcdir)/script/build_idl.sh PARTIAL 
220
221 pidl/lib/Parse/Pidl/IDL.pm: pidl/idl.yp
222         -$(YAPP) -m 'Parse::Pidl::IDL' -o pidl/lib/Parse/Pidl/IDL.pm pidl/idl.yp ||\
223                 touch pidl/lib/Parse/Pidl/IDL.pm 
224
225 pidl/lib/Parse/Pidl/Expr.pm: pidl/idl.yp
226         -$(YAPP) -m 'Parse::Pidl::Expr' -o pidl/lib/Parse/Pidl/Expr.pm pidl/expr.yp ||\
227                 touch pidl/lib/Parse/Pidl/Expr.pm 
228
229 mkinclude selftest/config.mk
230 mkinclude rules.mk
231
232 showflags::
233         @echo '  pwd        = '`/bin/pwd`