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