File: compile.pl

package info (click to toggle)
libdate-pcalc-perl 6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 1,436 kB
  • ctags: 540
  • sloc: perl: 16,700; ansic: 3,080; sh: 14; makefile: 4
file content (38 lines) | stat: -rwxr-xr-x 1,096 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!perl

###############################################################################
##                                                                           ##
##    Copyright (c) 1998 - 2009 by Steffen Beyer.                            ##
##    All rights reserved.                                                   ##
##                                                                           ##
##    This program is free software; you can redistribute it                 ##
##    and/or modify it under the same terms as Perl itself.                  ##
##                                                                           ##
###############################################################################

use Config;

$self = $0;
$self =~ s!^.*/!!;

unless (@ARGV)
{
    die "Usage:  perl  $self  <main>[.c]  [ <other.c> ]*\n";
}

$main = shift;
$main =~ s/\.c$//;

unless (-f "$main.c")
{
    die "$self: file '$main.c' does not exist!\n";
}

$cc = $Config{'cc'};

$flags = $Config{'ccflags'};

@ARGV = map("\"$_\"",@ARGV);

system("$cc $flags -o $main $main.c @ARGV");