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