2 # Copyright (C) 2008, The Perl Foundation.
16 my $PARROT = "../../parrot";
17 my ($incpaths,$libname,$nsname);
19 GetOptions
('help|?' => \
$help,
23 "I=s@" => \
$incpaths) or pod2usage
(2);
24 pod2usage
(1) if $help;
25 pod2usage
(-exitstatus
=> 0, -verbose
=> 2) if $man;
31 my ($volume, $directories, $fileonly) = File
::Spec
->splitpath( $file );
34 my $ofile = mktemp
( $fileonly . "_XXXX");
35 #execit("gcc -x c -fdirectives-only -E $file > $ofile");
36 execit
("gcc -x c -E $file > $ofile");
41 my ( $file, $more_args ) = @_;
42 return execit
("make; $PARROT c99.pbc $more_args $file");
54 $ARGV[0] = 't/spi.c' unless $ARGV[0];
55 $libname = "libexamplelib" unless $libname;
56 $nsname = "CLIB::examplelib" unless $nsname;
58 #$more_args = "--target=parse --libname=fred --nsname=GO::Mojo";
59 $more_args = "--libname=$libname --nsname=$nsname";
60 my $preproc_fn = cc_preprocess
($ARGV[0]);
62 my $parse_tree = dump_parse_tree
($preproc_fn, $more_args);
65 print "$preproc_fn\n";
74 sample - Using nci_gen.pl
78 nci_gen [options] [file ...]
81 -help brief help message
82 -man full documentation
90 Print a brief help message and exits.
94 Prints the manual page and exits.
100 B<nci_gen> will read the given input file c header file and create a pir interface file.