Patch by Matthias that removes old SWAT support and fixes uninstall.
[ira/wip.git] / source4 / Makefile
1 #!gmake
2 # The Samba 4 Makefile.
3 # This file is *NOT* autogenerated.
4 #
5 .DEFAULT_GOAL := all
6
7 default: all
8
9 include mkconfig.mk
10
11 pidldir := $(srcdir)/../pidl
12
13 basedir = $(prefix)
14 torturedir = $(libdir)/torture
15 swatdir = $(datadir)/swat
16 setupdir = $(datadir)/setup
17 ncalrpcdir = $(localstatedir)/ncalrpc
18
19 BNLD = $(LD)
20 BNLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
21
22 HOSTCC_FLAGS = -D_SAMBA_HOSTCC_ $(CFLAGS)
23 HOSTLD_FLAGS = $(LDFLAGS) $(SYS_LDFLAGS)
24
25 $(srcdir)/version.h: $(srcdir)/VERSION
26         @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
27
28 ifneq ($(automatic_dependencies),yes)
29 ALL_PREDEP = basics
30 .NOTPARALLEL:
31 endif
32
33 regen_version::
34         @$(SHELL) script/mkversion.sh VERSION $(srcdir)/version.h $(srcdir)/
35
36 clean_pch::
37         @echo "Removing precompiled headers"
38         @-rm -f include/includes.h.gch
39
40 pch:: clean_pch include/includes.h.gch
41
42 .DEFAULT_GOAL := all
43
44 ifneq ($(automatic_dependencies),yes)
45 ALL_PREDEP = basics
46 .NOTPARALLEL:
47 endif
48
49 include $(srcdir)/build/make/rules.mk
50 include $(srcdir)/build/make/python.mk
51 zlibsrcdir := lib/zlib
52 dynconfigsrcdir := dynconfig
53 heimdalsrcdir := heimdal
54 dsdbsrcdir := dsdb
55 smbdsrcdir := smbd
56 clustersrcdir := cluster
57 libnetsrcdir := libnet
58 authsrcdir := auth
59 nsswitchsrcdir := nsswitch
60 libsrcdir := lib
61 libsocketsrcdir := lib/socket
62 libcharsetsrcdir := lib/charset
63 ldb_sambasrcdir := lib/ldb-samba
64 tdbsrcdir := ../lib/tdb
65 ldbsrcdir := lib/ldb
66 libtlssrcdir := lib/tls
67 libregistrysrcdir := lib/registry
68 smbreadlinesrcdir := lib/smbreadline
69 libmessagingsrcdir := lib/messaging
70 libeventssrcdir := lib/events
71 libcmdlinesrcdir := lib/cmdline
72 poptsrcdir := ../lib/popt
73 socketwrappersrcdir := ../lib/socket_wrapper
74 nsswrappersrcdir := ../lib/nss_wrapper
75 appwebsrcdir := lib/appweb
76 libstreamsrcdir := lib/stream
77 libutilsrcdir := lib/util
78 libtdrsrcdir := lib/tdr
79 libdbwrapsrcdir := lib/dbwrap
80 libcryptosrcdir := ../lib/crypto
81 libtorturesrcdir := lib/torture
82 smb_serversrcdir := smb_server
83 libcompressionsrcdir := ../lib/compression
84 libgencachesrcdir := lib
85 paramsrcdir := param
86 rpc_serversrcdir := rpc_server
87 ldap_serversrcdir := ldap_server
88 web_serversrcdir := web_server
89 winbindsrcdir := winbind
90 nbt_serversrcdir := nbt_server
91 wrepl_serversrcdir := wrepl_server
92 cldap_serversrcdir := cldap_server
93 utilssrcdir := utils
94 clientsrcdir := client
95 torturesrcdir := torture
96 ntvfssrcdir := ntvfs
97 ntptrsrcdir := ntptr
98 librpcsrcdir := librpc
99 libclisrcdir := libcli
100 libclinbtsrcdir := ../libcli
101 pyscriptsrcdir := $(srcdir)/scripting/python
102 kdcsrcdir := kdc
103 ntp_signdsrcdir := ntp_signd
104 wmisrcdir := lib/wmi
105 tallocsrcdir := ../lib/talloc
106 comsrcdir := $(srcdir)/lib/com
107
108 include data.mk
109
110 pythonmods:: $(PYTHON_PYS) $(PYTHON_SO)
111
112 DEP_FILES = $(patsubst %.ho,%.hd,$(patsubst %.o,%.d,$(ALL_OBJS))) \
113                    include/includes.d
114
115 ifeq ($(automatic_dependencies),yes)
116 ifneq ($(MAKECMDGOALS),clean)
117 ifneq ($(MAKECMDGOALS),distclean)
118 ifneq ($(MAKECMDGOALS),realdistclean)
119 ifneq ($(SKIP_DEP_FILES),yes)
120 -include $(DEP_FILES)
121 endif
122 endif
123 endif
124 endif
125
126 ifneq ($(SKIP_DEP_FILES),yes)
127 clean::
128         @echo Removing dependency files
129         @find . -name '*.d' -o -name '*.hd' | xargs rm -f
130 endif
131 else
132 include $(srcdir)/static_deps.mk
133 endif
134
135 clean::
136         @find ../lib ../libcli -name '*.o' -o -name '*.hd' | xargs rm -f
137
138 DEFAULT_HEADERS = $(srcdir)/lib/util/dlinklist.h \
139                   $(srcdir)/version.h
140
141 libraries:: $(STATIC_LIBS) $(SHARED_LIBS)
142 modules:: $(PLUGINS)
143 headers:: $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
144 manpages:: $(MANPAGES)
145 all:: showflags $(ALL_PREDEP) binaries modules pythonmods libraries headers
146 everything:: all
147
148 LD_LIBPATH_OVERRIDE = $(LIB_PATH_VAR)=$(builddir)/bin/shared
149
150 # 'make testsuite' creates all binaries which are
151 # needed by samba3's 'make test' and the build-farm
152 # scripts use that it as fallback in case
153 # 'make everything' fails
154 testsuite:: bin/smbclient bin/cifsdd bin/smbtorture bin/nmblookup
155
156 showlayout:: 
157         @echo 'Samba will be installed into:'
158         @echo '  basedir:     $(basedir)'
159         @echo '  bindir:      $(bindir)'
160         @echo '  sbindir:     $(sbindir)'
161         @echo '  libdir:      $(libdir)'
162         @echo '  modulesdir:  $(modulesdir)'
163         @echo '  includedir:  $(includedir)'
164         @echo '  vardir:      $(localstatedir)'
165         @echo '  privatedir:  $(privatedir)'
166         @echo '  piddir:      $(piddir)'
167         @echo '  lockdir:     $(lockdir)'
168         @echo '  logfilebase: $(logfilebase)'
169         @echo '  setupdir:    $(setupdir)'
170         @echo '  swatdir:     $(swatdir)'
171         @echo '  mandir:      $(mandir)'
172         @echo '  torturedir:  $(torturedir)'
173         @echo '  datadir:     $(datadir)'
174         @echo '  winbindd_socket_dir:  $(winbindd_socket_dir)'
175         @echo '  ntp_signd_socket_dir:  $(ntp_signd_socket_dir)'
176
177 showflags::
178         @echo '  srcdir     = $(srcdir)'
179         @echo '  builddir   = $(builddir)'
180
181 # The permissions to give the executables
182 INSTALLPERMS = 0755
183
184 install:: showlayout everything installbin installsbin installdat installmisc \
185               installlib installheader installpc installplugins
186
187 # DESTDIR is used here to prevent packagers wasting their time
188 # duplicating the Makefile. Remove it and you will have the privilege
189 # of packaging each samba release for multiple versions of multiple
190 # distributions and operating systems, or at least supplying patches
191 # to all the packaging files required for this, prior to committing
192 # the removal of DESTDIR. Do not remove it even though you think it
193 # is not used.
194
195 installdirs::
196         @$(SHELL) $(srcdir)/script/installdirs.sh \
197                 $(DESTDIR)$(basedir) \
198                 $(DESTDIR)$(bindir) \
199                 $(DESTDIR)$(sbindir) \
200                 $(DESTDIR)$(torturedir) \
201                 $(DESTDIR)$(libdir) \
202                 $(DESTDIR)$(modulesdir) \
203                 $(DESTDIR)$(mandir) \
204                 $(DESTDIR)$(localstatedir) \
205                 $(DESTDIR)$(localstatedir)/lib \
206                 $(DESTDIR)$(localstatedir)/run \
207                 $(DESTDIR)$(privatedir) \
208                 $(DESTDIR)$(datadir) \
209                 $(DESTDIR)$(piddir) \
210                 $(DESTDIR)$(lockdir) \
211                 $(DESTDIR)$(logfilebase) \
212                 $(DESTDIR)$(privatedir)/tls \
213                 $(DESTDIR)$(includedir) \
214                 $(DESTDIR)$(pkgconfigdir) \
215                 $(DESTDIR)$(sysconfdir)
216
217 installbin:: installdirs
218
219 installplugins::
220
221 installlib:: $(SHARED_LIBS) $(STATIC_LIBS) installdirs
222         @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(SHLIBEXT)" $(SHARED_LIBS) 
223         #@$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(libdir) "$(STLIBEXT)" $(STATIC_LIBS)
224
225 installheader:: headers installdirs
226         @srcdir=$(srcdir) builddir=$(builddir) $(PERL) $(srcdir)/script/installheader.pl $(DESTDIR)$(includedir) $(PUBLIC_HEADERS) $(DEFAULT_HEADERS)
227
228 installdat:: installdirs
229         @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(datadir) $(srcdir)
230
231 installman:: manpages installdirs
232         @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(mandir) $(MANPAGES)
233
234 installmisc:: installdirs
235         @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(setupdir) $(DESTDIR)$(bindir)
236
237 installpc:: installdirs
238         @$(SHELL) $(srcdir)/script/installpc.sh $(builddir) $(DESTDIR)$(pkgconfigdir) $(PC_FILES)
239
240 uninstall:: uninstallbin uninstallsbin uninstalldat uninstallmisc uninstalllib uninstallheader \
241                         uninstallman uninstallpc uninstallplugins
242
243 uninstallmisc::
244         @echo "Removing MISC files"
245         @cd $(DESTDIR)$(bindir); rm -f $(notdir $(miscbinfiles))
246
247 $(DESTDIR)$(bindir)/%: bin/% installdirs
248         @mkdir -p $(@D)
249         @echo Installing $(@F) as $@
250         @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
251         @cp $< $@
252         @chmod $(INSTALLPERMS) $@
253
254 $(DESTDIR)$(sbindir)/%: bin/% installdirs
255         @mkdir -p $(@D)
256         @echo Installing $(@F) as $@
257         @if test -f $@; then echo -n ""; rm -f $@.old; mv $@ $@.old; fi
258         @cp $< $@
259         @chmod $(INSTALLPERMS) $@
260
261 uninstalldat::
262         @echo "Removing DAT files"
263         @rm -fr $(DESTDIR)$(datadir)/*
264
265 uninstallbin::
266
267 uninstalllib::
268         @echo "Removing libraries"
269         @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS)
270
271 uninstallheader::
272         @echo "Removing headers"
273         @rm -fr $(DESTDIR)$(includedir)/*
274
275 uninstallman::
276         @echo "Removing manpages"
277         @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(mandir) $(MANPAGES)
278
279 uninstallpc::
280         @echo "Removing package configurations"
281         @cd $(DESTDIR)$(pkgconfigdir); rm -f $(notdir $(PC_FILES))
282
283 config.status:
284         @echo "config.status does not exist. Please run ./configure."
285         @/bin/false
286
287 data.mk: config.status $(MK_FILES)
288         ./config.status
289
290 testcov-html:: 
291
292 include $(pidldir)/config.mk
293 selftestdir := $(srcdir)/selftest
294 include $(selftestdir)/config.mk
295
296 showflags::
297         @echo '  pwd        = '`/bin/pwd`