Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into registry
[sfrench/samba-autobuild/.git] / source4 / Makefile
1 #!gmake
2 # The Samba 4 Makefile.
3 # This file is *NOT* autogenerated.
4
5 include mkconfig.mk
6
7 VPATH = $(builddir):$(srcdir):heimdal_build:heimdal/lib/asn1:heimdal/lib/krb5:heimdal/lib/gssapi:heimdal/lib/hdb:heimdal/lib/roken:heimdal/lib/des
8
9 BASEDIR = $(prefix)
10 TORTUREDIR = $(libdir)/torture
11 SWATDIR = $(datadir)/swat
12 JSDIR = $(datadir)/js
13 SETUPDIR = $(datadir)/setup
14 NCALRPCDIR = $(localstatedir)/ncalrpc
15
16 BNLD = $(LD)
17 BNLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
18
19 HOSTCC_FLAGS = -D_SAMBA_HOSTCC_ $(CFLAGS)
20 HOSTLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
21
22 $(srcdir)/version.h: $(srcdir)/VERSION
23         @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
24
25 .DEFAULT_GOAL := all
26
27 ifneq ($(automatic_dependencies),yes)
28 ALL_PREDEP = proto
29 .NOTPARALLEL:
30 endif
31
32 regen_version::
33         @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
34
35 clean_pch::
36         @echo "Removing precompiled headers"
37         @-rm -f include/includes.h.gch
38
39 pch:: clean_pch include/includes.h.gch
40
41 .DEFAULT_GOAL := all
42
43 ifneq ($(automatic_dependencies),yes)
44 ALL_PREDEP = proto
45 .NOTPARALLEL:
46 endif
47
48 include build/make/rules.mk
49 include build/make/python.mk
50 include data.mk
51
52 BINARIES += $(BIN_PROGS) $(SBIN_PROGS)
53
54 pythonmods:: $(PYTHON_PYS) $(PYTHON_SO)
55
56 DEP_FILES = $(patsubst %.ho,%.hd,$(patsubst %.o,%.d,$(ALL_OBJS))) \
57                    include/includes.d
58
59 ifeq ($(automatic_dependencies),yes)
60 ifneq ($(MAKECMDGOALS),clean)
61 ifneq ($(MAKECMDGOALS),distclean)
62 ifneq ($(MAKECMDGOALS),realdistclean)
63 ifneq ($(SKIP_DEP_FILES),yes)
64 -include $(DEP_FILES)
65 endif
66 endif
67 endif
68 endif
69
70 ifneq ($(SKIP_DEP_FILES),yes)
71 clean::
72         @echo Removing dependency files
73         @find . -name '*.d' -o -name '*.hd' | xargs rm -f
74 endif
75 else
76 include $(srcdir)/static_deps.mk
77 endif
78
79 DEFAULT_HEADERS = $(srcdir)/lib/util/dlinklist.h \
80                   $(srcdir)/version.h
81
82 binaries:: $(BINARIES)
83 libraries:: $(STATIC_LIBS) $(SHARED_LIBS)
84 modules:: $(PLUGINS)
85 headers:: $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
86 manpages:: $(MANPAGES)
87 all:: showflags $(ALL_PREDEP) bin/asn1_compile bin/compile_et binaries modules pythonmods libraries headers
88 everything:: all
89
90 LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)=$(builddir)/bin/shared
91
92 # 'make testsuite' creates all binaries which are
93 # needed by samba3's 'make test' and the build-farm
94 # scripts use that it as fallback in case
95 # 'make everything' fails
96 testsuite:: bin/smbclient bin/cifsdd bin/smbtorture bin/nmblookup
97
98 showlayout:: 
99         @echo 'Samba will be installed into:'
100         @echo '  basedir:     $(BASEDIR)'
101         @echo '  bindir:      $(bindir)'
102         @echo '  sbindir:     $(sbindir)'
103         @echo '  libdir:      $(libdir)'
104         @echo '  modulesdir:  $(modulesdir)'
105         @echo '  includedir:  $(includedir)'
106         @echo '  vardir:      $(localstatedir)'
107         @echo '  privatedir:  $(privatedir)'
108         @echo '  piddir:      $(piddir)'
109         @echo '  lockdir:     $(lockdir)'
110         @echo '  logfilebase: $(logfilebase)'
111         @echo '  setupdir:    $(SETUPDIR)'
112         @echo '  jsdir:       $(JSDIR)'
113         @echo '  swatdir:     $(SWATDIR)'
114         @echo '  mandir:      $(mandir)'
115         @echo '  torturedir:  $(TORTUREDIR)'
116         @echo '  datadir:     $(datadir)'
117         @echo '  winbindd_socket_dir:  $(winbindd_socket_dir)'
118
119 showflags::
120         @echo '  srcdir     = $(srcdir)'
121         @echo '  builddir   = $(builddir)'
122
123 # The permissions to give the executables
124 INSTALLPERMS = 0755
125
126 install:: showlayout everything installbin installdat installswat installmisc \
127               installlib installheader installpc installplugins
128
129 # DESTDIR is used here to prevent packagers wasting their time
130 # duplicating the Makefile. Remove it and you will have the privilege
131 # of packaging each samba release for multiple versions of multiple
132 # distributions and operating systems, or at least supplying patches
133 # to all the packaging files required for this, prior to committing
134 # the removal of DESTDIR. Do not remove it even though you think it
135 # is not used.
136
137 installdirs::
138         @$(SHELL) $(srcdir)/script/installdirs.sh \
139                 $(DESTDIR)$(BASEDIR) \
140                 $(DESTDIR)$(bindir) \
141                 $(DESTDIR)$(sbindir) \
142                 $(DESTDIR)$(TORTUREDIR) \
143                 $(DESTDIR)$(libdir) \
144                 $(DESTDIR)$(modulesdir) \
145                 $(DESTDIR)$(mandir) \
146                 $(DESTDIR)$(localstatedir) \
147                 $(DESTDIR)$(privatedir) \
148                 $(DESTDIR)$(datadir) \
149                 $(DESTDIR)$(piddir) \
150                 $(DESTDIR)$(lockdir) \
151                 $(DESTDIR)$(logfilebase) \
152                 $(DESTDIR)$(privatedir)/tls \
153                 $(DESTDIR)$(includedir) \
154                 $(DESTDIR)$(PKGCONFIGDIR) \
155                 $(DESTDIR)$(sysconfdir) \
156
157 installbin:: $(SBIN_PROGS) $(BIN_PROGS) $(TORTURE_PROGS) installdirs
158         @$(SHELL) $(srcdir)/script/installbin.sh \
159                 $(INSTALLPERMS) \
160                 $(DESTDIR)$(BASEDIR) \
161                 $(DESTDIR)$(sbindir) \
162                 $(DESTDIR)$(libdir) \
163                 $(DESTDIR)$(localstatedir) \
164                 $(SBIN_PROGS)
165         @$(SHELL) $(srcdir)/script/installbin.sh \
166                 $(INSTALLPERMS) \
167                 $(DESTDIR)$(BASEDIR) \
168                 $(DESTDIR)$(bindir) \
169                 $(DESTDIR)$(libdir) \
170                 $(DESTDIR)$(localstatedir) \
171                 $(BIN_PROGS)
172         @$(SHELL) $(srcdir)/script/installtorture.sh \
173                 $(INSTALLPERMS) \
174                 $(DESTDIR)$(TORTUREDIR) \
175                 $(TORTURE_PROGS)
176
177 installplugins::
178
179 installlib:: $(SHARED_LIBS) $(STATIC_LIBS) installdirs
180         @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(SHLIBEXT)" $(SHARED_LIBS) 
181         #@$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(STLIBEXT)" $(STATIC_LIBS)
182
183 installheader:: headers installdirs
184         @srcdir=$(srcdir) builddir=$(builddir) $(PERL) $(srcdir)/script/installheader.pl $(DESTDIR)$(includedir) $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
185
186 installdat:: installdirs
187         @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(datadir) $(srcdir)
188
189 installswat:: installdirs
190 #SWAT has been disabled until further notice
191 #       @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
192
193 installman:: manpages installdirs
194         @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(mandir) $(MANPAGES)
195
196 installmisc:: installdirs
197         @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(JSDIR) $(DESTDIR)$(SETUPDIR) $(DESTDIR)$(bindir)
198
199 installpc:: installdirs
200         @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(PKGCONFIGDIR) $(PC_FILES)
201
202 uninstall:: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader \
203         uninstallplugins
204
205 uninstallmisc::
206         #FIXME
207
208 uninstallbin::
209         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(sbindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(SBIN_PROGS)
210         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(BIN_PROGS)
211         @$(SHELL) $(srcdir)/script/uninstalltorture.sh $(DESTDIR)$(TORTUREDIR) $(TORTURE_PROGS)
212
213 uninstalllib::
214         @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS)
215         #@$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(STATIC_LIBS) 
216
217 uninstallheader::
218         @$(SHELL) $(srcdir)/script/uninstallheader.sh $(DESTDIR)$(includedir) $(PUBLIC_HEADERS)
219
220 uninstallman::
221         @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(mandir) $(MANPAGES)
222
223 uninstallplugins::
224
225 config.status:
226         @echo "config.status does not exist. Please run ./configure."
227         @/bin/false
228
229 data.mk: config.status $(MK_FILES)
230         ./config.status
231
232 testcov-html:: 
233
234 include pidl/config.mk
235 include selftest/config.mk
236
237 showflags::
238         @echo '  pwd        = '`/bin/pwd`