svn commit: samba r12450 - in branches/SAMBA_4_0/source: .
build/smb_build torture
jelmer at samba.org
jelmer at samba.org
Fri Dec 23 13:02:55 GMT 2005
Author: jelmer
Date: 2005-12-23 13:02:52 +0000 (Fri, 23 Dec 2005)
New Revision: 12450
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12450
Log:
Move generation of proto and full object lists to makefile.pm. 'make' now
handles expanding the protoheader object list, rather then the build system,
which makes the makefile quite a bit shorter.
Modified:
branches/SAMBA_4_0/source/build/smb_build/input.pm
branches/SAMBA_4_0/source/build/smb_build/main.pl
branches/SAMBA_4_0/source/build/smb_build/makefile.pm
branches/SAMBA_4_0/source/build/smb_build/output.pm
branches/SAMBA_4_0/source/main.mk
branches/SAMBA_4_0/source/torture/config.mk
Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/input.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/input.pm 2005-12-23 13:01:26 UTC (rev 12449)
+++ branches/SAMBA_4_0/source/build/smb_build/input.pm 2005-12-23 13:02:52 UTC (rev 12450)
@@ -132,6 +132,10 @@
my ($INPUT, $enabled, $subsys_ot, $lib_ot, $module_ot) = @_;
foreach my $part (values %$INPUT) {
+ unless(defined($part->{NOPROTO})) {
+ $part->{NOPROTO} = "NO";
+ }
+
if (defined($enabled->{$part->{NAME}})) {
$part->{ENABLE} = $enabled->{$part->{NAME}};
next;
Modified: branches/SAMBA_4_0/source/build/smb_build/main.pl
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/main.pl 2005-12-23 13:01:26 UTC (rev 12449)
+++ branches/SAMBA_4_0/source/build/smb_build/main.pl 2005-12-23 13:02:52 UTC (rev 12450)
@@ -76,10 +76,6 @@
$mkenv->Header($key) if defined($key->{PUBLIC_HEADERS});
}
-# FIXME: These two lines are a hack
-$mkenv->ProtoHeader($OUTPUT->{PROTO});
-$mkenv->ProtoHeader($OUTPUT->{ALL_OBJS});
-
$mkenv->write("Makefile");
smb_build_h::create_smb_build_h($OUTPUT, "include/smb_build.h");
Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2005-12-23 13:01:26 UTC (rev 12449)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2005-12-23 13:02:52 UTC (rev 12450)
@@ -247,6 +247,12 @@
$self->_prepare_list($ctx, "LINK_LIST");
$self->_prepare_list($ctx, "LINK_FLAGS");
+ push(@{$self->{all_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST)");
+
+ if ($ctx->{NOPROTO} eq "NO") {
+ push(@{$self->{proto_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST\)");
+ }
+
$self->output(<< "__EOD__"
#
@@ -284,6 +290,12 @@
$self->_prepare_list($ctx, "CFLAGS");
$self->_prepare_list($ctx, "DEPEND_LIST");
+ push(@{$self->{all_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST)");
+
+ if ($ctx->{NOPROTO} eq "NO") {
+ push(@{$self->{proto_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST\)");
+ }
+
$self->output("$ctx->{TARGET}: \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST)\n");
$self->output("\t\@echo \"Pre-Linking $ctx->{TYPE} $ctx->{NAME}\"\n");
@@ -297,6 +309,12 @@
return unless $ctx->{TARGET};
+ push(@{$self->{all_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST)");
+
+ if ($ctx->{NOPROTO} eq "NO") {
+ push(@{$self->{proto_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST\)");
+ }
+
$self->_prepare_list($ctx, "OBJ_LIST");
$self->_prepare_list($ctx, "CFLAGS");
$self->_prepare_list($ctx, "DEPEND_LIST");
@@ -318,6 +336,12 @@
$self->_prepare_list($ctx, "LINK_LIST");
$self->_prepare_list($ctx, "LINK_FLAGS");
+ push(@{$self->{all_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST)");
+
+ if ($ctx->{NOPROTO} eq "NO") {
+ push(@{$self->{proto_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST\)");
+ }
+
$self->output(<< "__EOD__"
#
$ctx->{TARGET}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST) bin/.dummy
@@ -350,6 +374,12 @@
$installdir = "bin";
}
+ push(@{$self->{all_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST)");
+
+ if ($ctx->{NOPROTO} eq "NO") {
+ push(@{$self->{proto_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST\)");
+ }
+
unless (defined($ctx->{INSTALLDIR})) {
} elsif ($ctx->{INSTALLDIR} eq "SBINDIR") {
push (@{$self->{sbin_progs}}, "$installdir/$ctx->{BINARY}");
@@ -447,13 +477,15 @@
$self->output("SHARED_LIBS = " . array2oneperline($self->{shared_libs}) . "\n");
$self->output("PUBLIC_HEADERS = " . array2oneperline($self->{headers}) . "\n");
$self->output("PC_FILES = " . array2oneperline($self->{pc_files}) . "\n");
+ $self->output("ALL_OBJS = " . array2oneperline($self->{all_objs}) . "\n");
+ $self->output("PROTO_OBJS = " . array2oneperline($self->{proto_objs}) . "\n");
$self->_prepare_mk_files();
if ($self->{developer}) {
$self->output(<<__EOD__
-#-include \$(_ALL_OBJS_OBJ_LIST:.o=.d)
+#-include \$(ALL_OBJS:.o=.d)
IDL_FILES = \$(wildcard librpc/idl/*.idl)
\$(patsubst librpc/idl/%.idl,librpc/gen_ndr/ndr_%.c,\$(IDL_FILES)) \\
\$(patsubst librpc/idl/%.idl,librpc/gen_ndr/ndr_\%_c.c,\$(IDL_FILES)) \\
Modified: branches/SAMBA_4_0/source/build/smb_build/output.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/output.pm 2005-12-23 13:01:26 UTC (rev 12449)
+++ branches/SAMBA_4_0/source/build/smb_build/output.pm 2005-12-23 13:02:52 UTC (rev 12450)
@@ -97,23 +97,7 @@
my $depend = shift;
my $part;
- $depend->{PROTO} = {
- OUTPUT_TYPE => "OBJLIST",
- TYPE => "PROTO",
- NAME => "PROTO",
- OBJ_LIST => []
- };
-
- $depend->{ALL_OBJS} = {
- OUTPUT_TYPE => "OBJLIST",
- TYPE => "",
- NAME => "ALL_OBJS",
- OBJ_LIST => []
- };
-
foreach $part (values %{$depend}) {
- next if $part->{NAME} eq "PROTO";
- next if $part->{NAME} eq "ALL_OBJS";
next if not defined($part->{OUTPUT_TYPE});
# Combine object lists
@@ -133,12 +117,6 @@
generate_shared_library($part) if $part->{OUTPUT_TYPE} eq "SHARED_LIBRARY";
generate_static_library($part) if $part->{OUTPUT_TYPE} eq "STATIC_LIBRARY";
-
- push(@{$depend->{ALL_OBJS}->{OBJ_LIST}}, @{$part->{OBJ_LIST}}) if (defined(@{$part->{OBJ_LIST}}));
-
- if ((not defined ($part->{NOPROTO})) or ($part->{NOPROTO} eq "NO")) {
- push(@{$depend->{PROTO}->{OBJ_LIST}}, @{$part->{OBJ_LIST}}) if (defined(@{$part->{OBJ_LIST}}));
- }
}
foreach $part (values %{$depend}) {
Modified: branches/SAMBA_4_0/source/main.mk
===================================================================
--- branches/SAMBA_4_0/source/main.mk 2005-12-23 13:01:26 UTC (rev 12449)
+++ branches/SAMBA_4_0/source/main.mk 2005-12-23 13:02:52 UTC (rev 12450)
@@ -195,12 +195,12 @@
@echo "You need to rerun ./autogen.sh and ./configure"
@/bin/false
-include/proto.h: $(PROTO_PROTO_OBJ_LIST:.o=.c)
+include/proto.h: $(PROTO_OBJS:.o=.c)
@-rm -f include/includes.h.gch
@echo "Creating include/proto.h"
@$(PERL) script/mkproto.pl --public-define=_PROTO_H_ \
--public=include/proto.h --private=include/proto.h \
- $(PROTO_PROTO_OBJ_LIST)
+ $(PROTO_OBJS)
proto: include/proto.h
pch: include/config.h \
Modified: branches/SAMBA_4_0/source/torture/config.mk
===================================================================
--- branches/SAMBA_4_0/source/torture/config.mk 2005-12-23 13:01:26 UTC (rev 12449)
+++ branches/SAMBA_4_0/source/torture/config.mk 2005-12-23 13:02:52 UTC (rev 12450)
@@ -280,6 +280,6 @@
CFLAGS="$(CFLAGS) $(GCOV_FLAGS)" \
LD_FLAGS="$(LD_FLAGS) $(GCOV_FLAGS)" \
LIBS="$(LIBS) $(GCOV_LIBS)"
- for I in $(sort $(dir $(_ALL_OBJS_OBJ_LIST))); \
+ for I in $(sort $(dir $(ALL_OBJS))); \
do $(GCOV) -p -o $$I $$I/*.c; \
done
More information about the samba-cvs
mailing list