svn commit: samba r7315 - in
branches/SAMBA_4_0/source/build/smb_build: .
jelmer at samba.org
jelmer at samba.org
Mon Jun 6 01:22:59 GMT 2005
Author: jelmer
Date: 2005-06-06 01:22:57 +0000 (Mon, 06 Jun 2005)
New Revision: 7315
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7315
Log:
Add support for custom makefile targets, e.g.:
[TARGET::FOOBAR]
CMD = make bla
Modified:
branches/SAMBA_4_0/source/build/smb_build/config_mk.pm
branches/SAMBA_4_0/source/build/smb_build/input.pm
branches/SAMBA_4_0/source/build/smb_build/makefile.pm
Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/config_mk.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/config_mk.pm 2005-06-06 00:14:23 UTC (rev 7314)
+++ branches/SAMBA_4_0/source/build/smb_build/config_mk.pm 2005-06-06 01:22:57 UTC (rev 7315)
@@ -24,7 +24,8 @@
"MINOR_VERSION" => "string",
"RELEASE_VERSION" => "string",
"ENABLE" => "bool",
- "TARGET_CFLAGS" => "list"
+ "TARGET_CFLAGS" => "list",
+ "CMD" => "string"
);
###########################################################
Modified: branches/SAMBA_4_0/source/build/smb_build/input.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/input.pm 2005-06-06 00:14:23 UTC (rev 7314)
+++ branches/SAMBA_4_0/source/build/smb_build/input.pm 2005-06-06 01:22:57 UTC (rev 7315)
@@ -116,6 +116,18 @@
$lib->{OUTPUT_TYPE} = "SHARED_LIBRARY";
}
+sub check_target($$)
+{
+ my $INPUT = shift;
+ my $bin = shift;
+
+ if (!defined($bin->{CMD})) {
+ print "CMD not defined for target!\n";
+ }
+
+ $bin->{OUTPUT_TYPE} = "CUSTOM";
+}
+
sub check_binary($$)
{
my $INPUT = shift;
@@ -173,6 +185,7 @@
check_module($INPUT, $part) if ($part->{TYPE} eq "MODULE");
check_library($INPUT, $part) if ($part->{TYPE} eq "LIBRARY");
check_binary($INPUT, $part) if ($part->{TYPE} eq "BINARY");
+ check_target($INPUT, $part) if ($part->{TYPE} eq "TARGET");
#FIXME: REQUIRED_LIBRARIES needs to go
if (defined($part->{REQUIRED_LIBRARIES})) {
Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===================================================================
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2005-06-06 00:14:23 UTC (rev 7314)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm 2005-06-06 01:22:57 UTC (rev 7315)
@@ -472,6 +472,12 @@
return $output;
}
+sub _prepare_custom_rule($)
+{
+ my $ctx = shift;
+ return "$ctx->{NAME}:\n\t$ctx->{CMD}\n";
+}
+
sub _prepare_proto_rules()
{
my $output = "";
@@ -702,10 +708,12 @@
foreach my $key (values %{$depend}) {
next if not defined $key->{OUTPUT_TYPE};
+
($output .= _prepare_objlist_rule($key)) if $key->{OUTPUT_TYPE} eq "OBJLIST";
($output .= _prepare_static_library_rule($key)) if $key->{OUTPUT_TYPE} eq "STATIC_LIBRARY";
($output .= _prepare_shared_library_rule($key)) if $key->{OUTPUT_TYPE} eq "SHARED_LIBRARY";
($output .= _prepare_binary_rule($key)) if $key->{OUTPUT_TYPE} eq "BINARY";
+ ($output .= _prepare_custom_rule($key) ) if $key->{TYPE} eq "TARGET";
}
my $idl_ctx;
More information about the samba-cvs
mailing list