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