From 1ac5c35ed9bf5f557b8f42eee9c392af353430fe Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 23 Dec 2005 13:02:52 +0000 Subject: r12450: 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. (This used to be commit a4088ccc704f1338c040c53596ff606cc1651d03) --- source4/build/smb_build/makefile.pm | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'source4/build/smb_build/makefile.pm') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 6aa3e02e5c..b7a6ace404 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -247,6 +247,12 @@ sub SharedLibrary($$) $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 @@ sub MergedObj($$) $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 @@ sub ObjList($$) 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 @@ sub StaticLibrary($$) $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 @@ sub Binary($$) $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 @@ sub write($$) $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)) \\ -- cgit