]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - make/unit-cc.pl
Move dependency tracking from ./configure to Makefile
[user/henk/code/inspircd.git] / make / unit-cc.pl
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4 BEGIN { push @INC, '..'; }
5 use make::configure;
6
7 my $file = shift;
8 my $verbose;
9
10 if ($file =~ /^-/) {
11         $_ = $file;
12         $file = shift;
13         $verbose = /v/;
14 }
15
16 my $out = shift;
17
18 my $cflags = nopedantic($file) ? $ENV{NICEFLAGS} : $ENV{FLAGS};
19 $cflags .= ' ' . getcompilerflags($file);
20
21 my $flags;
22 if ($out =~ /\.so$/) {
23         $flags = join ' ', $cflags, $ENV{PICLDFLAGS}, getlinkerflags($file);
24 } else {
25         $flags = "$cflags -c";
26 }
27
28 my $execstr = "$ENV{RUNCC} $flags -o $out $file";
29 print "$execstr\n" if $verbose;
30 exec $execstr;
31 exit 1;