1#!perl 2 3############################################################################### 4## ## 5## Copyright (c) 1998 - 2009 by Steffen Beyer. ## 6## All rights reserved. ## 7## ## 8## This program is free software; you can redistribute it ## 9## and/or modify it under the same terms as Perl itself. ## 10## ## 11############################################################################### 12 13use Config; 14 15$self = $0; 16$self =~ s!^.*/!!; 17 18unless (@ARGV) 19{ 20 die "Usage: perl $self <main>[.c] [ <other.c> ]*\n"; 21} 22 23$main = shift; 24$main =~ s/\.c$//; 25 26unless (-f "$main.c") 27{ 28 die "$self: file '$main.c' does not exist!\n"; 29} 30 31$cc = $Config{'cc'}; 32 33$flags = $Config{'ccflags'}; 34 35@ARGV = map("\"$_\"",@ARGV); 36 37system("$cc $flags -o $main $main.c @ARGV"); 38 39