File: compile.pl

package info (click to toggle)
libdate-calc-perl 4.2-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 584 kB
  • ctags: 171
  • sloc: perl: 3,382; ansic: 1,972; makefile: 56; sh: 54
file content (38 lines) | stat: -rw-r--r-- 1,096 bytes parent folder | download | duplicates (2)
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 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");