1 ###########################################################
2 ### SMB Build System ###
3 ### - create output for Makefile ###
5 ### Copyright (C) Stefan (metze) Metzmacher 2004 ###
6 ### Released under the GNU GPL ###
7 ###########################################################
9 sub _prepare_command_interpreters($)
21 sub _prepare_path_vars($)
28 exec_prefix=\@exec_prefix\@
37 CONFIGDIR = \@configdir\@
38 VARDIR = \@localstatedir\@
40 # The permissions to give the executables
43 # set these to where to find various files
44 # These can be overridden by command line switches (see smbd(8))
45 # or in smb.conf (see smb.conf(5))
46 LOGFILEBASE = \@logfilebase\@
47 CONFIGFILE = \$(CONFIGDIR)/smb.conf
48 LMHOSTSFILE = \$(CONFIGDIR)/lmhosts
50 # This is where smbpasswd et al go
51 PRIVATEDIR = \@privatedir\@
52 SMB_PASSWD_FILE = \$(PRIVATEDIR)/smbpasswd
54 # the directory where lock files go
57 # the directory where pid files go
60 PASSWD_FLAGS = -DSMB_PASSWD_FILE=\\\"\$(SMB_PASSWD_FILE)\\\" -DPRIVATE_DIR=\\\"\$(PRIVATEDIR)\\\"
61 PATH_FLAGS1 = -DCONFIGFILE=\\\"\$(CONFIGFILE)\\\" -DSBINDIR=\\\"\$(SBINDIR)\\\"
62 PATH_FLAGS2 = \$(PATH_FLAGS1) -DBINDIR=\\\"\$(BINDIR)\\\"
63 PATH_FLAGS3 = \$(PATH_FLAGS2) -DLMHOSTSFILE=\\\"\$(LMHOSTSFILE)\\\"
64 PATH_FLAGS4 = \$(PATH_FLAGS3) -DLOCKDIR=\\\"\$(LOCKDIR)\\\" -DPIDDIR=\\\"\$(PIDDIR)\\\"
65 PATH_FLAGS5 = \$(PATH_FLAGS4) -DLIBDIR=\\\"\$(LIBDIR)\\\" \\
66 -DLOGFILEBASE=\\\"\$(LOGFILEBASE)\\\" -DSHLIBEXT=\\\"\@SHLIBEXT\@\\\"
67 PATH_FLAGS6 = \$(PATH_FLAGS5) -DCONFIGDIR=\\\"\$(CONFIGDIR)\\\"
68 PATH_FLAGS = \$(PATH_FLAGS6) \$(PASSWD_FLAGS)
73 sub _prepare_compiler_linker($)
80 CC_FLAGS=-Iinclude -I. -I\$(srcdir)/include -I\$(srcdir) -Ilib \@CFLAGS\@ \@CPPFLAGS\@
83 LD_FLAGS=\@LDFLAGS\@ \@CFLAGS\@
89 SHLD_FLAGS=\@LDSHFLAGS\@ \@LDFLAGS\@
94 sub _prepare_default_rule($)
105 sub _prepare_SUFFIXES($)
112 .SUFFIXES: .c .o .h .h.gch .a .so
123 idl_full: build/pidl/idl.pm
124 CPP=\"\@CPP\@\" PERL=\"\$(PERL)\" script/build_idl.sh FULL
126 idl: build/pidl/idl.pm
127 \@CPP=\"\@CPP\@\" script/build_idl.sh
129 build/pidl/idl.pm: build/pidl/idl.yp
130 -yapp -s build/pidl/idl.yp
132 pch: proto include/includes.h.gch
135 -rm -f include/includes.h.gch
137 basics: idl proto_exists
143 sub _prepare_dummy_MAKEDIR()
150 \@: >> \$\@ || : > \$\@
152 dynconfig.o: dynconfig.c Makefile
153 \@echo Compiling \$*.c
154 \@\$(CC) \$(CC_FLAGS) \@PICFLAG\@ \$(PATH_FLAGS) -c \$< -o \$\@
155 \@BROKEN_CC\@ -mv `echo \$\@ | sed 's%^.*/%%g'` \$\@
161 ###########################################################
162 # This function creates a standard make rule which is using $(CC)
164 # $output = _prepare_std_CC_rule($srcext,$destext,$flags,$message,$comment)
166 # $srcext - sourcefile extension
168 # $destext - destinationfile extension
170 # $flags - additional compiler flags
172 # $message - logmessage which is echoed while running this rule
174 # $comment - just a comment what this rule should do
176 # $output - the resulting output buffer
177 sub _prepare_std_CC_rule($$$$$)
188 ###################################
191 \@echo $message \$*.$src
192 \@\$(CC) \$(CC_FLAGS) $flags -c \$< -o \$\@
193 \@BROKEN_CC\@ -mv `echo \$\@ | sed 's%^.*/%%g'` \$\@
195 ###################################
201 sub array2oneperline($)
207 foreach my $str (@{$array}) {
208 if (!defined($str)) {
212 $output .= " \\\n\t\t";
225 foreach my $str (@{$array}) {
226 if (!defined($str)) {
237 ###########################################################
238 # This function creates a object file list
240 # $output = _prepare_var_obj_list($var, $var_ctx)
242 # $var_ctx - the subsystem context
244 # $var_ctx->{NAME} - the <var> name
245 # $var_ctx->{OBJ_LIST} - the list of objectfiles which sould be linked to this <var>
247 # $output - the resulting output buffer
248 sub _prepare_var_obj_list($$)
255 $tmpobjlist = array2oneperline($ctx->{OBJ_LIST});
258 ###################################
259 # Start $var $ctx->{NAME} OBJ LIST
260 $var\_$ctx->{NAME}_OBJS =$tmpobjlist
261 # End $var $ctx->{NAME} OBJ LIST
262 ###################################
268 ###########################################################
269 # This function creates a object file list for a subsystem
271 # $output = _prepare_subsystem_obj_list($subsystem_ctx)
273 # $subsystem_ctx - the subsystem context
275 # $subsystem_ctx->{NAME} - the subsystem name
276 # $subsystem_ctx->{OBJ_LIST} - the list of objectfiles which sould be linked to this subsystem
278 # $output - the resulting output buffer
279 sub _prepare_subsystem_obj_list($)
283 return _prepare_var_obj_list("SUBSYSTEM",$ctx);
286 ###########################################################
287 # This function creates a object file list for a module
289 # $output = _prepare_module_obj_and_lib_list($module_ctx)
291 # $module_ctx - the module context
293 # $module_ctx->{NAME} - the module binary name
294 # $module_ctx->{OBJ_LIST} - the list of objectfiles which sould be linked to this module
296 # $output - the resulting output buffer
297 sub _prepare_module_obj_list($)
301 return _prepare_var_obj_list("MODULE",$ctx);
305 ###########################################################
306 # This function creates a make rule for linking a shared module
308 # $output = _prepare_shared_module_rule($module_ctx)
310 # $module_ctx - the module context
312 # $module_ctx->{MODULE} - the module binary name
313 # $module_ctx->{DEPEND_LIST} - the list of rules on which this module depends
314 # $module_ctx->{LINK_LIST} - the list of objectfiles and external libraries
315 # which sould be linked to this module
316 # $module_ctx->{LINK_FLAGS} - linker flags used by this module
318 # $output - the resulting output buffer
319 sub _prepare_shared_module_rule($)
327 $tmpdepend = array2oneperline($ctx->{DEPEND_LIST});
328 $tmplink = array2oneperline($ctx->{LINK_LIST});
329 $tmpflag = array2oneperline($ctx->{LINK_FLAGS});
332 ###################################
333 # Start Module $ctx->{MODULE}
334 MODULE_$ctx->{NAME}_DEPEND_LIST =$tmpdepend
335 MODULE_$ctx->{NAME}_LINK_LIST =$tmplink
336 MODULE_$ctx->{NAME}_LINK_FLAGS =$tmpflag
338 bin/$ctx->{MODULE}: \$(MODULE_$ctx->{NAME}_DEPEND_LIST) bin/.dummy
340 \@\$(SHLD) \$(SHLD_FLAGS) -o \$\@ \\
341 \$(MODULE_$ctx->{NAME}_LINK_FLAGS) \\
342 \$(MODULE_$ctx->{NAME}_LINK_LIST)
343 module_$ctx->{MODULE}: basics bin/$ctx->{MODULE}
344 # Module $ctx->{MODULE}
345 ###################################
351 ###########################################################
352 # This function creates a object file list for a library
354 # $output = _prepare_library_obj_and_lib_list($library_ctx)
356 # $library_ctx - the library context
358 # $library_ctx->{NAME} - the library binary name
359 # $library_ctx->{OBJ_LIST} - the list of objectfiles which sould be linked to this library
361 # $output - the resulting output buffer
362 sub _prepare_library_obj_list($)
366 return _prepare_var_obj_list("LIBRARY",$ctx);
370 ###########################################################
371 # This function creates a make rule for linking a library
373 # $output = _prepare_library_rule($library_ctx)
375 # $library_ctx - the library context
377 # $library_ctx->{NAME} - the library name
379 # $library_ctx->{DEPEND_LIST} - the list of rules on which this library depends
381 # $library_ctx->{STATIC_LIBRARY_NAME} - the static library name
382 # $library_ctx->{STATIC_LINK_LIST} - the list of objectfiles which sould be linked
383 # to this static library
384 # $library_ctx->{STATIC_LINK_FLAGS} - linker flags used by this static library
386 # $library_ctx->{SHARED_LIBRARY_NAME} - the shared library name
387 # $library_ctx->{SHARED_LIBRARY_REALNAME} - the shared library real name
388 # $library_ctx->{SHARED_LIBRARY_SONAME} - the shared library soname
389 # $library_ctx->{SHARED_LINK_LIST} - the list of objectfiles and external libraries
390 # which sould be linked to this shared library
391 # $library_ctx->{SHARED_LINK_FLAGS} - linker flags used by this shared library
393 # $output - the resulting output buffer
394 sub _prepare_library_rule($)
405 $tmpdepend = array2oneperline($ctx->{DEPEND_LIST});
407 $tmpstlink = array2oneperline($ctx->{STATIC_LINK_LIST});
408 $tmpstflag = array2oneperline($ctx->{STATIC_LINK_FLAGS});
410 $tmpshlink = array2oneperline($ctx->{SHARED_LINK_LIST});
411 $tmpshflag = array2oneperline($ctx->{SHARED_LINK_FLAGS});
413 $tmprules = "bin/$ctx->{STATIC_LIBRARY_NAME}";
416 ###################################
417 # Start Library $ctx->{NAME}
419 LIBRARY_$ctx->{NAME}_DEPEND_LIST =$tmpdepend
421 LIBRARY_$ctx->{NAME}_STATIC_LINK_LIST =$tmpstlink
422 LIBRARY_$ctx->{NAME}_STATIC_LINK_FLAGS =$tmpstflag
424 LIBRARY_$ctx->{NAME}_SHARED_LINK_LIST =$tmpshlink
425 LIBRARY_$ctx->{NAME}_SHARED_LINK_FLAGS =$tmpshflag
427 # Static $ctx->{STATIC_LIBRARY_NAME}
428 bin/$ctx->{STATIC_LIBRARY_NAME}: \$(LIBRARY_$ctx->{NAME}_DEPEND_LIST) bin/.dummy
430 \@\$(STLD) \$(STLD_FLAGS) \$\@ \\
431 \$(LIBRARY_$ctx->{NAME}_STATIC_LINK_FLAGS) \\
432 \$(LIBRARY_$ctx->{NAME}_STATIC_LINK_LIST)
435 if (defined($ctx->{SHARED_LIBRARY_NAME})) {
437 # Shared $ctx->{SHARED_LIBRARY_REALNAME}
438 bin/$ctx->{SHARED_LIBRARY_REALNAME}: \$(LIBRARY_$ctx->{NAME}_DEPEND_LIST) bin/.dummy
440 \@\$(SHLD) \$(SHLD_FLAGS) -o \$\@ \\
441 \$(LIBRARY_$ctx->{NAME}_SHARED_LINK_FLAGS) \\
442 \$(LIBRARY_$ctx->{NAME}_SHARED_LINK_LIST)
443 # Symlink $ctx->{SHARED_LIBRARY_SONAME}
444 bin/$ctx->{SHARED_LIBRARY_SONAME}: bin/$ctx->{SHARED_LIBRARY_REALNAME} bin/.dummy
446 \@ln -sf $ctx->{SHARED_LIBRARY_REALNAME} \$\@
447 # Symlink $ctx->{SHARED_LIBRARY_NAME}
448 bin/$ctx->{SHARED_LIBRARY_NAME}: bin/$ctx->{SHARED_LIBRARY_SONAME} bin/.dummy
450 \@ln -sf $ctx->{SHARED_LIBRARY_SONAME} \$\@
452 $tmprules .= " bin/$ctx->{SHARED_LIBRARY_NAME}"
456 library_$ctx->{NAME}: basics $tmprules
457 # End Library $ctx->{NAME}
458 ###################################
464 ###########################################################
465 # This function creates a object file list for a binary
467 # $output = _prepare_binary_obj_and_lib_list($binary_ctx)
469 # $binary_ctx - the binary context
471 # $binary_ctx->{NAME} - the binary name
472 # $binary_ctx->{OBJ_LIST} - the list of objectfiles which sould be linked to this binary
474 # $output - the resulting output buffer
475 sub _prepare_binary_obj_list($)
479 return _prepare_var_obj_list("BINARY",$ctx);
483 ###########################################################
484 # This function creates a make rule for linking a binary
486 # $output = _prepare_binary_rule($binary_ctx)
488 # $binary_ctx - the binary context
490 # $binary_ctx->{NAME} - the binary name
491 # $binary_ctx->{BINARY} - the binary binary name
493 # $binary_ctx->{DEPEND_LIST} - the list of rules on which this binary depends
494 # $binary_ctx->{LINK_LIST} - the list of objectfiles and external libraries
495 # which sould be linked to this binary
496 # $binary_ctx->{LINK_FLAGS} - linker flags used by this binary
498 # $output - the resulting output buffer
499 sub _prepare_binary_rule($)
507 $tmpdepend = array2oneperline($ctx->{DEPEND_LIST});
508 $tmplink = array2oneperline($ctx->{LINK_LIST});
509 $tmpflag = array2oneperline($ctx->{LINK_FLAGS});
512 ###################################
513 # Start Binary $ctx->{BINARY}
515 BINARY_$ctx->{NAME}_DEPEND_LIST =$tmpdepend
516 BINARY_$ctx->{NAME}_LINK_LIST =$tmplink
517 BINARY_$ctx->{NAME}_LINK_FLAGS =$tmpflag
519 bin/$ctx->{BINARY}: bin/.dummy \$(BINARY_$ctx->{NAME}_DEPEND_LIST)
521 \@\$(LD) \$(LD_FLAGS) -o \$\@ \\
522 \$(BINARY_$ctx->{NAME}_LINK_FLAGS) \\
523 \$(BINARY_$ctx->{NAME}_LINK_LIST)
524 binary_$ctx->{BINARY}: basics bin/$ctx->{BINARY}
525 # End Binary $ctx->{BINARY}
526 ###################################
532 ###########################################################
533 # This function creates a object file list for make proto
535 # $output = _prepare_proto_obj_list($proto_ctx)
537 # $proto_ctx - the proto context
539 # $proto_ctx->{OBJ_LIST} - the list of objectfiles which sould be scanned by make proto
541 # $output - the resulting output buffer
542 sub _prepare_proto_obj_list($)
548 $tmplist = array2oneperline($ctx->{OBJ_LIST});
551 ###################################
552 # Start PROTO OBJ LIST
555 ###################################
561 sub _prepare_proto_rules()
566 # Making this target will just make sure that the prototype files
567 # exist, not necessarily that they are up to date. Since they're
568 # removed by 'make clean' this will always be run when you do anything
570 proto_exists: include/proto.h include/build_env.h
572 delheaders: pch_clean
573 -rm -f \$(builddir)/include/proto.h \$(builddir)/include/build_env.h:
576 \@cd \$(srcdir) && \$(SHELL) script/mkproto.sh \"\$(PERL)\" \\
577 -h _PROTO_H_ \$(builddir)/include/proto.h \\
581 \@echo Building include/build_env.h
582 \@cd \$(srcdir) && \$(SHELL) script/build_env.sh \$(srcdir) \$(builddir) \$(CC) > \$(builddir)/include/build_env.h
584 # 'make headers' or 'make proto' calls a subshell because we need to
585 # make sure these commands are executed in sequence even for a
587 headers: delheaders proto_exists
592 \@[ -f \$(builddir)/include/proto.h ] || \$(MAKE) proto
595 -rm -f *.o */*.o */*/*.o */*/*/*.o bin/*
600 -rm -f include/config.h
603 -rm -f config.smb_build.*
604 -rm -f config.log config.cache
607 -rm -f *.bak *~ */*.bak */*~ */*/*.bak */*/*~ */*/*/*.bak */*/*/*~
609 realdistclean: distclean removebackup
610 -rm -f include/config.h.in
618 sub _prepare_make_target($)
624 $tmpdepend = array2oneperline($ctx->{DEPEND_LIST});
627 ###################################
628 # Start Target $ctx->{TARGET}
629 $ctx->{TARGET}: basics $tmpdepend
630 # End Target $ctx->{TARGET}
631 ###################################
637 sub _prepare_obj_lists($)
642 foreach my $key (sort keys %{$CTX->{OUTPUT}{SUBSYSTEMS}}) {
643 $output .= _prepare_subsystem_obj_list(\%{$CTX->{OUTPUT}{SUBSYSTEMS}{$key}});
646 foreach my $key (sort keys %{$CTX->{OUTPUT}{SHARED_MODULES}}) {
647 $output .= _prepare_module_obj_list(\%{$CTX->{OUTPUT}{SHARED_MODULES}{$key}});
650 foreach my $key (sort keys %{$CTX->{OUTPUT}{LIBRARIES}}) {
651 $output .= _prepare_library_obj_list(\%{$CTX->{OUTPUT}{LIBRARIES}{$key}});
654 foreach my $key (sort keys %{$CTX->{OUTPUT}{BINARIES}}) {
655 $output .= _prepare_binary_obj_list(\%{$CTX->{OUTPUT}{BINARIES}{$key}});
658 $output .= _prepare_proto_obj_list(\%{$CTX->{OUTPUT}{PROTO}});
663 sub _prepare_install_rules($)
671 \@echo \"Samba will be installed into:\"
672 \@echo \" basedir: \$(BASEDIR)\"
673 \@echo \" bindir: \$(BINDIR)\"
674 \@echo \" sbindir: \$(SBINDIR)\"
675 \@echo \" libdir: \$(LIBDIR)\"
676 \@echo \" vardir: \$(VARDIR)\"
677 \@echo \" privatedir: \$(PRIVATEDIR)\"
678 \@echo \" piddir: \$(PIDDIR)\"
679 \@echo \" lockdir: \$(LOCKDIR)\"
681 SBIN_PROGS = bin/smbd
683 BIN_PROGS = bin/smbclient
685 TORTURE_PROGS = bin/smbtorture \\
691 LDB_PROGS = bin/ldbadd \\
697 REG_PROGS = bin/regpatch \\
703 install: showlayout installbin installtorture installldb installreg installdat
705 # DESTDIR is used here to prevent packagers wasting their time
706 # duplicating the Makefile. Remove it and you will have the privelege
707 # of package each samba release for muliple versions of multiple
708 # distributions and operating systems, or at least supplying patches
709 # to all the packaging files required for this, prior to committing
710 # the removal of DESTDIR. Do not remove it even though you think it
714 \@\$(SHELL) \$(srcdir)/script/installdirs.sh \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(SBINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(DESTDIR)\$(PRIVATEDIR) \$(DESTDIR)\$(PIDDIR) \$(DESTDIR)\$(LOCKDIR)
716 installbin: all installdirs
717 \@\$(SHELL) \$(srcdir)/script/installbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(SBINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(SBIN_PROGS)
718 \@\$(SHELL) \$(srcdir)/script/installbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(BIN_PROGS)
720 installtorture: all installdirs
721 \@\$(SHELL) \$(srcdir)/script/installbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(TORTURE_PROGS)
723 installldb: all installdirs
724 \@\$(SHELL) \$(srcdir)/script/installbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(LDB_PROGS)
726 installreg: all installdirs
727 \@\$(SHELL) \$(srcdir)/script/installbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(REG_PROGS)
729 installdat: installdirs
730 \@\$(SHELL) \$(srcdir)/script/installdat.sh \$(DESTDIR)\$(LIBDIR) \$(srcdir)
732 uninstall: uninstallbin uninstalltorture uninstallldb uninstallreg
735 \@\$(SHELL) \$(srcdir)/script/uninstallbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(SBINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(DESTDIR)\$(SBIN_PROGS)
738 \@\$(SHELL) \$(srcdir)/script/uninstallbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(DESTDIR)\$(TORTURE_PROGS)
741 \@\$(SHELL) \$(srcdir)/script/uninstallbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(DESTDIR)\$(LDB_PROGS)
744 \@\$(SHELL) \$(srcdir)/script/uninstallbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(DESTDIR)\$(REG_PROGS)
748 swig: scripting/swig/_tdb.so scripting/swig/_dcerpc.so
750 PYTHON_TDB_OBJ = lib/tdb/common/tdb.o lib/tdb/common/spinlock.o
752 scripting/swig/tdb.py: scripting/swig/tdb.i
753 swig -python scripting/swig/tdb.i
755 scripting/swig/_tdb.so: scripting/swig/tdb.py scripting/swig/tdb_wrap.o \$(PYTHON_TDB_OBJ)
756 \$(SHLD) \$(SHLD_FLAGS) -o scripting/swig/_tdb.so scripting/swig/tdb_wrap.o \\
759 PYTHON_DCERPC_OBJ = \$(SUBSYSTEM_LIBRPC_RAW_OBJS) \\
760 \$(SUBSYSTEM_LIBNDR_RAW_OBJS) \\
761 \$(SUBSYSTEM_LIBBASIC_OBJS) \\
762 \$(SUBSYSTEM_CONFIG_OBJS) \\
763 \$(SUBSYSTEM_LIBTDB_OBJS) \\
764 \$(SUBSYSTEM_SCHANNELDB_OBJS) \\
765 \$(SUBSYSTEM_GENSEC_OBJS) \\
766 \$(SUBSYSTEM_LIBCLI_UTILS_OBJS) \\
767 \$(SUBSYSTEM_LIBCLI_RAW_OBJS) \\
768 \$(SUBSYSTEM_LIBCLI_AUTH_OBJS) \\
769 \$(SUBSYSTEM_LIBCLI_NMB_OBJS) \\
770 \$(SUBSYSTEM_AUTH_OBJS) \\
771 \$(SUBSYSTEM_SAMDB_OBJS) \\
772 \$(SUBSYSTEM_LIBLDB_OBJS) \\
773 \$(SUBSYSTEM_CHARSET_OBJS) \\
774 \$(SUBSYSTEM_LIBSMB_OBJS) \\
775 \$(SUBSYSTEM_DCERPC_COMMON_OBJS)
777 PYTHON_DCERPC_LIBS = -lldap
779 SWIG_INCLUDES = librpc/gen_ndr/samr.i librpc/gen_ndr/lsa.i librpc/gen_ndr/winreg.i librpc/gen_ndr/spoolss.i
781 scripting/swig/dcerpc.py: scripting/swig/dcerpc.i scripting/swig/samba.i \$(SWIG_INCLUDES)
782 swig -python scripting/swig/dcerpc.i
784 scripting/swig/_dcerpc.so: scripting/swig/dcerpc.py scripting/swig/dcerpc_wrap.o \$(PYTHON_DCERPC_OBJ)
785 \$(SHLD) \$(SHLD_FLAGS) -o scripting/swig/_dcerpc.so scripting/swig/dcerpc_wrap.o \$(PYTHON_DCERPC_OBJ) \$(PYTHON_DCERPC_LIBS)
788 -rm -f scripting/swig/_tdb.so scripting/swig/tdb.pyc \\
789 scripting/swig/tdb.py scripting/swig/tdb_wrap.c \\
790 scripting/swig/tdb_wrap.o
795 etags `find \$(srcdir) -name \"*.[ch]\"`
798 ctags `find \$(srcdir) -name \"*.[ch]\"`
805 sub _prepare_rule_lists($)
810 foreach my $key (sort keys %{$CTX->{OUTPUT}{SHARED_MODULES}}) {
811 $output .= _prepare_shared_module_rule(\%{$CTX->{OUTPUT}{SHARED_MODULES}{$key}});
814 foreach my $key (sort keys %{$CTX->{OUTPUT}{LIBRARIES}}) {
815 $output .= _prepare_library_rule(\%{$CTX->{OUTPUT}{LIBRARIES}{$key}});
818 foreach my $key (sort keys %{$CTX->{OUTPUT}{BINARIES}}) {
819 $output .= _prepare_binary_rule(\%{$CTX->{OUTPUT}{BINARIES}{$key}});
823 $output .= _prepare_IDL($idl_ctx);
825 $output .= _prepare_proto_rules();
827 $output .= _prepare_install_rules($CTX);
832 ###########################################################
833 # This function prepares the output for Makefile
835 # $output = _prepare_makefile_in($SMB_BUILD_CTX)
837 # $SMB_BUILD_CTX - the global SMB_BUILD context
839 # $output - the resulting output buffer
840 sub _prepare_makefile_in($)
845 $output = "########################################\n";
846 $output .= "# Autogenerated by config.smb_build.pl #\n";
847 $output .= "########################################\n";
850 $output .= _prepare_command_interpreters($cmd_ctx);
853 $output .= _prepare_path_vars($path_ctx);
856 $output .= _prepare_compiler_linker($compiler_ctx);
859 $output .= _prepare_default_rule($rules_ctx);
862 $output .= _prepare_SUFFIXES($suffix_ctx);
864 $output .= _prepare_dummy_MAKEDIR();
866 $output .= _prepare_std_CC_rule("c","o","\@PICFLAG\@","Compiling","Rule for std objectfiles");
867 $output .= _prepare_std_CC_rule("h","h.gch","\@PICFLAG\@","Precompiling","Rule for precompiled headerfiles");
869 $output .= _prepare_obj_lists($CTX);
871 $output .= _prepare_rule_lists($CTX);
873 $output .= _prepare_make_target(\%{$CTX->{OUTPUT}{TARGETS}{ALL}});
878 ###########################################################
879 # This function creates Makefile.in from the SMB_BUILD
882 # create_makefile_in($SMB_BUILD_CTX)
884 # $SMB_BUILD_CTX - the global SMB_BUILD context
886 # $output - the resulting output buffer
887 sub create_makefile_in($)
892 $output = _prepare_makefile_in($CTX);
894 open(MAKEFILE_IN,"> Makefile.in") || die ("Can't open Makefile.in\n");
896 print MAKEFILE_IN $output;
900 print "config.smb_build.pl: creating Makefile.in\n";