aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishckin@gmail.com>2008-08-26 00:33:39 +0300
committerJosh Triplett <josh@freedesktop.org>2008-08-26 17:42:25 -0700
commit8f208e215a531d2b32aec0428fd5eaa24ae3100b (patch)
tree9b3dd1f11796182ca8e39c893a091a4e636022a5
parentcb08a60a883504a84ced36e1d1e16c93c69bb7e4 (diff)
downloadsparse-8f208e215a531d2b32aec0428fd5eaa24ae3100b.tar.gz
sparse-8f208e215a531d2b32aec0428fd5eaa24ae3100b.tar.xz
sparse-8f208e215a531d2b32aec0428fd5eaa24ae3100b.zip
don't call sparse when called to generate dependencies
I have a situation here when $(CC) is called with -M options with slighly different set of -I/-D/etc arguments, which causes all sorts of funny reports from sparse. Also, this increases the overall build time because every compilation unit if sparsed twice. Signed-off-by: Alexander Shishkin <alexander.shishckin@gmail.com>
-rwxr-xr-xcgcc7
1 files changed, 7 insertions, 0 deletions
diff --git a/cgcc b/cgcc
index 4fab530..89adbed 100755
--- a/cgcc
+++ b/cgcc
@@ -7,6 +7,7 @@ my $check = $ENV{'CHECK'} || 'sparse';
my $m32 = 0;
my $m64 = 0;
my $has_specs = 0;
+my $gendeps = 0;
my $do_check = 0;
my $do_compile = 1;
my $verbose = 0;
@@ -22,6 +23,7 @@ foreach (@ARGV) {
$m32 = 1 if /^-m32$/;
$m64 = 1 if /^-m64$/;
+ $gendeps = 1 if /^-M$/;
if (/^-specs=(.*)$/) {
$check .= &add_specs ($1);
@@ -44,6 +46,11 @@ foreach (@ARGV) {
$check .= $this_arg unless &cc_only_option ($_);
}
+if ($gendeps) {
+ $do_compile = 1;
+ $do_check = 0;
+}
+
if ($do_check) {
if (!$has_specs) {
$check .= &add_specs ('host_arch_specs');