Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into 4-0-abartlet
[amitay/samba.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 DEP_FILES = $(patsubst %.ho,%.hd,$(patsubst %.o,%.d,$(ALL_OBJS))) \
55                    include/includes.d
56
57 ifeq ($(automatic_dependencies),yes)
58 ifneq ($(MAKECMDGOALS),clean)
59 ifneq ($(MAKECMDGOALS),distclean)
60 ifneq ($(MAKECMDGOALS),realdistclean)
61 ifneq ($(SKIP_DEP_FILES),yes)
62 -include $(DEP_FILES)
63 endif
64 endif
65 endif
66 endif
67
68 ifneq ($(SKIP_DEP_FILES),yes)
69 clean::
70         @echo Removing dependency files
71         @find . -name '*.d' -o -name '*.hd' | xargs rm -f
72 endif
73 else
74 include $(srcdir)/static_deps.mk
75 endif
76
77 DEFAULT_HEADERS = $(srcdir)/lib/util/dlinklist.h \
78                   $(srcdir)/version.h
79
80 binaries:: $(BINARIES)
81 libraries:: $(STATIC_LIBS) $(SHARED_LIBS)
82 modules:: $(PLUGINS)
83 headers:: $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
84 manpages:: $(MANPAGES)
85 all:: showflags $(ALL_PREDEP) bin/asn1_compile bin/compile_et binaries modules pythonmods libraries headers
86 everything:: all
87
88 LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)=$(builddir)/bin/shared
89
90 # 'make testsuite' creates all binaries which are
91 # needed by samba3's 'make test' and the build-farm
92 # scripts use that it as fallback in case
93 # 'make everything' fails
94 testsuite:: bin/smbclient bin/cifsdd bin/smbtorture bin/nmblookup
95
96 showlayout:: 
97         @echo 'Samba will be installed into:'
98         @echo '  basedir:     $(BASEDIR)'
99         @echo '  bindir:      $(bindir)'
100         @echo '  sbindir:     $(sbindir)'
101         @echo '  libdir:      $(libdir)'
102         @echo '  modulesdir:  $(modulesdir)'
103         @echo '  includedir:  $(includedir)'
104         @echo '  vardir:      $(localstatedir)'
105         @echo '  privatedir:  $(privatedir)'
106         @echo '  piddir:      $(piddir)'
107         @echo '  lockdir:     $(lockdir)'
108         @echo '  logfilebase: $(logfilebase)'
109         @echo '  setupdir:    $(SETUPDIR)'
110         @echo '  jsdir:       $(JSDIR)'
111         @echo '  swatdir:     $(SWATDIR)'
112         @echo '  mandir:      $(mandir)'
113         @echo '  torturedir:  $(TORTUREDIR)'
114         @echo '  datadir:     $(datadir)'
115         @echo '  winbindd_socket_dir:  $(winbindd_socket_dir)'
116
117 showflags::
118         @echo '  srcdir     = $(srcdir)'
119         @echo '  builddir   = $(builddir)'
120
121 # The permissions to give the executables
122 INSTALLPERMS = 0755
123
124 install:: showlayout everything installbin installdat installswat installmisc \
125               installlib installheader installpc installplugins
126
127 # DESTDIR is used here to prevent packagers wasting their time
128 # duplicating the Makefile. Remove it and you will have the privilege
129 # of packaging each samba release for multiple versions of multiple
130 # distributions and operating systems, or at least supplying patches
131 # to all the packaging files required for this, prior to committing
132 # the removal of DESTDIR. Do not remove it even though you think it
133 # is not used.
134
135 installdirs::
136         @$(SHELL) $(srcdir)/script/installdirs.sh \
137                 $(DESTDIR)$(BASEDIR) \
138                 $(DESTDIR)$(bindir) \
139                 $(DESTDIR)$(sbindir) \
140                 $(DESTDIR)$(TORTUREDIR) \
141                 $(DESTDIR)$(libdir) \
142                 $(DESTDIR)$(modulesdir) \
143                 $(DESTDIR)$(mandir) \
144                 $(DESTDIR)$(localstatedir) \
145                 $(DESTDIR)$(privatedir) \
146                 $(DESTDIR)$(datadir) \
147                 $(DESTDIR)$(piddir) \
148                 $(DESTDIR)$(lockdir) \
149                 $(DESTDIR)$(logfilebase) \
150                 $(DESTDIR)$(privatedir)/tls \
151                 $(DESTDIR)$(includedir) \
152                 $(DESTDIR)$(PKGCONFIGDIR) \
153                 $(DESTDIR)$(sysconfdir) \
154
155 installbin:: $(SBIN_PROGS) $(BIN_PROGS) $(TORTURE_PROGS) installdirs
156         @$(SHELL) $(srcdir)/script/installbin.sh \
157                 $(INSTALLPERMS) \
158                 $(DESTDIR)$(BASEDIR) \
159                 $(DESTDIR)$(sbindir) \
160                 $(DESTDIR)$(libdir) \
161                 $(DESTDIR)$(localstatedir) \
162                 $(SBIN_PROGS)
163         @$(SHELL) $(srcdir)/script/installbin.sh \
164                 $(INSTALLPERMS) \
165                 $(DESTDIR)$(BASEDIR) \
166                 $(DESTDIR)$(bindir) \
167                 $(DESTDIR)$(libdir) \
168                 $(DESTDIR)$(localstatedir) \
169                 $(BIN_PROGS)
170         @$(SHELL) $(srcdir)/script/installtorture.sh \
171                 $(INSTALLPERMS) \
172                 $(DESTDIR)$(TORTUREDIR) \
173                 $(TORTURE_PROGS)
174
175 installplugins::
176
177 installlib:: $(SHARED_LIBS) $(STATIC_LIBS) installdirs
178         @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(SHLIBEXT)" $(SHARED_LIBS) 
179         #@$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(STLIBEXT)" $(STATIC_LIBS)
180
181 installheader:: headers installdirs
182         @srcdir=$(srcdir) builddir=$(builddir) $(PERL) $(srcdir)/script/installheader.pl $(DESTDIR)$(includedir) $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
183
184 installdat:: installdirs
185         @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(datadir) $(srcdir)
186
187 installswat:: installdirs
188 #SWAT has been disabled until further notice
189 #       @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
190
191 installman:: manpages installdirs
192         @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(mandir) $(MANPAGES)
193
194 installmisc:: installdirs
195         @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(JSDIR) $(DESTDIR)$(SETUPDIR) $(DESTDIR)$(bindir)
196
197 installpc:: installdirs
198         @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(PKGCONFIGDIR) $(PC_FILES)
199
200 uninstall:: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader \
201         uninstallplugins
202
203 uninstallmisc::
204         #FIXME
205
206 uninstallbin::
207         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(sbindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(SBIN_PROGS)
208         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(BIN_PROGS)
209         @$(SHELL) $(srcdir)/script/uninstalltorture.sh $(DESTDIR)$(TORTUREDIR) $(TORTURE_PROGS)
210
211 uninstalllib::
212         @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS)
213         #@$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(STATIC_LIBS) 
214
215 uninstallheader::
216         @$(SHELL) $(srcdir)/script/uninstallheader.sh $(DESTDIR)$(includedir) $(PUBLIC_HEADERS)
217
218 uninstallman::
219         @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(mandir) $(MANPAGES)
220
221 uninstallplugins::
222
223 config.status:
224         @echo "config.status does not exist. Please run ./configure."
225         @/bin/false
226
227 data.mk: config.status $(MK_FILES)
228         ./config.status
229
230 testcov-html:: 
231
232 include pidl/config.mk
233 include selftest/config.mk
234
235 showflags::
236         @echo '  pwd        = '`/bin/pwd`