More syntax fixes, use more standard python functions.
[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 '  srcdir     = $(srcdir)'
77         @echo '  builddir   = $(builddir)'
78
79 # The permissions to give the executables
80 INSTALLPERMS = 0755
81
82 install:: showlayout everything installbin installdat installswat installmisc installlib \
83         installheader installpc installplugins
84
85 # DESTDIR is used here to prevent packagers wasting their time
86 # duplicating the Makefile. Remove it and you will have the privilege
87 # of packaging each samba release for multiple versions of multiple
88 # distributions and operating systems, or at least supplying patches
89 # to all the packaging files required for this, prior to committing
90 # the removal of DESTDIR. Do not remove it even though you think it
91 # is not used.
92
93 installdirs::
94         @$(SHELL) $(srcdir)/script/installdirs.sh \
95                 $(DESTDIR)$(BASEDIR) \
96                 $(DESTDIR)$(BINDIR) \
97                 $(DESTDIR)$(SBINDIR) \
98                 $(DESTDIR)$(TORTUREDIR) \
99                 $(DESTDIR)$(LIBDIR) \
100                 $(DESTDIR)$(MODULESDIR) \
101                 $(DESTDIR)$(MANDIR) \
102                 $(DESTDIR)$(VARDIR) \
103                 $(DESTDIR)$(PRIVATEDIR) \
104                 $(DESTDIR)$(DATADIR) \
105                 $(DESTDIR)$(PIDDIR) \
106                 $(DESTDIR)$(LOCKDIR) \
107                 $(DESTDIR)$(LOGFILEBASE) \
108                 $(DESTDIR)$(PRIVATEDIR)/tls \
109                 $(DESTDIR)$(INCLUDEDIR) \
110                 $(DESTDIR)$(PKGCONFIGDIR) \
111                 $(DESTDIR)$(CONFIGDIR) \
112
113 installbin:: $(SBIN_PROGS) $(BIN_PROGS) $(TORTURE_PROGS) installdirs
114         @$(SHELL) $(srcdir)/script/installbin.sh \
115                 $(INSTALLPERMS) \
116                 $(DESTDIR)$(BASEDIR) \
117                 $(DESTDIR)$(SBINDIR) \
118                 $(DESTDIR)$(LIBDIR) \
119                 $(DESTDIR)$(VARDIR) \
120                 $(SBIN_PROGS)
121         @$(SHELL) $(srcdir)/script/installbin.sh \
122                 $(INSTALLPERMS) \
123                 $(DESTDIR)$(BASEDIR) \
124                 $(DESTDIR)$(BINDIR) \
125                 $(DESTDIR)$(LIBDIR) \
126                 $(DESTDIR)$(VARDIR) \
127                 $(BIN_PROGS)
128         @$(SHELL) $(srcdir)/script/installtorture.sh \
129                 $(INSTALLPERMS) \
130                 $(DESTDIR)$(TORTUREDIR) \
131                 $(TORTURE_PROGS)
132
133 installlib:: $(INSTALLABLE_SHARED_LIBS) $(STATIC_LIBS) installdirs
134         @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(LIBDIR) "$(SHLIBEXT)" $(INSTALLABLE_SHARED_LIBS) 
135         #@$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(LIBDIR) "$(STLIBEXT)" $(STATIC_LIBS)
136
137 installheader:: headers installdirs
138         @srcdir=$(srcdir) builddir=$(builddir) $(PERL) $(srcdir)/script/installheader.pl $(DESTDIR)$(INCLUDEDIR) $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
139
140 installdat:: installdirs
141         @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(DATADIR) $(srcdir)
142
143 installswat:: installdirs
144         @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
145
146 installman:: manpages installdirs
147         @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(MANDIR) $(MANPAGES)
148
149 installmisc:: installdirs
150         @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(JSDIR) $(DESTDIR)$(SETUPDIR) $(DESTDIR)$(BINDIR)
151
152 installpc:: installdirs
153         @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(PKGCONFIGDIR) $(PC_FILES)
154
155 uninstall:: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader \
156         uninstallplugins
157
158 uninstallmisc::
159         #FIXME
160
161 uninstallbin::
162         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(SBIN_PROGS)
163         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(BIN_PROGS)
164         @$(SHELL) $(srcdir)/script/uninstalltorture.sh $(DESTDIR)$(TORTUREDIR) $(TORTURE_PROGS)
165
166 uninstalllib::
167         @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(LIBDIR) $(SHARED_LIBS)
168         #@$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(LIBDIR) $(STATIC_LIBS) 
169
170 uninstallheader::
171         @$(SHELL) $(srcdir)/script/uninstallheader.sh $(DESTDIR)$(INCLUDEDIR) $(PUBLIC_HEADERS)
172
173 uninstallman::
174         @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(MANPAGES)
175
176 Makefile: config.status $(MK_FILES)
177         ./config.status
178
179 pidl/Makefile: pidl/Makefile.PL
180         cd pidl && $(PERL) Makefile.PL 
181
182 testcov-html:: pidl-testcov
183
184 pidl-testcov: pidl/Makefile
185         cd pidl && cover -test
186
187 installpidl:: pidl/Makefile
188         $(MAKE) -C pidl install
189
190 uninstallpidl:: pidl/Makefile
191         $(MAKE) -C pidl uninstall
192
193 $(IDL_HEADER_FILES) \
194         $(IDL_NDR_PARSE_H_FILES) $(IDL_NDR_PARSE_C_FILES) \
195         $(IDL_NDR_CLIENT_C_FILES) $(IDL_NDR_CLIENT_H_FILES) \
196         $(IDL_NDR_SERVER_C_FILES) $(IDL_SWIG_FILES) \
197         $(IDL_NDR_EJS_C_FILES) $(IDL_NDR_EJS_H_FILES) \
198         $(IDL_NDR_PY_C_FILES) $(IDL_NDR_PY_H_FILES): idl
199
200 idl_full:: pidl/lib/Parse/Pidl/IDL.pm pidl/lib/Parse/Pidl/Expr.pm 
201         @CPP="$(CPP)" PERL="$(PERL)" srcdir=$(srcdir) $(srcdir)/script/build_idl.sh FULL
202
203 idl:: pidl/lib/Parse/Pidl/IDL.pm pidl/lib/Parse/Pidl/Expr.pm 
204         @CPP="$(CPP)" PERL="$(PERL)" srcdir=$(srcdir) $(srcdir)/script/build_idl.sh PARTIAL 
205
206 pidl/lib/Parse/Pidl/IDL.pm: pidl/idl.yp
207         -$(YAPP) -m 'Parse::Pidl::IDL' -o pidl/lib/Parse/Pidl/IDL.pm pidl/idl.yp ||\
208                 touch pidl/lib/Parse/Pidl/IDL.pm 
209
210 pidl/lib/Parse/Pidl/Expr.pm: pidl/idl.yp
211         -$(YAPP) -m 'Parse::Pidl::Expr' -o pidl/lib/Parse/Pidl/Expr.pm pidl/expr.yp ||\
212                 touch pidl/lib/Parse/Pidl/Expr.pm 
213
214 mkinclude selftest/config.mk
215 mkinclude rules.mk
216
217 showflags::
218         @echo '  pwd        = '`/bin/pwd`