[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-sparse
Subject:    cgcc -- run checker, then compiler
From:       terra () gnome ! org (Morten Welinder)
Date:       2004-07-29 15:56:02
Message-ID: 20040729155602.7A3C71422D53 () darter ! rentec ! com
[Download RAW message or body]


FYI,

this little script which I call cgcc is useful for checking projects that
does seem compile right when $CC fails to create .o files.  It runs first
the checker and then the compiler.  It's in perl for no particular good
reason.

You could even run in this mode normally if you don't mind that your
compiles take extra time.  Just do

    make CC=/scratch/welinder/sparse/cgcc

or something like that.

Morten



#!/usr/bin/perl -w
# -----------------------------------------------------------------------------

my $cc = $ENV{'REAL_CC'} || 'cc';
my $check = $ENV{'CHECK'} || 'check';

# Look for a .c file.  We don't want to the checker on .o or .so files
# in the link run.  (This simplistic check knows nothing about options
# with arguments, but it seems to do the job.)
my $seen_a_c_file = 0;
foreach (@ARGV) {
    if (/^[^-].*\.c/) {
	$seen_a_c_file = 1;
	last;
    }
}

if ($seen_a_c_file) {
    system ($check, @ARGV);
}

exec ($cc, @ARGV);
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic