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