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
66 PATH_FLAGS = -DCONFIGFILE=\"$(CONFIGFILE)\" -DSBINDIR=\"$(SBINDIR)\" \
67 -DBINDIR=\"$(BINDIR)\" -DLMHOSTSFILE=\"$(LMHOSTSFILE)\" \
68 -DLOCKDIR=\"$(LOCKDIR)\" -DPIDDIR=\"$(PIDDIR)\" -DLIBDIR=\"$(LIBDIR)\" \
69 -DLOGFILEBASE=\"$(LOGFILEBASE)\" -DSHLIBEXT=\"@SHLIBEXT@\" \
70 -DCONFIGDIR=\"$(CONFIGDIR)\" -DNCALRPCDIR=\"$(NCALRPCDIR)\" \
71 -DSWATDIR=\"$(SWATDIR)\" -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" \
72 -DPRIVATE_DIR=\"$(PRIVATEDIR)\"
78 sub _prepare_compiler_linker($)
84 CFLAGS=-Iinclude -I. -I$(srcdir)/include -I$(srcdir) -D_SAMBA_BUILD_ -DHAVE_CONFIG_H -Ilib @CFLAGS@ @CPPFLAGS@
87 LD_FLAGS=@LDFLAGS@ @CFLAGS@ -Lbin
93 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 .1 .1.xml .3 .3.xml .5 .5.xml .7 .7.xml
132 idl_full: build/pidl/Parse/Pidl/IDL.pm
133 CPP="@CPP@" PERL="$(PERL)" script/build_idl.sh FULL @PIDL_ARGS@
135 idl: build/pidl/Parse/Pidl/IDL.pm
136 @CPP="@CPP@" PERL="$(PERL)" script/build_idl.sh PARTIAL @PIDL_ARGS@
138 build/pidl/Parse/Pidl/IDL.pm: build/pidl/idl.yp
139 -yapp -s -m 'Parse::Pidl::IDL' -o build/pidl/Parse/Pidl/IDL.pm build/pidl/idl.yp
141 pch: proto include/includes.h.gch
144 -rm -f include/includes.h.gch
146 basics: idl proto_exists HEIMDAL_EXTERNAL
148 test: @DEFAULT_TEST_TARGET@
151 ./script/tests/selftest.sh @selftest_prefix@/prefix-test all SOCKET_WRAPPER
154 ./script/tests/selftest.sh @selftest_prefix@/prefix-test all
157 ./script/tests/selftest.sh @selftest_prefix@/prefix-test quick SOCKET_WRAPPER
160 SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
161 ./script/tests/selftest.sh @selftest_prefix@/prefix-test quick SOCKET_WRAPPER
166 sub _prepare_man_rule($)
171 .$suffix.xml.$suffix:
172 \$(XSLTPROC) -o \$@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl \$<
177 sub _prepare_manpages($)
183 foreach (values %$ctx) {
184 if (defined($_->{MANPAGE}) and $_->{MANPAGE} ne "") {
185 push (@mp_list, $_->{MANPAGE});
189 my $mp = join(' ', @mp_list);
193 manpages: \$(MANPAGES)
198 sub _prepare_dummy_MAKEDIR()
206 dynconfig.o: dynconfig.c Makefile
208 @$(CC) $(CFLAGS) @PICFLAG@ $(PATH_FLAGS) -c $< -o $@
209 @BROKEN_CC@ -mv `echo $@ | sed 's%^.*/%%g'` $@
214 ###########################################################
215 # This function creates a standard make rule which is using $(CC)
217 # $output = _prepare_std_CC_rule($srcext,$destext,$flags,$message,$comment)
219 # $srcext - sourcefile extension
221 # $destext - destinationfile extension
223 # $flags - additional compiler flags
225 # $message - logmessage which is echoed while running this rule
227 # $comment - just a comment what this rule should do
229 # $output - the resulting output buffer
230 sub _prepare_std_CC_rule($$$$$)
240 $output = << "__EOD__";
243 \@echo $message \$\*.$src
244 \@\$(CC) `script/cflags.sh \$\@` \$(CFLAGS) $flags -c \$< -o \$\@
245 \@BROKEN_CC\@ -mv `echo \$\@ | sed 's%^.*/%%g'` \$\@
252 sub array2oneperline($)
258 foreach my $str (@{$array}) {
259 if (!defined($str)) {
263 $output .= " \\\n\t\t";
276 foreach my $str (@{$array}) {
277 if (!defined($str)) {
288 ###########################################################
289 # This function creates a object file list
291 # $output = _prepare_var_obj_list($var, $var_ctx)
293 # $var_ctx - the subsystem context
295 # $var_ctx->{NAME} - the <var> name
296 # $var_ctx->{OBJ_LIST} - the list of objectfiles which sould be linked to this <var>
298 # $output - the resulting output buffer
299 sub _prepare_obj_list($$)
304 my $tmplist = array2oneperline($ctx->{OBJ_LIST});
307 # $var $ctx->{NAME} OBJ LIST
308 $var\_$ctx->{NAME}_OBJS =$tmplist
313 sub _prepare_cflags($$)
318 my $tmplist = array2oneperline($ctx->{CFLAGS});
321 $var\_$ctx->{NAME}_CFLAGS =$tmplist
326 ###########################################################
327 # This function creates a make rule for linking a library
329 # $output = _prepare_shared_library_rule($library_ctx)
331 # $library_ctx - the library context
333 # $library_ctx->{NAME} - the library name
335 # $library_ctx->{DEPEND_LIST} - the list of rules on which this library depends
337 # $library_ctx->{LIBRARY_NAME} - the shared library name
338 # $library_ctx->{LIBRARY_REALNAME} - the shared library real name
339 # $library_ctx->{LIBRARY_SONAME} - the shared library soname
340 # $library_ctx->{LINK_LIST} - the list of objectfiles and external libraries
341 # which sould be linked to this shared library
342 # $library_ctx->{LINK_FLAGS} - linker flags used by this shared library
344 # $output - the resulting output buffer
345 sub _prepare_shared_library_rule($)
356 $tmpdepend = array2oneperline($ctx->{DEPEND_LIST});
358 $tmpshlink = array2oneperline($ctx->{LINK_LIST});
359 $tmpshflag = array2oneperline($ctx->{LINK_FLAGS});
361 $output = << "__EOD__";
362 LIBRARY_$ctx->{NAME}_DEPEND_LIST =$tmpdepend
364 LIBRARY_$ctx->{NAME}_SHARED_LINK_LIST =$tmpshlink
365 LIBRARY_$ctx->{NAME}_SHARED_LINK_FLAGS =$tmpshflag
368 $ctx->{TARGET}: \$(LIBRARY_$ctx->{NAME}_DEPEND_LIST) \$(LIBRARY_$ctx->{NAME}_OBJS) bin/.dummy
370 \@\$(SHLD) \$(SHLD_FLAGS) -o \$\@ \\
371 \$(LIBRARY_$ctx->{NAME}_SHARED_LINK_FLAGS) \\
372 \$(LIBRARY_$ctx->{NAME}_SHARED_LINK_LIST)
376 if (defined($ctx->{LIBRARY_SONAME})) {
377 $output .= << "__EOD__";
378 # Symlink $ctx->{LIBRARY_SONAME}
379 bin/$ctx->{LIBRARY_SONAME}: bin/$ctx->{LIBRARY_REALNAME} bin/.dummy
381 \@ln -sf $ctx->{LIBRARY_REALNAME} \$\@
382 # Symlink $ctx->{LIBRARY_NAME}
383 bin/$ctx->{LIBRARY_NAME}: bin/$ctx->{LIBRARY_SONAME} bin/.dummy
385 \@ln -sf $ctx->{LIBRARY_SONAME} \$\@
390 $output .= << "__EOD__";
391 library_$ctx->{NAME}: basics bin/lib$ctx->{LIBRARY_NAME}
398 sub _prepare_objlist_rule($)
401 my $tmpdepend = array2oneperline($ctx->{DEPEND_LIST});
404 if (! $ctx->{TARGET}) {
408 $output = "$ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST = $tmpdepend\n";
410 $output .= "$ctx->{TARGET}: ";
412 $output .= "\$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_OBJS)\n";
413 $output .= "\t\@touch $ctx->{TARGET}\n";
418 ###########################################################
419 # This function creates a make rule for linking a library
421 # $output = _prepare_static_library_rule($library_ctx)
423 # $library_ctx - the library context
425 # $library_ctx->{NAME} - the library name
427 # $library_ctx->{DEPEND_LIST} - the list of rules on which this library depends
429 # $library_ctx->{LIBRARY_NAME} - the static library name
430 # $library_ctx->{LINK_LIST} - the list of objectfiles which sould be linked
431 # to this static library
432 # $library_ctx->{LINK_FLAGS} - linker flags used by this static library
434 # $output - the resulting output buffer
435 sub _prepare_static_library_rule($)
446 $tmpdepend = array2oneperline($ctx->{DEPEND_LIST});
448 $tmpstlink = array2oneperline($ctx->{LINK_LIST});
449 $tmpstflag = array2oneperline($ctx->{LINK_FLAGS});
451 $output = << "__EOD__";
452 LIBRARY_$ctx->{NAME}_DEPEND_LIST =$tmpdepend
454 LIBRARY_$ctx->{NAME}_STATIC_LINK_LIST =$tmpstlink
456 $ctx->{TARGET}: \$(LIBRARY_$ctx->{NAME}_DEPEND_LIST) \$(LIBRARY_$ctx->{NAME}_OBJS) bin/.dummy
458 \@\$(STLD) \$(STLD_FLAGS) \$@ \\
459 \$(LIBRARY_$ctx->{NAME}_STATIC_LINK_LIST)
461 library_$ctx->{NAME}: basics $ctx->{TARGET}
468 ###########################################################
469 # This function creates a make rule for linking a binary
471 # $output = _prepare_binary_rule($binary_ctx)
473 # $binary_ctx - the binary context
475 # $binary_ctx->{NAME} - the binary name
476 # $binary_ctx->{BINARY} - the binary binary name
478 # $binary_ctx->{DEPEND_LIST} - the list of rules on which this binary depends
479 # $binary_ctx->{LINK_LIST} - the list of objectfiles and external libraries
480 # which sould be linked to this binary
481 # $binary_ctx->{LINK_FLAGS} - linker flags used by this binary
483 # $output - the resulting output buffer
484 sub _prepare_binary_rule($)
492 $tmpdepend = array2oneperline($ctx->{DEPEND_LIST});
493 $tmplink = array2oneperline($ctx->{LINK_LIST});
494 $tmpflag = array2oneperline($ctx->{LINK_FLAGS});
496 $output = << "__EOD__";
498 BINARY_$ctx->{NAME}_DEPEND_LIST =$tmpdepend
499 BINARY_$ctx->{NAME}_LINK_LIST =$tmplink
500 BINARY_$ctx->{NAME}_LINK_FLAGS =$tmpflag
502 bin/$ctx->{BINARY}: bin/.dummy \$(BINARY_$ctx->{NAME}_DEPEND_LIST) \$(BINARY_$ctx->{NAME}_OBJS)
504 \@\$(LD) \$(LD_FLAGS) -o \$\@ \\
505 \$\(BINARY_$ctx->{NAME}_LINK_FLAGS) \\
506 \$\(BINARY_$ctx->{NAME}_LINK_LIST) \\
507 \$\(BINARY_$ctx->{NAME}_LINK_FLAGS)
508 binary_$ctx->{BINARY}: basics bin/$ctx->{BINARY}
515 sub _prepare_custom_rule($)
519 $ctx->{NAME}: bin/.TARGET_$ctx->{NAME}
521 bin/.TARGET_$ctx->{NAME}:
523 touch bin/.TARGET_$ctx->{NAME}
527 sub _prepare_proto_rules()
531 $output .= << '__EOD__';
532 # Making this target will just make sure that the prototype files
533 # exist, not necessarily that they are up to date. Since they're
534 # removed by 'make clean' this will always be run when you do anything
536 proto_exists: include/proto.h
538 delheaders: pch_clean
539 -rm -f $(builddir)/include/proto.h
542 @cd $(srcdir) && $(SHELL) script/mkproto.sh "$(PERL)" \
543 -h _PROTO_H_ $(builddir)/include/proto.h \
546 # 'make headers' or 'make proto' calls a subshell because we need to
547 # make sure these commands are executed in sequence even for a
549 headers: delheaders proto_exists
554 @[ -f $(builddir)/include/proto.h ] || $(MAKE) proto
557 @echo Removing objects
558 @-find . -name '*.o' -exec rm -f '{}' \;
559 @echo Removing binaries
561 @echo Removing dummy targets
563 @echo Removing generated files
564 @-rm -rf librpc/gen_*
565 @echo Removing generated ASN1 files
566 @-find heimdal/lib/asn1 -name 'asn1_*.[xc]' -exec rm -f '{}' \;
567 @-find heimdal/lib/gssapi -name 'asn1_*.[xc]' -exec rm -f '{}' \;
568 @-find heimdal/lib/hdb -name 'asn1_*.[xc]' -exec rm -f '{}' \;
572 -rm -f include/config.h include/smb_build.h
575 -rm -f config.log config.cache
576 -rm -f samba4-deps.dot
577 -rm -f lib/registry/winregistry.pc
580 -rm -f *.bak *~ */*.bak */*~ */*/*.bak */*/*~ */*/*/*.bak */*/*/*~
582 realdistclean: distclean removebackup
583 -rm -f include/config.h.in
584 -rm -f include/version.h
592 sub _prepare_make_target($)
598 $tmpdepend = array2oneperline($ctx->{DEPEND_LIST});
601 $ctx->{TARGET}: basics $tmpdepend
606 sub _prepare_target_settings($)
611 foreach my $key (values %$CTX) {
612 if (defined($key->{OBJ_LIST})) {
613 $output .= _prepare_obj_list($key->{TYPE}, $key);
616 if (defined($key->{OBJ_LIST})) {
617 $output .= _prepare_cflags($key->{TYPE}, $key);
624 sub _prepare_install_rules($)
629 $output .= << '__EOD__';
632 @echo "Samba will be installed into:"
633 @echo " basedir: $(BASEDIR)"
634 @echo " bindir: $(BINDIR)"
635 @echo " sbindir: $(SBINDIR)"
636 @echo " libdir: $(LIBDIR)"
637 @echo " vardir: $(VARDIR)"
638 @echo " privatedir: $(PRIVATEDIR)"
639 @echo " piddir: $(PIDDIR)"
640 @echo " lockdir: $(LOCKDIR)"
641 @echo " swatdir: $(SWATDIR)"
642 @echo " mandir: $(MANDIR)"
645 @echo "Samba will be compiled with flags:"
646 @echo " CFLAGS = $(CFLAGS)"
647 @echo " LD_FLAGS = $(LD_FLAGS)"
648 @echo " STLD_FLAGS = $(STLD_FLAGS)"
649 @echo " SHLD_FLAGS = $(SHLD_FLAGS)"
651 SBIN_PROGS = bin/smbd
653 BIN_PROGS = bin/smbclient \
658 TORTURE_PROGS = bin/smbtorture \
664 LDB_PROGS = bin/ldbadd \
670 REG_PROGS = bin/regpatch \
675 GTK_PROGS = bin/gregedit \
679 install: showlayout installbin installtorture installldb installreg installdat installswat installmisc installgtk
681 # DESTDIR is used here to prevent packagers wasting their time
682 # duplicating the Makefile. Remove it and you will have the privilege
683 # of package each samba release for multiple versions of multiple
684 # distributions and operating systems, or at least supplying patches
685 # to all the packaging files required for this, prior to committing
686 # the removal of DESTDIR. Do not remove it even though you think it
690 @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(PRIVATEDIR) $(DESTDIR)$(PIDDIR) $(DESTDIR)$(LOCKDIR) $(DESTDIR)$(PRIVATEDIR)/tls
692 installbin: all installdirs
693 @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(SBIN_PROGS)
694 @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(BIN_PROGS)
696 installtorture: all installdirs
697 @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(TORTURE_PROGS)
699 installldb: all installdirs
700 @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(LDB_PROGS)
702 installreg: all installdirs
703 @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(REG_PROGS)
705 installgtk: all installdirs
706 @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(GTK_PROGS)
708 installdat: installdirs
709 @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(LIBDIR) $(srcdir)
711 installswat: installdirs
712 @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir) $(DESTDIR)$(LIBDIR)
714 installmisc: installdirs
715 @$(SHELL) $(srcdir)/script/installmisc.sh $(srcdir) $(DESTDIR)$(LIBDIR)
717 installman: installdirs
718 @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(MANDIR) $(MANPAGES)
720 uninstall: uninstallbin uninstalltorture uninstallldb uninstallreg uninstallgtk
723 @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(SBIN_PROGS)
726 @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(TORTURE_PROGS)
729 @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(LDB_PROGS)
732 @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(REG_PROGS)
735 @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(GTK_PROGS)
738 @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(MANPAGES)
742 swig: scripting/swig/_tdb.so scripting/swig/_dcerpc.so
744 scripting/swig/tdb_wrap.c: scripting/swig/tdb.i
745 swig -python scripting/swig/tdb.i
747 scripting/swig/_tdb.so: scripting/swig/tdb_wrap.o $(LIBRARY_swig_tdb_DEPEND_LIST)
748 $(SHLD) $(SHLD_FLAGS) -o scripting/swig/_tdb.so scripting/swig/tdb_wrap.o \
749 $(LIBRARY_swig_tdb_SHARED_LINK_LIST) $(LIBRARY_swig_tdb_SHARED_LINK_FLAGS)
751 SWIG_INCLUDES = librpc/gen_ndr/samr.i librpc/gen_ndr/lsa.i librpc/gen_ndr/spoolss.i
753 scripting/swig/dcerpc_wrap.c: scripting/swig/dcerpc.i scripting/swig/samba.i scripting/swig/status_codes.i $(SWIG_INCLUDES)
754 swig -python scripting/swig/dcerpc.i
756 scripting/swig/_dcerpc.so: scripting/swig/dcerpc_wrap.o $(LIBRARY_swig_dcerpc_DEPEND_LIST)
757 $(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)
760 -rm -f scripting/swig/_tdb.so scripting/swig/tdb.pyc \
761 scripting/swig/tdb.py scripting/swig/tdb_wrap.c \
762 scripting/swig/tdb_wrap.o
767 etags `find $(srcdir) -name "*.[ch]"`
770 ctags `find $(srcdir) -name "*.[ch]"`
777 sub _prepare_rule_lists($)
782 foreach my $key (values %{$depend}) {
783 next if not defined $key->{OUTPUT_TYPE};
785 ($output .= _prepare_objlist_rule($key)) if $key->{OUTPUT_TYPE} eq "OBJLIST";
786 ($output .= _prepare_static_library_rule($key)) if $key->{OUTPUT_TYPE} eq "STATIC_LIBRARY";
787 ($output .= _prepare_shared_library_rule($key)) if $key->{OUTPUT_TYPE} eq "SHARED_LIBRARY";
788 ($output .= _prepare_binary_rule($key)) if $key->{OUTPUT_TYPE} eq "BINARY";
789 ($output .= _prepare_custom_rule($key) ) if $key->{TYPE} eq "TARGET";
793 $output .= _prepare_IDL($idl_ctx);
795 $output .= _prepare_proto_rules();
797 $output .= _prepare_install_rules($depend);
802 ###########################################################
803 # This function prepares the output for Makefile
805 # $output = _prepare_makefile_in($OUTPUT)
807 # $OUTPUT - the global OUTPUT context
809 # $output - the resulting output buffer
810 sub _prepare_makefile_in($$)
813 my $settings = shift;
816 $output = "########################################\n";
817 $output .= "# Autogenerated by config.smb_build.pl #\n";
818 $output .= "########################################\n";
822 $output .= _prepare_command_interpreters($cmd_ctx);
825 $output .= _prepare_path_vars($path_ctx);
828 $output .= _prepare_compiler_linker($compiler_ctx);
831 $output .= _prepare_default_rule($rules_ctx);
834 $output .= _prepare_SUFFIXES($suffix_ctx);
836 $output .= _prepare_dummy_MAKEDIR();
838 $output .= _prepare_std_CC_rule("c","o",'@PICFLAG@',"Compiling","Rule for std objectfiles");
839 $output .= _prepare_std_CC_rule("h","h.gch",'@PICFLAG@',"Precompiling","Rule for precompiled headerfiles");
841 $output .= _prepare_man_rule("1");
842 $output .= _prepare_man_rule("3");
843 $output .= _prepare_man_rule("5");
844 $output .= _prepare_man_rule("7");
846 $output .= _prepare_manpages($CTX);
848 $output .= _prepare_target_settings($CTX);
850 $output .= _prepare_rule_lists($CTX);
854 foreach my $part (values %{$CTX}) {
855 push (@all, $part->{TARGET}) if defined ($part->{OUTPUT_TYPE}) and $part->{OUTPUT_TYPE} eq "BINARY";
858 $output .= _prepare_make_target({ TARGET => "all", DEPEND_LIST => \@all });
863 ###########################################################
864 # This function creates Makefile.in from the OUTPUT
867 # create_makefile_in($OUTPUT)
869 # $OUTPUT - the global OUTPUT context
871 # $output - the resulting output buffer
872 sub create_makefile_in($$$)
875 my $settings = shift;
878 open(MAKEFILE_IN,">$file") || die ("Can't open $file\n");
879 print MAKEFILE_IN _prepare_makefile_in($CTX, $settings);
882 print "config.smb_build.pl: creating $file\n";