r12269: Update to current lorikeet-heimdal. This changed the way the hdb
[ab/samba.git/.git] / source4 / main.mk
1 all: basics bin/asn1_compile bin/compile_et binaries
2
3 include heimdal_build/config.mk
4 include config.mk
5 include dsdb/config.mk
6 include gtk/config.mk
7 include smbd/config.mk
8 include smbd/process_model.mk
9 include libnet/config.mk
10 include auth/config.mk
11 include nsswitch/config.mk
12 include lib/basic.mk
13 include param/config.mk
14 include smb_server/config.mk
15 include rpc_server/config.mk
16 include ldap_server/config.mk
17 include web_server/config.mk
18 include winbind/config.mk
19 include nbt_server/config.mk
20 include wrepl_server/config.mk
21 include cldap_server/config.mk
22 include utils/net/config.mk
23 include utils/config.mk
24 include ntvfs/config.mk
25 include ntptr/config.mk
26 include torture/config.mk
27 include librpc/config.mk
28 include client/config.mk
29 include libcli/config.mk
30 include scripting/config.mk
31 include kdc/config.mk
32
33 binaries: $(BINARIES)
34 libraries: $(STATIC_LIBS) $(SHARED_LIBS)
35 headers: $(PUBLIC_HEADERS)
36 manpages: $(MANPAGES)
37 everything: all
38
39 showlayout: 
40         @echo "Samba will be installed into:"
41         @echo "  basedir: $(BASEDIR)"
42         @echo "  bindir:  $(BINDIR)"
43         @echo "  sbindir: $(SBINDIR)"
44         @echo "  libdir:  $(LIBDIR)"
45         @echo "  includedir:  $(INCLUDEDIR)"
46         @echo "  vardir:  $(VARDIR)"
47         @echo "  privatedir:  $(PRIVATEDIR)"
48         @echo "  piddir:   $(PIDDIR)"
49         @echo "  lockdir:  $(LOCKDIR)"
50         @echo "  swatdir:  $(SWATDIR)"
51         @echo "  mandir:   $(MANDIR)"
52
53 showflags:
54         @echo "Samba will be compiled with flags:"
55         @echo "  CFLAGS = $(CFLAGS)"
56         @echo "  LDFLAGS = $(LDFLAGS)"
57         @echo "  STLD_FLAGS = $(STLD_FLAGS)"
58         @echo "  SHLD_FLAGS = $(SHLD_FLAGS)"
59         @echo "  LIBS = $(LIBS)"
60
61 # The permissions to give the executables
62 INSTALLPERMS = 0755
63
64 # set these to where to find various files
65 # These can be overridden by command line switches (see smbd(8))
66 # or in smb.conf (see smb.conf(5))
67 CONFIGFILE = $(CONFIGDIR)/smb.conf
68 PKGCONFIGDIR = $(LIBDIR)/pkgconfig
69 LMHOSTSFILE = $(CONFIGDIR)/lmhosts
70
71 PATH_FLAGS = -DCONFIGFILE=\"$(CONFIGFILE)\"  -DSBINDIR=\"$(SBINDIR)\" \
72          -DBINDIR=\"$(BINDIR)\" -DLMHOSTSFILE=\"$(LMHOSTSFILE)\" \
73          -DLOCKDIR=\"$(LOCKDIR)\" -DPIDDIR=\"$(PIDDIR)\" -DLIBDIR=\"$(LIBDIR)\" \
74          -DLOGFILEBASE=\"$(LOGFILEBASE)\" -DSHLIBEXT=\"$(SHLIBEXT)\" \
75          -DCONFIGDIR=\"$(CONFIGDIR)\" -DNCALRPCDIR=\"$(NCALRPCDIR)\" \
76          -DSWATDIR=\"$(SWATDIR)\" -DPRIVATE_DIR=\"$(PRIVATEDIR)\"
77
78 install: showlayout installbin installdat installswat installmisc installlib \
79         installheader installpc
80
81 # DESTDIR is used here to prevent packagers wasting their time
82 # duplicating the Makefile. Remove it and you will have the privilege
83 # of packaging each samba release for multiple versions of multiple
84 # distributions and operating systems, or at least supplying patches
85 # to all the packaging files required for this, prior to committing
86 # the removal of DESTDIR. Do not remove it even though you think it
87 # is not used.
88
89 installdirs:
90         @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(PRIVATEDIR) $(DESTDIR)$(PIDDIR) $(DESTDIR)$(LOCKDIR) $(DESTDIR)$(PRIVATEDIR)/tls $(DESTDIR)$(INCLUDEDIR) $(DESTDIR)$(PKGCONFIGDIR)
91
92 installbin: $(SBIN_PROGS) $(BIN_PROGS) installdirs
93         @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(SBIN_PROGS)
94         @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(BIN_PROGS)
95
96 installlib: libraries installdirs
97         @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(LIBDIR) $(SHARED_LIBS) 
98         @$(SHELL) $(srcdir)/script/installlib.sh $(DESTDIR)$(LIBDIR) $(STATIC_LIBS)
99
100 installheader: headers installdirs
101         @$(SHELL) $(srcdir)/script/installheader.sh $(DESTDIR)$(INCLUDEDIR) $(PUBLIC_HEADERS)
102
103 installdat: installdirs
104         @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(LIBDIR) $(srcdir)
105
106 installswat: installdirs
107         @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir) $(DESTDIR)$(LIBDIR)
108
109 installman: installdirs
110         @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(MANDIR) $(MANPAGES)
111
112 installmisc: installdirs
113         @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(BINDIR)
114
115 installpc: installdirs
116         @$(SHELL) $(srcdir)/script/installpc.sh $(srcdir) $(DESTDIR)$(PKGCONFIGDIR) $(PC_FILES)
117
118 uninstall: uninstallbin uninstallman uninstallmisc uninstalllib uninstallheader
119
120 uninstallmisc:
121         #FIXME
122
123 uninstallbin:
124         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(SBIN_PROGS)
125         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(BIN_PROGS)
126
127 uninstalllib:
128         @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(LIBDIR) $(SHARED_LIBS)
129         @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(LIBDIR) $(STATIC_LIBS) 
130
131 uninstallheader:
132         @$(SHELL) $(srcdir)/script/uninstallheader.sh $(DESTDIR)$(INCLUDEDIR) $(PUBLIC_HEADERS)
133
134 uninstallman:
135         @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(MANPAGES)
136
137 Makefile: config.status $(MK_FILES)
138         ./config.status
139
140 etags:
141         etags `find $(srcdir) -name "*.[ch]"`
142
143 ctags:
144         ctags `find $(srcdir) -name "*.[ch]"`
145
146 pidl/Makefile: pidl/Makefile.PL
147         cd pidl && $(PERL) Makefile.PL
148
149 installpidl: pidl/Makefile
150         cd pidl && $(MAKE) install
151
152 idl_full: pidl/lib/Parse/Pidl/IDL.pm
153         @CPP="$(CPP)" PERL="$(PERL)" script/build_idl.sh FULL $(PIDL_ARGS)
154
155 idl: pidl/lib/Parse/Pidl/IDL.pm
156         @CPP="$(CPP)" PERL="$(PERL)" script/build_idl.sh PARTIAL $(PIDL_ARGS)
157
158 pidl/lib/Parse/Pidl/IDL.pm: pidl/idl.yp
159         -$(YAPP) -s -m 'Parse::Pidl::IDL' -o pidl/lib/Parse/Pidl/IDL.pm pidl/idl.yp 
160
161 smb_interfaces: pidl/smb_interfaces.pm
162         $(PERL) -Ipidl script/build_smb_interfaces.pl \
163                 include/smb_interfaces.h
164
165 pidl/smb_interfaces.pm: pidl/smb_interfaces.yp
166         -$(YAPP) -s -m 'smb_interfaces' -o pidl/smb_interfaces.pm pidl/smb_interfaces.yp 
167
168 include/config.h:
169         @echo "include/config.h not present"
170         @echo "You need to rerun ./autogen.sh and ./configure"
171         @/bin/false
172
173 include/proto.h: $(PROTO_PROTO_OBJ_LIST:.o=.c)
174         @-rm -f include/includes.h.gch
175         @$(SHELL) script/mkproto.sh "$(PERL)" \
176           -h _PROTO_H_ include/proto.h \
177           $(PROTO_PROTO_OBJ_LIST)
178         @touch include/proto.h
179
180 proto: include/proto.h
181 pch: include/config.h \
182         include/proto.h \
183         idl \
184         include/includes.h.gch
185
186 basics: include/config.h \
187         include/proto.h \
188         idl \
189         heimdal_basics
190
191 clean: heimdal_clean
192         @echo Removing headers
193         @-rm -f include/proto.h
194         @echo Removing objects
195         @-find . -name '*.o' -exec rm -f '{}' \;
196         @echo Removing binaries
197         @-rm -f $(BIN_PROGS) $(SBIN_PROGS)
198         @echo Removing libraries
199         @-rm -f bin/*.$(SHLIBEXT).*
200         @echo Removing dummy targets
201         @-rm -f bin/.*_*
202         @echo Removing generated files
203         @-rm -rf librpc/gen_* 
204         @-rm -f lib/registry/regf.h lib/registry/tdr_regf*
205
206 distclean: clean
207         -rm -f bin/.dummy 
208         -rm -f include/config.h include/smb_build.h
209         -rm -f Makefile 
210         -rm -f config.status
211         -rm -f config.log config.cache
212         -rm -f samba4-deps.dot
213         -rm -f config.pm config.mk
214
215 removebackup:
216         -rm -f *.bak *~ */*.bak */*~ */*/*.bak */*/*~ */*/*/*.bak */*/*/*~
217
218 realdistclean: distclean removebackup
219         -rm -f include/config.h.in
220         -rm -f include/version.h
221         -rm -f configure
222         -rm -f $(MANPAGES)
223
224 test: $(DEFAULT_TEST_TARGET)
225
226 test-swrap: all
227         ./script/tests/selftest.sh ${selftest_prefix}/st all SOCKET_WRAPPER
228
229 test-noswrap: all
230         ./script/tests/selftest.sh ${selftest_prefix}/st all
231
232 quicktest: all
233         ./script/tests/selftest.sh ${selftest_prefix}/st quick SOCKET_WRAPPER
234
235 valgrindtest: all
236         SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
237         ./script/tests/selftest.sh ${selftest_prefix}/st quick SOCKET_WRAPPER
238
239 bin/.dummy:
240         @: >> $@ || : > $@
241
242 ###############################################################################
243 # File types
244 ###############################################################################
245
246 .SUFFIXES: .x .c .et .y .l .d .o .h .h.gch .a .so .1 .1.xml .3 .3.xml .5 .5.xml .7 .7.xml .ho
247
248 .c.d:
249         @echo "Generating dependencies for $<"
250         @$(CC) -MM -MG -MT $(<:.c=.o) -MF $@ $(CFLAGS) $<
251
252 .y.c:
253         @echo "Building $< with $(YACC)"
254         @-$(srcdir)/script/yacc_compile.sh "$(YACC)" "$<" "$@"
255
256 .l.c:
257         @echo "Building $< with $(LEX)"
258         @-$(srcdir)/script/lex_compile.sh "$(LEX)" "$<" "$@"
259
260 DOCBOOK_MANPAGE_URL = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
261
262 .1.xml.1:
263         $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
264
265 .3.xml.3:
266         $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
267
268 .5.xml.5:
269         $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<
270
271 .7.xml.7:
272         $(XSLTPROC) -o $@ $(DOCBOOK_MANPAGE_URL) $<