3be2013133ad5de1bf543d3f6e8cdcb448d45df4
3 no if $] > 5.017011, warnings
=> 'experimental::smartmatch';
5 use File
::Copy qw
/copy/;
6 use File
::Basename qw
/fileparse/;
8 my ($format, $name) = @ARGV;
9 my $basename = fileparse
$name, qr/\..*/;
12 exec 'gcc', qw
/-DONLINE_JUDGE -std=gnu11 -Wall -Wextra -lm -O2 -o/, $basename, $name when 'C';
13 exec 'g++', qw
/-DONLINE_JUDGE -std=gnu++11 -Wall -Wextra -lm -O2 -o/, $basename, $name when 'CPP';
16 system 'gmcs', '-d:ONLINE_JUDGE', $name and die "gmcs failed: errno=$! return=$?";
17 rename "$basename.exe", $basename;
18 chmod 0755, $basename;
20 exec 'gmcs', '-d:ONLINE_JUDGE', $name when 'MONO';
22 unlink $_ for <*.class>;
23 system 'javac', $name and die "javac failed: errno=$! return=$?";
24 system 'jar', 'cfe', $basename, $basename, <*.class> and die "jar failed: errno=$! return=$?";
25 chmod 0755, $basename;
28 exec 'fpc', qw
/-dONLINE_JUDGE -O2/, $name when 'PASCAL';
29 exec 'go', qw
/build -compiler gc/, $name when 'GOLANG';
30 exec 'go', qw
/build -compiler gccgo/, $name, when 'GCCGO';
31 exec 'ghc', qw
/-DONLINE_JUDGE -Wall -O2 -o/, $basename, $name when 'HASKELL';
32 exec 'rustc', qw
/-O -o/, $basename, $name when 'RUST';
33 exec 'obc', qw
/-x -o/, $basename, $name when 'OBERON';
34 exec 'ocamlc', qw
/-o/, $basename, $name when 'OCAML';
35 exec 'dmd', qw
/-version=ONLINE_JUDGE -O -release -inline -noboundscheck/, $name when 'D';
38 system 'bfc', $name and die "bfc failed: errno=$! return=$?";
39 rename "a.out", $basename;
40 chmod 0755, $basename;
44 when ([qw
/GOLFSCRIPT JULIA PERL PHP PYTHON PYTHON3 RUBY SBCL/]){
46 open OUT
, '>', $basename;
47 print OUT
"#!/usr/bin/golfscript\n" if $_ eq 'GOLFSCRIPT';
48 print OUT
"#!/usr/bin/julia -O\n" if $_ eq 'JULIA';
49 print OUT
"#!/usr/bin/perl\n" if $_ eq 'PERL';
50 print OUT
"#!/usr/bin/php -d ONLINE_JUDGE=true\n" if $_ eq 'PHP';
51 print OUT
"#!/usr/bin/python2.7\n" if $_ eq 'PYTHON';
52 print OUT
"#!/usr/bin/python3\n" if $_ eq 'PYTHON3';
53 print OUT
"#!/usr/bin/ruby\n" if $_ eq 'RUBY';
54 print OUT
"#!/usr/bin/sbcl --script\n" if $_ eq 'SBCL';
58 chmod 0755, $basename;
70 gruntmaster-compile - Gruntmaster 6000 compiler frontend
74 gruntmaster-compile CPP file.cpp
75 gruntmaster-compile JAVA file.java
79 gruntmaster-compile is a very simple frontend to various compilers. It takes two arguments: the file format and the file name, and produces a compiled executable. The executable's name is the basename of the input file.
81 Compile commands for each format:
91 gcc -DONLINE_JUDGE -std=gnu11 -Wall -Wextra -O2 -o $output $input
95 g++ -DONLINE_JUDGE -std=gnu++11 -fabi-version=6 -Wall -Wextra -O2 -o $output $input
99 gmcs -d:ONLINE_JUDGE $input
111 fpc -dONLINE_JUDGE -O2 $input
115 go build -compiler gc $input
119 go build -compiler gccgo $input
123 ghc -DONLINE_JUDGE -Wall -O2 -o $output $input
127 ocamlc -o $output $input
131 obc -x -o $output $input
135 rustc -O -o $output $input
153 Marius Gavrilescu E<lt>marius@ieval.roE<gt>
155 =head1 COPYRIGHT AND LICENSE
157 Copyright (C) 2014 by Marius Gavrilescu
159 This program is free software: you can redistribute it and/or modify
160 it under the terms of the GNU Affero General Public License as published by
161 the Free Software Foundation, either version 3 of the License, or
162 (at your option) any later version.
This page took 0.029522 seconds and 4 git commands to generate.