1 ###########################################################
2 ### SMB Build System ###
3 ### - create output for Makefile ###
5 ### Copyright (C) Stefan (metze) Metzmacher 2004 ###
6 ### Released under the GNU GPL ###
7 ###########################################################
12 sub _prepare_command_interpreters($)
24 sub _prepare_path_vars($)
31 exec_prefix=\@exec_prefix\@
35 eparserdir=\@eparserdir\@
41 CONFIGDIR = \@configdir\@
42 VARDIR = \@localstatedir\@
45 # The permissions to give the executables
48 # set these to where to find various files
49 # These can be overridden by command line switches (see smbd(8))
50 # or in smb.conf (see smb.conf(5))
51 LOGFILEBASE = \@logfilebase\@
52 CONFIGFILE = \$(CONFIGDIR)/smb.conf
53 LMHOSTSFILE = \$(CONFIGDIR)/lmhosts
54 NCALRPCDIR = \@localstatedir\@/ncalrpc
56 # This is where smbpasswd et al go
57 PRIVATEDIR = \@privatedir\@
58 SMB_PASSWD_FILE = \$(PRIVATEDIR)/smbpasswd
60 # the directory where lock files go
63 # the directory where pid files go
66 PASSWD_FLAGS = -DSMB_PASSWD_FILE=\\\"\$(SMB_PASSWD_FILE)\\\" -DPRIVATE_DIR=\\\"\$(PRIVATEDIR)\\\"
67 PATH_FLAGS1 = -DCONFIGFILE=\\\"\$(CONFIGFILE)\\\" -DSBINDIR=\\\"\$(SBINDIR)\\\"
68 PATH_FLAGS2 = \$(PATH_FLAGS1) -DBINDIR=\\\"\$(BINDIR)\\\"
69 PATH_FLAGS3 = \$(PATH_FLAGS2) -DLMHOSTSFILE=\\\"\$(LMHOSTSFILE)\\\"
70 PATH_FLAGS4 = \$(PATH_FLAGS3) -DLOCKDIR=\\\"\$(LOCKDIR)\\\" -DPIDDIR=\\\"\$(PIDDIR)\\\"
71 PATH_FLAGS5 = \$(PATH_FLAGS4) -DLIBDIR=\\\"\$(LIBDIR)\\\" \\
72 -DLOGFILEBASE=\\\"\$(LOGFILEBASE)\\\" -DSHLIBEXT=\\\"\@SHLIBEXT\@\\\"
73 PATH_FLAGS6 = \$(PATH_FLAGS5) -DCONFIGDIR=\\\"\$(CONFIGDIR)\\\" -DNCALRPCDIR=\\\"\$(NCALRPCDIR)\\\"
74 PATH_FLAGS = \$(PATH_FLAGS6) \$(PASSWD_FLAGS)
79 sub _prepare_compiler_linker($)
86 CC_FLAGS=-Iinclude -I. -I\$(srcdir)/include -I\$(srcdir) -D_SAMBA_BUILD_ -Ilib \@CFLAGS\@ \@CPPFLAGS\@
89 LD_FLAGS=\@LDFLAGS\@ \@CFLAGS\@
95 SHLD_FLAGS=\@LDSHFLAGS\@ \@LDFLAGS\@
100 sub _prepare_default_rule($)
111 sub _prepare_SUFFIXES($)
118 .SUFFIXES: .c .o .h .h.gch .a .so
129 idl_full: build/pidl/idl.pm
130 CPP=\"\@CPP\@\" PERL=\"\$(PERL)\" script/build_idl.sh FULL
132 idl: build/pidl/idl.pm
133 \@CPP=\"\@CPP\@\" PERL=\"\$(PERL)\" script/build_idl.sh PARTIAL
135 eparser_idl: build/pidl/idl.pm
136 CPP=\"\@CPP\@\" PERL=\"\$(PERL)\" EPARSERPREFIX=\"\$(eparserdir)\" script/build_idl.sh EPARSER
138 build/pidl/idl.pm: build/pidl/idl.yp
139 -yapp -s build/pidl/idl.yp
141 pch: proto include/includes.h.gch
144 -rm -f include/includes.h.gch
146 basics: idl proto_exists
152 sub _prepare_dummy_MAKEDIR()
159 \@: >> \$\@ || : > \$\@
161 dynconfig.o: dynconfig.c Makefile
162 \@echo Compiling \$*.c
163 \@\$(CC) \$(CC_FLAGS) \@PICFLAG\@ \$(PATH_FLAGS) -c \$< -o \$\@
164 \@BROKEN_CC\@ -mv `echo \$\@ | sed 's%^.*/%%g'` \$\@
170 ###########################################################
171 # This function creates a standard make rule which is using $(CC)
173 # $output = _prepare_std_CC_rule($srcext,$destext,$flags,$message,$comment)
175 # $srcext - sourcefile extension
177 # $destext - destinationfile extension
179 # $flags - additional compiler flags
181 # $message - logmessage which is echoed while running this rule
183 # $comment - just a comment what this rule should do
185 # $output - the resulting output buffer
186 sub _prepare_std_CC_rule($$$$$)
197 ###################################
200 \@echo $message \$*.$src
201 \@\$(CC) \$(CC_FLAGS) $flags -c \$< -o \$\@
202 \@BROKEN_CC\@ -mv `echo \$\@ | sed 's%^.*/%%g'` \$\@
204 ###################################
210 sub array2oneperline($)
216 foreach my $str (@{$array}) {
217 if (!defined($str)) {
221 $output .= " \\\n\t\t";
234 foreach my $str (@{$array}) {
235 if (!defined($str)) {
246 ###########################################################
247 # This function creates a object file list
249 # $output = _prepare_var_obj_list($var, $var_ctx)
251 # $var_ctx - the subsystem context
253 # $var_ctx->{NAME} - the <var> name
254 # $var_ctx->{OBJ_LIST} - the list of objectfiles which sould be linked to this <var>
256 # $output - the resulting output buffer
257 sub _prepare_obj_list($$)
264 $tmpobjlist = array2oneperline($ctx->{OBJ_LIST});
267 ###################################
268 # Start $var $ctx->{NAME} OBJ LIST
269 $var\_$ctx->{NAME}_OBJS =$tmpobjlist
270 # End $var $ctx->{NAME} OBJ LIST
271 ###################################
277 ###########################################################
278 # This function creates a object file list for a subsystem
280 # $output = _prepare_subsystem_obj_list($subsystem_ctx)
282 # $subsystem_ctx - the subsystem context
284 # $subsystem_ctx->{NAME} - the subsystem name
285 # $subsystem_ctx->{OBJ_LIST} - the list of objectfiles which sould be linked to this subsystem
287 # $output - the resulting output buffer
288 sub _prepare_subsystem_obj_list($)
292 return _prepare_var_obj_list("SUBSYSTEM",$ctx);
295 ###########################################################
296 # This function creates a object file list for a module
298 # $output = _prepare_module_obj_and_lib_list($module_ctx)
300 # $module_ctx - the module context
302 # $module_ctx->{NAME} - the module binary name
303 # $module_ctx->{OBJ_LIST} - the list of objectfiles which sould be linked to this module
305 # $output - the resulting output buffer
306 sub _prepare_module_obj_list($)
310 return _prepare_var_obj_list("MODULE",$ctx);
314 ###########################################################
315 # This function creates a make rule for linking a library
317 # $output = _prepare_shared_library_rule($library_ctx)
319 # $library_ctx - the library context
321 # $library_ctx->{NAME} - the library name
323 # $library_ctx->{DEPEND_LIST} - the list of rules on which this library depends
325 # $library_ctx->{LIBRARY_NAME} - the shared library name
326 # $library_ctx->{LIBRARY_REALNAME} - the shared library real name
327 # $library_ctx->{LIBRARY_SONAME} - the shared library soname
328 # $library_ctx->{LINK_LIST} - the list of objectfiles and external libraries
329 # which sould be linked to this shared library
330 # $library_ctx->{LINK_FLAGS} - linker flags used by this shared library
332 # $output - the resulting output buffer
333 sub _prepare_shared_library_rule($)
343 my $outname = $ctx->{OUTPUT};
345 $tmpdepend = array2oneperline($ctx->{DEPEND_LIST});
347 $tmpshlink = array2oneperline($ctx->{LINK_LIST});
348 $tmpshflag = array2oneperline($ctx->{LINK_FLAGS});
351 ###################################
352 # Start Library $ctx->{NAME}
354 LIBRARY_$ctx->{NAME}_DEPEND_LIST =$tmpdepend
356 LIBRARY_$ctx->{NAME}_SHARED_LINK_LIST =$tmpshlink
357 LIBRARY_$ctx->{NAME}_SHARED_LINK_FLAGS =$tmpshflag
360 # Shared $ctx->{LIBRARY_NAME}
361 $ctx->{OUTPUT}: \$(LIBRARY_$ctx->{NAME}_DEPEND_LIST) bin/.dummy
363 \@\$(SHLD) \$(SHLD_FLAGS) -o \$\@ \\
364 \$(LIBRARY_$ctx->{NAME}_SHARED_LINK_FLAGS) \\
365 \$(LIBRARY_$ctx->{NAME}_SHARED_LINK_LIST)
368 if (defined($ctx->{LIBRARY_SONAME})) {
370 # Symlink $ctx->{LIBRARY_SONAME}
371 bin/$ctx->{LIBRARY_SONAME}: bin/$ctx->{LIBRARY_REALNAME} bin/.dummy
373 \@ln -sf $ctx->{LIBRARY_REALNAME} \$\@
374 # Symlink $ctx->{LIBRARY_NAME}
375 bin/$ctx->{LIBRARY_NAME}: bin/$ctx->{LIBRARY_SONAME} bin/.dummy
377 \@ln -sf $ctx->{LIBRARY_SONAME} \$\@
379 $outname = $ctx->{LIBRARY_NAME};
383 library_$ctx->{NAME}: basics bin/$outname
384 # End Library $ctx->{NAME}
385 ###################################
391 ###########################################################
392 # This function creates a make rule for linking a library
394 # $output = _prepare_static_library_rule($library_ctx)
396 # $library_ctx - the library context
398 # $library_ctx->{NAME} - the library name
400 # $library_ctx->{DEPEND_LIST} - the list of rules on which this library depends
402 # $library_ctx->{LIBRARY_NAME} - the static library name
403 # $library_ctx->{LINK_LIST} - the list of objectfiles which sould be linked
404 # to this static library
405 # $library_ctx->{LINK_FLAGS} - linker flags used by this static library
407 # $output - the resulting output buffer
408 sub _prepare_static_library_rule($)
419 $tmpdepend = array2oneperline($ctx->{DEPEND_LIST});
421 $tmpstlink = array2oneperline($ctx->{LINK_LIST});
422 $tmpstflag = array2oneperline($ctx->{LINK_FLAGS});
424 $tmprules = "bin/$ctx->{LIBRARY_NAME}";
427 ###################################
428 # Start Library $ctx->{NAME}
430 LIBRARY_$ctx->{NAME}_DEPEND_LIST =$tmpdepend
432 LIBRARY_$ctx->{NAME}_STATIC_LINK_LIST =$tmpstlink
434 # Static $ctx->{LIBRARY_NAME}
435 $ctx->{OUTPUT}: \$(LIBRARY_$ctx->{NAME}_DEPEND_LIST) bin/.dummy
437 \@\$(STLD) \$(STLD_FLAGS) \$\@ \\
438 \$(LIBRARY_$ctx->{NAME}_STATIC_LINK_LIST)
440 library_$ctx->{NAME}: basics $tmprules
441 # End Library $ctx->{NAME}
442 ###################################
450 ###########################################################
451 # This function creates a make rule for linking a binary
453 # $output = _prepare_binary_rule($binary_ctx)
455 # $binary_ctx - the binary context
457 # $binary_ctx->{NAME} - the binary name
458 # $binary_ctx->{BINARY} - the binary binary name
460 # $binary_ctx->{DEPEND_LIST} - the list of rules on which this binary depends
461 # $binary_ctx->{LINK_LIST} - the list of objectfiles and external libraries
462 # which sould be linked to this binary
463 # $binary_ctx->{LINK_FLAGS} - linker flags used by this binary
465 # $output - the resulting output buffer
466 sub _prepare_binary_rule($)
474 $tmpdepend = array2oneperline($ctx->{DEPEND_LIST});
475 $tmplink = array2oneperline($ctx->{LINK_LIST});
476 $tmpflag = array2oneperline($ctx->{LINK_FLAGS});
479 ###################################
480 # Start Binary $ctx->{BINARY}
482 BINARY_$ctx->{NAME}_DEPEND_LIST =$tmpdepend
483 BINARY_$ctx->{NAME}_LINK_LIST =$tmplink
484 BINARY_$ctx->{NAME}_LINK_FLAGS =$tmpflag
486 bin/$ctx->{BINARY}: bin/.dummy \$(BINARY_$ctx->{NAME}_DEPEND_LIST)
488 \@\$(LD) \$(LD_FLAGS) -o \$\@ \\
489 \$(BINARY_$ctx->{NAME}_LINK_FLAGS) \\
490 \$(BINARY_$ctx->{NAME}_LINK_LIST) \\
491 \$(BINARY_$ctx->{NAME}_LINK_FLAGS)
492 binary_$ctx->{BINARY}: basics bin/$ctx->{BINARY}
493 # End Binary $ctx->{BINARY}
494 ###################################
500 sub _prepare_proto_rules()
505 # Making this target will just make sure that the prototype files
506 # exist, not necessarily that they are up to date. Since they're
507 # removed by 'make clean' this will always be run when you do anything
509 proto_exists: include/proto.h include/build_env.h
511 delheaders: pch_clean
512 -rm -f \$(builddir)/include/proto.h \$(builddir)/include/build_env.h:
515 \@cd \$(srcdir) && \$(SHELL) script/mkproto.sh \"\$(PERL)\" \\
516 -h _PROTO_H_ \$(builddir)/include/proto.h \\
520 \@echo Building include/build_env.h
521 \@cd \$(srcdir) && \$(SHELL) script/build_env.sh \$(srcdir) \$(builddir) \$(CC) > \$(builddir)/include/build_env.h
523 # 'make headers' or 'make proto' calls a subshell because we need to
524 # make sure these commands are executed in sequence even for a
526 headers: delheaders proto_exists
531 \@[ -f \$(builddir)/include/proto.h ] || \$(MAKE) proto
534 -rm -f *.o */*.o */*/*.o */*/*/*.o bin/*
539 -rm -f include/config.h
542 -rm -f config.smb_build.*
543 -rm -f config.log config.cache
546 -rm -f *.bak *~ */*.bak */*~ */*/*.bak */*/*~ */*/*/*.bak */*/*/*~
548 realdistclean: distclean removebackup
549 -rm -f include/config.h.in
557 sub _prepare_make_target($)
563 $tmpdepend = array2oneperline($ctx->{DEPEND_LIST});
566 ###################################
567 # Start Target $ctx->{TARGET}
568 $ctx->{TARGET}: basics $tmpdepend
569 # End Target $ctx->{TARGET}
570 ###################################
576 sub _prepare_obj_lists($)
581 foreach my $key (values %{$CTX}) {
582 next if not defined($key->{OBJ_LIST});
583 $output .= _prepare_obj_list($key->{TYPE}, $key);
589 sub _prepare_install_rules($)
597 \@echo \"Samba will be installed into:\"
598 \@echo \" basedir: \$(BASEDIR)\"
599 \@echo \" bindir: \$(BINDIR)\"
600 \@echo \" sbindir: \$(SBINDIR)\"
601 \@echo \" libdir: \$(LIBDIR)\"
602 \@echo \" vardir: \$(VARDIR)\"
603 \@echo \" privatedir: \$(PRIVATEDIR)\"
604 \@echo \" piddir: \$(PIDDIR)\"
605 \@echo \" lockdir: \$(LOCKDIR)\"
607 SBIN_PROGS = bin/smbd
609 BIN_PROGS = bin/smbclient
611 TORTURE_PROGS = bin/smbtorture \\
617 LDB_PROGS = bin/ldbadd \\
623 REG_PROGS = bin/regpatch \\
629 install: showlayout installbin installtorture installldb installreg installdat
631 # DESTDIR is used here to prevent packagers wasting their time
632 # duplicating the Makefile. Remove it and you will have the privelege
633 # of package each samba release for muliple versions of multiple
634 # distributions and operating systems, or at least supplying patches
635 # to all the packaging files required for this, prior to committing
636 # the removal of DESTDIR. Do not remove it even though you think it
640 \@\$(SHELL) \$(srcdir)/script/installdirs.sh \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(SBINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(DESTDIR)\$(PRIVATEDIR) \$(DESTDIR)\$(PIDDIR) \$(DESTDIR)\$(LOCKDIR)
642 installbin: all installdirs
643 \@\$(SHELL) \$(srcdir)/script/installbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(SBINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(SBIN_PROGS)
644 \@\$(SHELL) \$(srcdir)/script/installbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(BIN_PROGS)
646 installtorture: all installdirs
647 \@\$(SHELL) \$(srcdir)/script/installbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(TORTURE_PROGS)
649 installldb: all installdirs
650 \@\$(SHELL) \$(srcdir)/script/installbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(LDB_PROGS)
652 installreg: all installdirs
653 \@\$(SHELL) \$(srcdir)/script/installbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(REG_PROGS)
655 installdat: installdirs
656 \@\$(SHELL) \$(srcdir)/script/installdat.sh \$(DESTDIR)\$(LIBDIR) \$(srcdir)
658 uninstall: uninstallbin uninstalltorture uninstallldb uninstallreg
661 \@\$(SHELL) \$(srcdir)/script/uninstallbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(SBINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(DESTDIR)\$(SBIN_PROGS)
664 \@\$(SHELL) \$(srcdir)/script/uninstallbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(DESTDIR)\$(TORTURE_PROGS)
667 \@\$(SHELL) \$(srcdir)/script/uninstallbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(DESTDIR)\$(LDB_PROGS)
670 \@\$(SHELL) \$(srcdir)/script/uninstallbin.sh \$(INSTALLPERMS) \$(DESTDIR)\$(BASEDIR) \$(DESTDIR)\$(BINDIR) \$(DESTDIR)\$(LIBDIR) \$(DESTDIR)\$(VARDIR) \$(DESTDIR)\$(REG_PROGS)
674 swig: scripting/swig/_tdb.so scripting/swig/_dcerpc.so
676 PYTHON_TDB_OBJ = lib/tdb/common/tdb.o lib/tdb/common/spinlock.o
678 scripting/swig/tdb.py: scripting/swig/tdb.i
679 swig -python scripting/swig/tdb.i
681 scripting/swig/_tdb.so: scripting/swig/tdb.py scripting/swig/tdb_wrap.o \$(PYTHON_TDB_OBJ)
682 \$(SHLD) \$(SHLD_FLAGS) -o scripting/swig/_tdb.so scripting/swig/tdb_wrap.o \\
685 PYTHON_DCERPC_OBJ = \$(SUBSYSTEM_LIBRPC_RAW_OBJS) \\
686 \$(SUBSYSTEM_LIBDCOM_OBJS) \\
687 \$(SUBSYSTEM_LIBNDR_RAW_OBJS) \\
688 \$(SUBSYSTEM_LIBNDR_GEN_OBJS) \\
689 \$(SUBSYSTEM_LIBBASIC_OBJS) \\
690 \$(SUBSYSTEM_CONFIG_OBJS) \\
691 \$(SUBSYSTEM_LIBTDB_OBJS) \\
692 \$(SUBSYSTEM_SCHANNELDB_OBJS) \\
693 \$(SUBSYSTEM_GENSEC_OBJS) \\
694 \$(SUBSYSTEM_LIBCLI_UTILS_OBJS) \\
695 \$(SUBSYSTEM_LIBCLI_RAW_OBJS) \\
696 \$(SUBSYSTEM_LIBCLI_AUTH_OBJS) \\
697 \$(SUBSYSTEM_LIBCLI_NMB_OBJS) \\
698 \$(SUBSYSTEM_AUTH_OBJS) \\
699 \$(SUBSYSTEM_SAMDB_OBJS) \\
700 \$(SUBSYSTEM_LIBLDB_OBJS) \\
701 \$(SUBSYSTEM_CHARSET_OBJS) \\
702 \$(SUBSYSTEM_LIBSMB_OBJS) \\
703 \$(SUBSYSTEM_DCERPC_COMMON_OBJS) \\
704 \$(SUBSYSTEM_LIB_WINBIND_CLIENT_OBJS) \\
705 \$(SUBSYSTEM_SOCKET_OBJS) \\
706 \$(SUBSYSTEM_LIBREPLACE_OBJS) \\
707 \$(SUBSYSTEM_LIBNETIF_OBJS) \\
708 \$(SUBSYSTEM_LIBCRYPTO_OBJS)
710 PYTHON_DCERPC_LIBS = -lldap
712 SWIG_INCLUDES = librpc/gen_ndr/samr.i librpc/gen_ndr/lsa.i librpc/gen_ndr/winreg.i librpc/gen_ndr/spoolss.i
714 scripting/swig/dcerpc.py: scripting/swig/dcerpc.i scripting/swig/samba.i scripting/swig/status_codes.i \$(SWIG_INCLUDES)
715 swig -python scripting/swig/dcerpc.i
717 scripting/swig/_dcerpc.so: scripting/swig/dcerpc.py scripting/swig/dcerpc_wrap.o \$(PYTHON_DCERPC_OBJ)
718 \$(SHLD) \$(SHLD_FLAGS) -o scripting/swig/_dcerpc.so scripting/swig/dcerpc_wrap.o \$(PYTHON_DCERPC_OBJ) \$(PYTHON_DCERPC_LIBS)
721 -rm -f scripting/swig/_tdb.so scripting/swig/tdb.pyc \\
722 scripting/swig/tdb.py scripting/swig/tdb_wrap.c \\
723 scripting/swig/tdb_wrap.o
728 etags `find \$(srcdir) -name \"*.[ch]\"`
731 ctags `find \$(srcdir) -name \"*.[ch]\"`
738 sub _prepare_rule_lists($)
743 foreach my $key (values %{$depend}) {
744 next if not defined $key->{OUTPUT_TYPE};
745 ($output .= _prepare_static_library_rule($key)) if $key->{OUTPUT_TYPE} eq "STATIC_LIBRARY";
746 ($output .= _prepare_shared_library_rule($key)) if $key->{OUTPUT_TYPE} eq "SHARED_LIBRARY";
747 ($output .= _prepare_binary_rule($key)) if $key->{OUTPUT_TYPE} eq "BINARY";
751 $output .= _prepare_IDL($idl_ctx);
753 $output .= _prepare_proto_rules();
755 $output .= _prepare_install_rules($depend);
760 ###########################################################
761 # This function prepares the output for Makefile
763 # $output = _prepare_makefile_in($SMB_BUILD_CTX)
765 # $SMB_BUILD_CTX - the global SMB_BUILD context
767 # $output - the resulting output buffer
768 sub _prepare_makefile_in($)
773 $output = "########################################\n";
774 $output .= "# Autogenerated by config.smb_build.pl #\n";
775 $output .= "########################################\n";
778 $output .= _prepare_command_interpreters($cmd_ctx);
781 $output .= _prepare_path_vars($path_ctx);
784 $output .= _prepare_compiler_linker($compiler_ctx);
787 $output .= _prepare_default_rule($rules_ctx);
790 $output .= _prepare_SUFFIXES($suffix_ctx);
792 $output .= _prepare_dummy_MAKEDIR();
794 $output .= _prepare_std_CC_rule("c","o","\@PICFLAG\@","Compiling","Rule for std objectfiles");
795 $output .= _prepare_std_CC_rule("h","h.gch","\@PICFLAG\@","Precompiling","Rule for precompiled headerfiles");
797 $output .= _prepare_obj_lists($CTX);
799 $output .= _prepare_rule_lists($CTX);
803 foreach my $part (values %{$CTX}) {
804 push (@all, $part->{OUTPUT}) if defined ($part->{OUTPUT_TYPE}) and $part->{OUTPUT_TYPE} eq "BINARY";
807 $output .= _prepare_make_target({ TARGET => "all", DEPEND_LIST => \@all });
812 ###########################################################
813 # This function creates Makefile.in from the SMB_BUILD
816 # create_makefile_in($SMB_BUILD_CTX)
818 # $SMB_BUILD_CTX - the global SMB_BUILD context
820 # $output - the resulting output buffer
821 sub create_makefile_in($)
825 open(MAKEFILE_IN,"> Makefile.in") || die ("Can't open Makefile.in\n");
826 print MAKEFILE_IN _prepare_makefile_in($CTX);
829 print "config.smb_build.pl: creating Makefile.in\n";