r11244: Relative path names in .mk files
[jelmer/samba4-debian.git] / source / main.mk
1 # master list of build config files for Samba4
2 include heimdal_build/config.mk
3 include config.mk
4 include dsdb/config.mk
5 include gtk/config.mk
6 include smbd/config.mk
7 include smbd/process_model.mk
8 include libnet/config.mk
9 include auth/config.mk
10 include nsswitch/config.mk
11 include lib/basic.mk
12 include param/config.mk
13 include smb_server/config.mk
14 include rpc_server/config.mk
15 include ldap_server/config.mk
16 include web_server/config.mk
17 include winbind/config.mk
18 include nbt_server/config.mk
19 include wrepl_server/config.mk
20 include cldap_server/config.mk
21 include utils/net/config.mk
22 include utils/config.mk
23 include ntvfs/config.mk
24 include ntptr/config.mk
25 include torture/config.mk
26 include librpc/config.mk
27 include client/config.mk
28 include libcli/config.mk
29 include scripting/config.mk
30 include kdc/config.mk
31
32 all: binary_asn1_compile binary_compile_et binaries
33 binaries: $(BIN_PROGS) $(SBIN_PROGS)
34 manpages: $(MANPAGES)
35 everything: all
36
37 showlayout: 
38         @echo "Samba will be installed into:"
39         @echo "  basedir: $(BASEDIR)"
40         @echo "  bindir:  $(BINDIR)"
41         @echo "  sbindir: $(SBINDIR)"
42         @echo "  libdir:  $(LIBDIR)"
43         @echo "  vardir:  $(VARDIR)"
44         @echo "  privatedir:  $(PRIVATEDIR)"
45         @echo "  piddir:   $(PIDDIR)"
46         @echo "  lockdir:  $(LOCKDIR)"
47         @echo "  swatdir:  $(SWATDIR)"
48         @echo "  mandir:   $(MANDIR)"
49
50 showflags:
51         @echo "Samba will be compiled with flags:"
52         @echo "  CFLAGS = $(CFLAGS)"
53         @echo "  LD_FLAGS = $(LD_FLAGS)"
54         @echo "  STLD_FLAGS = $(STLD_FLAGS)"
55         @echo "  SHLD_FLAGS = $(SHLD_FLAGS)"
56         @echo "  LIBS = $(LIBS)"
57
58 install: showlayout installbin installdat installswat installmisc
59
60 # DESTDIR is used here to prevent packagers wasting their time
61 # duplicating the Makefile. Remove it and you will have the privilege
62 # of packaging each samba release for multiple versions of multiple
63 # distributions and operating systems, or at least supplying patches
64 # to all the packaging files required for this, prior to committing
65 # the removal of DESTDIR. Do not remove it even though you think it
66 # is not used.
67
68 installdirs:
69         @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(PRIVATEDIR) $(DESTDIR)$(PIDDIR) $(DESTDIR)$(LOCKDIR) $(DESTDIR)$(PRIVATEDIR)/tls
70
71 installbin: binaries installdirs
72         @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(SBIN_PROGS)
73         @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(BIN_PROGS)
74
75 installdat: installdirs
76         @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(LIBDIR) $(srcdir)
77
78 installswat: installdirs
79         @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir) $(DESTDIR)$(LIBDIR)
80
81 installman: installdirs
82         @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(MANDIR) $(MANPAGES)
83
84 installmisc: installdirs
85         @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(BINDIR)
86
87 uninstall: uninstallbin uninstallman uninstallmisc
88
89 uninstallmisc:
90         #FIXME
91
92 uninstallbin:
93         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(SBIN_PROGS)
94         @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(BIN_PROGS)
95
96 uninstallman:
97         @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(MANPAGES)
98
99
100 etags:
101         etags `find $(srcdir) -name "*.[ch]"`
102
103 ctags:
104         ctags `find $(srcdir) -name "*.[ch]"`
105
106 idl_full: pidl/lib/Parse/Pidl/IDL.pm
107         @CPP="$(CPP)" PERL="$(PERL)" script/build_idl.sh FULL $(PIDL_ARGS)
108
109 idl: pidl/lib/Parse/Pidl/IDL.pm
110         @CPP="$(CPP)" PERL="$(PERL)" script/build_idl.sh PARTIAL $(PIDL_ARGS)
111
112 pidl/lib/Parse/Pidl/IDL.pm: pidl/idl.yp
113         -$(YAPP) -s -m 'Parse::Pidl::IDL' -o pidl/lib/Parse/Pidl/IDL.pm pidl/idl.yp 
114
115 smb_interfaces: pidl/smb_interfaces.pm
116         $(PERL) -Ipidl script/build_smb_interfaces.pl \
117                 include/smb_interfaces.h
118
119 pidl/smb_interfaces.pm: pidl/smb_interfaces.yp
120         -$(YAPP) -s -m 'smb_interfaces' -o pidl/smb_interfaces.pm pidl/smb_interfaces.yp 
121
122 include/config.h:
123         @echo "include/config.h not present"
124         @echo "You need to rerun ./autogen.sh and ./configure"
125         @/bin/false
126
127 include/proto.h: $(PROTO_PROTO_OBJS:.o=.c)
128         @-rm -f include/includes.h.gch
129         @$(SHELL) script/mkproto.sh "$(PERL)" \
130           -h _PROTO_H_ include/proto.h \
131           $(PROTO_PROTO_OBJS)
132         @touch include/proto.h
133
134 proto: include/proto.h
135 pch: include/config.h \
136         include/proto.h \
137         idl \
138         include/includes.h.gch
139
140 basics: include/config.h \
141         include/proto.h \
142         idl \
143         heimdal_basics
144
145 test: $(DEFAULT_TEST_TARGET)
146
147 test-swrap: all
148         ./script/tests/selftest.sh ${selftest_prefix}/st all SOCKET_WRAPPER
149
150 test-noswrap: all
151         ./script/tests/selftest.sh ${selftest_prefix}/st all
152
153 quicktest: all
154         ./script/tests/selftest.sh ${selftest_prefix}/st quick SOCKET_WRAPPER
155
156 valgrindtest: all
157         SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
158         ./script/tests/selftest.sh ${selftest_prefix}/st quick SOCKET_WRAPPER
159
160 .y.c:
161         @echo "Building $< with $(YACC)"
162         @-$(srcdir)/script/yacc_compile.sh "$(YACC)" "$<" "$@"
163
164 .l.c:
165         @echo "Building $< with $(LEX)"
166         @-$(srcdir)/script/lex_compile.sh "$(LEX)" "$<" "$@"