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