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
($)
23 sub _prepare_path_vars
($)
28 $output = << '__EOD__';
30 exec_prefix
=@exec_prefix@
39 CONFIGDIR
= @configdir@
40 VARDIR
= @localstatedir@
43 # The permissions to give the executables
46 # set these to where to find various files
47 # These can be overridden by command line switches (see smbd(8))
48 # or in smb.conf (see smb.conf(5))
49 LOGFILEBASE
= @logfilebase@
50 CONFIGFILE
= $(CONFIGDIR
)/smb
.conf
51 LMHOSTSFILE
= $(CONFIGDIR
)/lmhosts
52 NCALRPCDIR
= @localstatedir@
/ncalrpc
54 # This is where smbpasswd et al go
55 PRIVATEDIR
= @privatedir@
56 SMB_PASSWD_FILE
= $(PRIVATEDIR
)/smbpasswd
58 # the directory where lock files go
61 # the directory where pid files go
64 PASSWD_FLAGS
= -DSMB_PASSWD_FILE
=\"$(SMB_PASSWD_FILE
)\" -DPRIVATE_DIR
=\"$(PRIVATEDIR
)\"
65 PATH_FLAGS1
= -DCONFIGFILE
=\"$(CONFIGFILE
)\" -DSBINDIR
=\"$(SBINDIR
)\"
66 PATH_FLAGS2
= $(PATH_FLAGS1
) -DBINDIR
=\"$(BINDIR
)\"
67 PATH_FLAGS3
= $(PATH_FLAGS2
) -DLMHOSTSFILE
=\"$(LMHOSTSFILE
)\"
68 PATH_FLAGS4
= $(PATH_FLAGS3
) -DLOCKDIR
=\"$(LOCKDIR
)\" -DPIDDIR
=\"$(PIDDIR
)\"
69 PATH_FLAGS5
= $(PATH_FLAGS4
) -DLIBDIR
=\"$(LIBDIR
)\" \
70 -DLOGFILEBASE
=\"$(LOGFILEBASE
)\" -DSHLIBEXT
=\"@SHLIBEXT@
\"
71 PATH_FLAGS6
= $(PATH_FLAGS5
) -DCONFIGDIR
=\"$(CONFIGDIR
)\" -DNCALRPCDIR
=\"$(NCALRPCDIR
)\"
72 PATH_FLAGS7
= $(PATH_FLAGS6
) -DSWATDIR
=\"$(SWATDIR
)\"
73 PATH_FLAGS
= $(PATH_FLAGS7
) $(PASSWD_FLAGS
)
80 sub _prepare_compiler_linker
($)
86 CFLAGS
=-Iinclude
-I
. -I
$(srcdir
)/include
-I
$(srcdir
) -D_SAMBA_BUILD_
-DHAVE_CONFIG_H
-Ilib
@CFLAGS@
@CPPFLAGS@
89 LD_FLAGS
=@LDFLAGS@
@CFLAGS@
-Lbin
95 SHLD_FLAGS
=@LDSHFLAGS@
@LDFLAGS@
-Lbin
100 sub _prepare_default_rule
($)
105 $output = << '__EOD__';
113 sub _prepare_SUFFIXES
($)
118 $output = << '__EOD__';
120 .SUFFIXES
: .c
.o
.h
.h
.gch
.a
.so
132 idl_full
: build
/pidl/idl.pm
133 CPP
="@CPP@" PERL
="$(PERL)" script
/build_idl
.sh FULL
@PIDL_ARGS@
135 idl
: build
/pidl/idl.pm
136 @CPP="@CPP@" PERL
="$(PERL)" script
/build_idl
.sh PARTIAL
@PIDL_ARGS@
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
148 test
: @DEFAULT_TEST_TARGET@
151 ./script/tests
/selftest.sh `pwd`/prefix
-test SOCKET_WRAPPER
154 ./script/tests
/selftest.sh `pwd`/prefix
-test
159 sub _prepare_dummy_MAKEDIR
()
167 dynconfig
.o
: dynconfig
.c Makefile
169 @
$(CC
) $(CFLAGS
) @PICFLAG@
$(PATH_FLAGS
) -c
$< -o
$@
170 @BROKEN_CC@
-mv
`echo $@ | sed 's%^.*/%%g'` $@
175 ###########################################################
176 # This function creates a standard make rule which is using $(CC)
178 # $output = _prepare_std_CC_rule($srcext,$destext,$flags,$message,$comment)
180 # $srcext - sourcefile extension
182 # $destext - destinationfile extension
184 # $flags - additional compiler flags
186 # $message - logmessage which is echoed while running this rule
188 # $comment - just a comment what this rule should do
190 # $output - the resulting output buffer
191 sub _prepare_std_CC_rule
($$$$$)
201 $output = << "__EOD__";
204 \
@echo $message \
$\
*.$src
205 \@\
$(CC
) \
$(TARGET_CFLAGS
) \
$(CFLAGS
) $flags -c \
$< -o \
$\@
206 \
@BROKEN_CC\@
-mv
`echo \$\@ | sed 's%^.*/%%g'` \
$\@
213 sub array2oneperline
($)
219 foreach my $str (@
{$array}) {
220 if (!defined($str)) {
224 $output .= " \\\n\t\t";
237 foreach my $str (@
{$array}) {
238 if (!defined($str)) {
249 ###########################################################
250 # This function creates a object file list
252 # $output = _prepare_var_obj_list($var, $var_ctx)
254 # $var_ctx - the subsystem context
256 # $var_ctx->{NAME} - the <var> name
257 # $var_ctx->{OBJ_LIST} - the list of objectfiles which sould be linked to this <var>
259 # $output - the resulting output buffer
260 sub _prepare_obj_list
($$)
265 my $tmplist = array2oneperline
($ctx->{OBJ_LIST
});
268 # $var $ctx->{NAME} OBJ LIST
269 $var\_
$ctx->{NAME
}_OBJS
=$tmplist
274 sub _prepare_cflags
($$)
279 my $tmplist = array2oneperline
($ctx->{CFLAGS
});
282 $var\_
$ctx->{NAME
}_CFLAGS
=$tmplist
287 ###########################################################
288 # This function creates a make rule for linking a library
290 # $output = _prepare_shared_library_rule($library_ctx)
292 # $library_ctx - the library context
294 # $library_ctx->{NAME} - the library name
296 # $library_ctx->{DEPEND_LIST} - the list of rules on which this library depends
298 # $library_ctx->{LIBRARY_NAME} - the shared library name
299 # $library_ctx->{LIBRARY_REALNAME} - the shared library real name
300 # $library_ctx->{LIBRARY_SONAME} - the shared library soname
301 # $library_ctx->{LINK_LIST} - the list of objectfiles and external libraries
302 # which sould be linked to this shared library
303 # $library_ctx->{LINK_FLAGS} - linker flags used by this shared library
305 # $output - the resulting output buffer
306 sub _prepare_shared_library_rule
($)
317 $tmpdepend = array2oneperline
($ctx->{DEPEND_LIST
});
319 $tmpshlink = array2oneperline
($ctx->{LINK_LIST
});
320 $tmpshflag = array2oneperline
($ctx->{LINK_FLAGS
});
322 $output = << "__EOD__";
323 LIBRARY_
$ctx->{NAME
}_DEPEND_LIST
=$tmpdepend
325 LIBRARY_
$ctx->{NAME
}_SHARED_LINK_LIST
=$tmpshlink
326 LIBRARY_
$ctx->{NAME
}_SHARED_LINK_FLAGS
=$tmpshflag
329 $ctx->{TARGET
}: \
$(LIBRARY_
$ctx->{NAME
}_DEPEND_LIST
) \
$(LIBRARY_
$ctx->{NAME
}_OBJS
) bin
/.dummy
331 \@\
$(SHLD
) \
$(SHLD_FLAGS
) -o \
$\@
\\
332 \
$(LIBRARY_
$ctx->{NAME
}_SHARED_LINK_FLAGS
) \\
333 \
$(LIBRARY_
$ctx->{NAME
}_SHARED_LINK_LIST
)
337 if (defined($ctx->{LIBRARY_SONAME
})) {
338 $output .= << "__EOD__";
339 # Symlink $ctx->{LIBRARY_SONAME}
340 bin
/$ctx->{LIBRARY_SONAME}: bin/$ctx->{LIBRARY_REALNAME
} bin
/.dummy
342 \
@ln -sf
$ctx->{LIBRARY_REALNAME
} \
$\@
343 # Symlink $ctx->{LIBRARY_NAME}
344 bin
/$ctx->{LIBRARY_NAME}: bin/$ctx->{LIBRARY_SONAME
} bin
/.dummy
346 \
@ln -sf
$ctx->{LIBRARY_SONAME
} \
$\@
351 $output .= << "__EOD__";
352 library_
$ctx->{NAME
}: basics bin
/lib
$ctx->{LIBRARY_NAME
}
359 sub _prepare_objlist_rule
($)
362 my $tmpdepend = array2oneperline
($ctx->{DEPEND_LIST
});
365 $output = "$ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST = $tmpdepend\n";
367 $output .= "$ctx->{TARGET}: ";
369 if (defined ($ctx->{TARGET_CFLAGS
})) {
370 $output .= "\n\t@\$(MAKE) TARGET_CFLAGS=\"" . join(' ', @
{$ctx->{TARGET_CFLAGS
}}) . "\" ";
373 $output .= "\$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_OBJS)\n";
374 $output .= "\t\@touch $ctx->{TARGET}\n";
379 ###########################################################
380 # This function creates a make rule for linking a library
382 # $output = _prepare_static_library_rule($library_ctx)
384 # $library_ctx - the library context
386 # $library_ctx->{NAME} - the library name
388 # $library_ctx->{DEPEND_LIST} - the list of rules on which this library depends
390 # $library_ctx->{LIBRARY_NAME} - the static library name
391 # $library_ctx->{LINK_LIST} - the list of objectfiles which sould be linked
392 # to this static library
393 # $library_ctx->{LINK_FLAGS} - linker flags used by this static library
395 # $output - the resulting output buffer
396 sub _prepare_static_library_rule
($)
407 $tmpdepend = array2oneperline
($ctx->{DEPEND_LIST
});
409 $tmpstlink = array2oneperline
($ctx->{LINK_LIST
});
410 $tmpstflag = array2oneperline
($ctx->{LINK_FLAGS
});
412 $output = << "__EOD__";
413 LIBRARY_
$ctx->{NAME
}_DEPEND_LIST
=$tmpdepend
415 LIBRARY_
$ctx->{NAME
}_STATIC_LINK_LIST
=$tmpstlink
417 $ctx->{TARGET
}: \
$(LIBRARY_
$ctx->{NAME
}_DEPEND_LIST
) \
$(LIBRARY_
$ctx->{NAME
}_OBJS
) bin
/.dummy
419 \@\
$(STLD
) \
$(STLD_FLAGS
) \
$@
\\
420 \
$(LIBRARY_
$ctx->{NAME
}_STATIC_LINK_LIST
)
422 library_
$ctx->{NAME
}: basics
$ctx->{TARGET
}
429 ###########################################################
430 # This function creates a make rule for linking a binary
432 # $output = _prepare_binary_rule($binary_ctx)
434 # $binary_ctx - the binary context
436 # $binary_ctx->{NAME} - the binary name
437 # $binary_ctx->{BINARY} - the binary binary name
439 # $binary_ctx->{DEPEND_LIST} - the list of rules on which this binary depends
440 # $binary_ctx->{LINK_LIST} - the list of objectfiles and external libraries
441 # which sould be linked to this binary
442 # $binary_ctx->{LINK_FLAGS} - linker flags used by this binary
444 # $output - the resulting output buffer
445 sub _prepare_binary_rule
($)
453 $tmpdepend = array2oneperline
($ctx->{DEPEND_LIST
});
454 $tmplink = array2oneperline
($ctx->{LINK_LIST
});
455 $tmpflag = array2oneperline
($ctx->{LINK_FLAGS
});
457 $output = << "__EOD__";
459 BINARY_
$ctx->{NAME
}_DEPEND_LIST
=$tmpdepend
460 BINARY_
$ctx->{NAME
}_LINK_LIST
=$tmplink
461 BINARY_
$ctx->{NAME
}_LINK_FLAGS
=$tmpflag
463 bin
/$ctx->{BINARY}: bin/.dummy \
$(BINARY_
$ctx->{NAME
}_DEPEND_LIST
) \
$(BINARY_
$ctx->{NAME
}_OBJS
)
465 \@\
$(LD
) \
$(LD_FLAGS
) -o \
$\@
\\
466 \
$\
(BINARY_
$ctx->{NAME
}_LINK_FLAGS
) \\
467 \
$\
(BINARY_
$ctx->{NAME
}_LINK_LIST
) \\
468 \
$\
(BINARY_
$ctx->{NAME
}_LINK_FLAGS
)
469 binary_
$ctx->{BINARY
}: basics bin
/$ctx->{BINARY
}
476 sub _prepare_custom_rule
($)
479 return "$ctx->{NAME}:\n\t$ctx->{CMD}\n";
482 sub _prepare_proto_rules
()
486 $output .= << '__EOD__';
487 # Making this target will just make sure that the prototype files
488 # exist, not necessarily that they are up to date. Since they're
489 # removed by 'make clean' this will always be run when you do anything
491 proto_exists
: include
/proto.h include/build_env
.h
493 delheaders
: pch_clean
494 -rm
-f
$(builddir
)/include/proto
.h
$(builddir
)/include/build_env
.h
:
497 @cd $(srcdir
) && $(SHELL
) script
/mkproto
.sh
"$(PERL)" \
498 -h _PROTO_H_
$(builddir
)/include/proto
.h \
502 @echo Building include
/build_env
.h
503 @cd $(srcdir
) && $(SHELL
) script
/build_env.sh $(srcdir) $(builddir) $(CC) > $(builddir)/include
/build_env
.h
505 # 'make headers' or 'make proto' calls a subshell because we need to
506 # make sure these commands are executed in sequence even for a
508 headers
: delheaders proto_exists
513 @
[ -f
$(builddir
)/include/proto
.h
] || $(MAKE
) proto
516 @echo Removing objects
and binaries
517 @
-rm
-f
$(_ALL_OBJS_OBJS
) bin
/* bin/.*_
*
518 @echo Removing generated files
519 @
-rm
-rf librpc
/gen_
*
523 -rm
-f include
/config
.h
526 -rm
-f config
.smb_build
.*
527 -rm
-f config
.log config
.cache
530 -rm
-f
*.bak
*~ */*.bak */*~ */*/*.bak
*/*/*~ */*/*/*.bak */*/*/*~
532 realdistclean
: distclean removebackup
533 -rm
-f include
/config
.h
.in
541 sub _prepare_make_target
($)
547 $tmpdepend = array2oneperline
($ctx->{DEPEND_LIST
});
550 $ctx->{TARGET
}: basics
$tmpdepend
555 sub _prepare_target_settings
($)
560 foreach my $key (values %$CTX) {
561 if (defined($key->{OBJ_LIST
})) {
562 $output .= _prepare_obj_list
($key->{TYPE
}, $key);
565 if (defined($key->{OBJ_LIST
})) {
566 $output .= _prepare_cflags
($key->{TYPE
}, $key);
573 sub _prepare_install_rules
($)
578 $output .= << '__EOD__';
581 @echo "Samba will be installed into:"
582 @echo " basedir: $(BASEDIR)"
583 @echo " bindir: $(BINDIR)"
584 @echo " sbindir: $(SBINDIR)"
585 @echo " libdir: $(LIBDIR)"
586 @echo " vardir: $(VARDIR)"
587 @echo " privatedir: $(PRIVATEDIR)"
588 @echo " piddir: $(PIDDIR)"
589 @echo " lockdir: $(LOCKDIR)"
590 @echo " swatdir: $(SWATDIR)"
593 @echo "Samba will be compiled with flags:"
594 @echo " CFLAGS = $(CFLAGS)"
595 @echo " LD_FLAGS = $(LD_FLAGS)"
596 @echo " STLD_FLAGS = $(STLD_FLAGS)"
597 @echo " SHLD_FLAGS = $(SHLD_FLAGS)"
599 SBIN_PROGS
= bin
/smbd
601 BIN_PROGS
= bin
/smbclient \
606 TORTURE_PROGS
= bin
/smbtorture \
612 LDB_PROGS
= bin
/ldbadd \
618 REG_PROGS
= bin
/regpatch \
624 install
: showlayout installbin installtorture installldb installreg installdat installswat
626 # DESTDIR is used here to prevent packagers wasting their time
627 # duplicating the Makefile. Remove it and you will have the privelege
628 # of package each samba release for muliple versions of multiple
629 # distributions and operating systems, or at least supplying patches
630 # to all the packaging files required for this, prior to committing
631 # the removal of DESTDIR. Do not remove it even though you think it
635 @
$(SHELL
) $(srcdir
)/script/installdirs
.sh
$(DESTDIR
)$(BASEDIR
) $(DESTDIR
)$(BINDIR
) $(DESTDIR
)$(SBINDIR
) $(DESTDIR
)$(LIBDIR
) $(DESTDIR
)$(VARDIR
) $(DESTDIR
)$(PRIVATEDIR
) $(DESTDIR
)$(PIDDIR
) $(DESTDIR
)$(LOCKDIR
) $(DESTDIR
)$(PRIVATEDIR
)/tls
637 installbin
: all installdirs
638 @
$(SHELL
) $(srcdir
)/script/installbin
.sh
$(INSTALLPERMS
) $(DESTDIR
)$(BASEDIR
) $(DESTDIR
)$(SBINDIR
) $(DESTDIR
)$(LIBDIR
) $(DESTDIR
)$(VARDIR
) $(SBIN_PROGS
)
639 @
$(SHELL
) $(srcdir
)/script/installbin
.sh
$(INSTALLPERMS
) $(DESTDIR
)$(BASEDIR
) $(DESTDIR
)$(BINDIR
) $(DESTDIR
)$(LIBDIR
) $(DESTDIR
)$(VARDIR
) $(BIN_PROGS
)
641 installtorture
: all installdirs
642 @
$(SHELL
) $(srcdir
)/script/installbin
.sh
$(INSTALLPERMS
) $(DESTDIR
)$(BASEDIR
) $(DESTDIR
)$(BINDIR
) $(DESTDIR
)$(LIBDIR
) $(DESTDIR
)$(VARDIR
) $(TORTURE_PROGS
)
644 installldb
: all installdirs
645 @
$(SHELL
) $(srcdir
)/script/installbin
.sh
$(INSTALLPERMS
) $(DESTDIR
)$(BASEDIR
) $(DESTDIR
)$(BINDIR
) $(DESTDIR
)$(LIBDIR
) $(DESTDIR
)$(VARDIR
) $(LDB_PROGS
)
647 installreg
: all installdirs
648 @
$(SHELL
) $(srcdir
)/script/installbin
.sh
$(INSTALLPERMS
) $(DESTDIR
)$(BASEDIR
) $(DESTDIR
)$(BINDIR
) $(DESTDIR
)$(LIBDIR
) $(DESTDIR
)$(VARDIR
) $(REG_PROGS
)
650 installdat
: installdirs
651 @
$(SHELL
) $(srcdir
)/script/installdat
.sh
$(DESTDIR
)$(LIBDIR
) $(srcdir
)
653 installswat
: installdirs
654 @
$(SHELL
) $(srcdir
)/script/installswat
.sh
$(DESTDIR
)$(SWATDIR
) $(srcdir
)
656 uninstall
: uninstallbin uninstalltorture uninstallldb uninstallreg
659 @
$(SHELL
) $(srcdir
)/script/uninstallbin
.sh
$(INSTALLPERMS
) $(DESTDIR
)$(BASEDIR
) $(DESTDIR
)$(SBINDIR
) $(DESTDIR
)$(LIBDIR
) $(DESTDIR
)$(VARDIR
) $(DESTDIR
)$(SBIN_PROGS
)
662 @
$(SHELL
) $(srcdir
)/script/uninstallbin
.sh
$(INSTALLPERMS
) $(DESTDIR
)$(BASEDIR
) $(DESTDIR
)$(BINDIR
) $(DESTDIR
)$(LIBDIR
) $(DESTDIR
)$(VARDIR
) $(DESTDIR
)$(TORTURE_PROGS
)
665 @
$(SHELL
) $(srcdir
)/script/uninstallbin
.sh
$(INSTALLPERMS
) $(DESTDIR
)$(BASEDIR
) $(DESTDIR
)$(BINDIR
) $(DESTDIR
)$(LIBDIR
) $(DESTDIR
)$(VARDIR
) $(DESTDIR
)$(LDB_PROGS
)
668 @
$(SHELL
) $(srcdir
)/script/uninstallbin
.sh
$(INSTALLPERMS
) $(DESTDIR
)$(BASEDIR
) $(DESTDIR
)$(BINDIR
) $(DESTDIR
)$(LIBDIR
) $(DESTDIR
)$(VARDIR
) $(DESTDIR
)$(REG_PROGS
)
672 swig
: scripting
/swig/_tdb
.so scripting
/swig/_dcerpc
.so
674 scripting
/swig/tdb_wrap
.c
: scripting
/swig/tdb
.i
675 swig
-python scripting
/swig/tdb
.i
677 scripting
/swig/_tdb
.so
: scripting
/swig/tdb_wrap
.o
$(LIBRARY_swig_tdb_DEPEND_LIST
)
678 $(SHLD
) $(SHLD_FLAGS
) -o scripting
/swig/_tdb
.so scripting
/swig/tdb_wrap
.o \
679 $(LIBRARY_swig_tdb_SHARED_LINK_LIST
) $(LIBRARY_swig_tdb_SHARED_LINK_FLAGS
)
681 SWIG_INCLUDES
= librpc
/gen_ndr/samr
.i librpc
/gen_ndr/lsa.i librpc
/gen_ndr/spoolss.i
683 scripting
/swig/dcerpc_wrap
.c
: scripting
/swig/dcerpc
.i scripting
/swig/samba
.i scripting
/swig/status_codes
.i
$(SWIG_INCLUDES
)
684 swig
-python scripting
/swig/dcerpc
.i
686 scripting
/swig/_dcerpc
.so
: scripting
/swig/dcerpc_wrap
.o
$(LIBRARY_swig_dcerpc_DEPEND_LIST
)
687 $(SHLD
) $(SHLD_FLAGS
) -o scripting
/swig/_dcerpc
.so scripting
/swig/dcerpc_wrap
.o
$(LIBRARY_swig_dcerpc_SHARED_LINK_LIST
) $(LIBRARY_swig_dcerpc_SHARED_LINK_FLAGS
)
690 -rm
-f scripting
/swig/_tdb
.so scripting
/swig/tdb
.pyc \
691 scripting
/swig/tdb
.py scripting
/swig/tdb_wrap
.c \
692 scripting
/swig/tdb_wrap
.o
697 etags
`find $(srcdir) -name "*.[ch]"`
700 ctags
`find $(srcdir) -name "*.[ch]"`
707 sub _prepare_rule_lists
($)
712 foreach my $key (values %{$depend}) {
713 next if not defined $key->{OUTPUT_TYPE
};
715 ($output .= _prepare_objlist_rule
($key)) if $key->{OUTPUT_TYPE
} eq "OBJLIST";
716 ($output .= _prepare_static_library_rule
($key)) if $key->{OUTPUT_TYPE
} eq "STATIC_LIBRARY";
717 ($output .= _prepare_shared_library_rule
($key)) if $key->{OUTPUT_TYPE
} eq "SHARED_LIBRARY";
718 ($output .= _prepare_binary_rule
($key)) if $key->{OUTPUT_TYPE
} eq "BINARY";
719 ($output .= _prepare_custom_rule
($key) ) if $key->{TYPE
} eq "TARGET";
723 $output .= _prepare_IDL
($idl_ctx);
725 $output .= _prepare_proto_rules
();
727 $output .= _prepare_install_rules
($depend);
732 ###########################################################
733 # This function prepares the output for Makefile
735 # $output = _prepare_makefile_in($OUTPUT)
737 # $OUTPUT - the global OUTPUT context
739 # $output - the resulting output buffer
740 sub _prepare_makefile_in
($)
745 $output = "########################################\n";
746 $output .= "# Autogenerated by config.smb_build.pl #\n";
747 $output .= "########################################\n";
751 $output .= _prepare_command_interpreters
($cmd_ctx);
754 $output .= _prepare_path_vars
($path_ctx);
757 $output .= _prepare_compiler_linker
($compiler_ctx);
760 $output .= _prepare_default_rule
($rules_ctx);
763 $output .= _prepare_SUFFIXES
($suffix_ctx);
765 $output .= _prepare_dummy_MAKEDIR
();
767 $output .= _prepare_std_CC_rule
("c","o",'@PICFLAG@',"Compiling","Rule for std objectfiles");
768 $output .= _prepare_std_CC_rule
("h","h.gch",'@PICFLAG@',"Precompiling","Rule for precompiled headerfiles");
770 $output .= _prepare_target_settings
($CTX);
772 $output .= _prepare_rule_lists
($CTX);
776 foreach my $part (values %{$CTX}) {
777 push (@all, $part->{TARGET
}) if defined ($part->{OUTPUT_TYPE
}) and $part->{OUTPUT_TYPE
} eq "BINARY";
780 $output .= _prepare_make_target
({ TARGET
=> "all", DEPEND_LIST
=> \
@all });
785 ###########################################################
786 # This function creates Makefile.in from the OUTPUT
789 # create_makefile_in($OUTPUT)
791 # $OUTPUT - the global OUTPUT context
793 # $output - the resulting output buffer
794 sub create_makefile_in
($$)
799 open(MAKEFILE_IN
,">$file") || die ("Can't open $file\n");
800 print MAKEFILE_IN _prepare_makefile_in
($CTX);
803 print "config.smb_build.pl: creating $file\n";