summaryrefslogtreecommitdiff
path: root/source4/build/smb_build
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-06-05 22:30:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:40 -0500
commit16eaadc67c12e34d4f6a2aa613e5055dea1bdefa (patch)
tree4b97a467a21d096a54774ec1522a8fd934ded43c /source4/build/smb_build
parentb1381947bf5379b54ed9ee118d48f77f2931c253 (diff)
downloadsamba-16eaadc67c12e34d4f6a2aa613e5055dea1bdefa.tar.gz
samba-16eaadc67c12e34d4f6a2aa613e5055dea1bdefa.tar.bz2
samba-16eaadc67c12e34d4f6a2aa613e5055dea1bdefa.zip
r7310: Support TARGET_CFLAGS thru recursive make
(This used to be commit 2fd997b12aa06983a614bfadca9e5f896a88b2ac)
Diffstat (limited to 'source4/build/smb_build')
-rw-r--r--source4/build/smb_build/config_mk.pm2
-rw-r--r--source4/build/smb_build/makefile.pm36
2 files changed, 14 insertions, 24 deletions
diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm
index 74ba8f2c2e..d298fe68ee 100644
--- a/source4/build/smb_build/config_mk.pm
+++ b/source4/build/smb_build/config_mk.pm
@@ -24,7 +24,7 @@ my %attribute_types = (
"MINOR_VERSION" => "string",
"RELEASE_VERSION" => "string",
"ENABLE" => "bool",
- "TARGET_CFLAGS" => "string"
+ "TARGET_CFLAGS" => "list"
);
###########################################################
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index 68d4f23b1e..11d1693ce7 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -97,20 +97,6 @@ SHLD_FLAGS=@LDSHFLAGS@ @LDFLAGS@ -Lbin
__EOD__
}
-
-#############################
-# return makefile fragment for
-# target specific rules
-sub add_target_flags($$)
-{
- my $ctx = shift;
- my $name = shift;
-
- return "" unless ($ctx->{TARGET_CFLAGS});
- return "$name: TARGET_CFLAGS = $ctx->{TARGET_CFLAGS}\n";
-}
-
-
sub _prepare_default_rule($)
{
my $ctx = shift;
@@ -367,8 +353,6 @@ library_$ctx->{NAME}: basics bin/lib$ctx->{LIBRARY_NAME}
__EOD__
-$output .= add_target_flags($ctx, "library_" . $ctx->{NAME});
-
return $output;
}
@@ -376,9 +360,19 @@ sub _prepare_objlist_rule($)
{
my $ctx = shift;
my $tmpdepend = array2oneperline($ctx->{DEPEND_LIST});
- return "
-$ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST = $tmpdepend\n
-$ctx->{TYPE}_$ctx->{NAME}: \$($ctx->{TYPE}_$ctx->{NAME}_OBJS) \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST)\n";
+ my $output;
+
+ $output = "$ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST = $tmpdepend\n";
+
+ $output .= "$ctx->{TYPE}_$ctx->{NAME}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST)";
+
+ if (defined ($ctx->{TARGET_CFLAGS})) {
+ $output .= "\n\t@\$(MAKE) \$($ctx->{TYPE}_$ctx->{NAME}_OBJS) TARGET_CFLAGS=\"" . join(' ', @{$ctx->{TARGET_CFLAGS}}) . "\"\n";
+ } else {
+ $output .=" \$($ctx->{TYPE}_$ctx->{NAME}_OBJS)\n";
+ }
+
+ return $output;
}
###########################################################
@@ -428,8 +422,6 @@ library_$ctx->{NAME}: basics $ctx->{TARGET}
__EOD__
-$output .= add_target_flags($ctx, "library_" . $ctx->{NAME});
-
return $output;
}
@@ -477,8 +469,6 @@ binary_$ctx->{BINARY}: basics bin/$ctx->{BINARY}
__EOD__
-$output .= add_target_flags($ctx, "binary_" . $ctx->{BINARY});
-
return $output;
}