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