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 -O2 -o/, $basename, $name when 'C';
13 exec 'g++', qw
/-DONLINE_JUDGE -std=gnu++11 -Wall -Wextra -O2 -o/, $basename, $name when 'CPP';
15 system 'gmcs', '-d:ONLINE_JUDGE', $name and die "gmcs failed: errno=$! return=$?";
16 rename "$basename.exe", $basename;
17 chmod 0755, $basename;
19 exec 'gmcs', '-d:ONLINE_JUDGE', $name when 'MONO';
21 system 'javac', $name and die "javac failed: errno=$! return=$?";
22 system 'jar', 'cfe', $basename, $basename, "$basename.class" and die "jar failed: errno=$! return=$?";
23 chmod 0755, $basename;
26 exec 'fpc', qw
/-dONLINE_JUDGE -O2/, $name when 'PASCAL';
27 exec 'go', qw
/build -compiler gc/, $name when 'GOLANG';
28 exec 'go', qw
/build -compiler gccgo/, $name, when 'GCCGO';
29 exec 'ghc', qw
/-DONLINE_JUDGE -Wall -O2 -o/, $basename, $name when 'HASKELL';
31 when ([qw
/PERL PYTHON/]){
33 open OUT
, '>', $basename;
34 print OUT
"#!/usr/bin/perl\n" if $_ eq 'PERL';
35 print OUT
"#!/usr/bin/python\n" if $_ eq 'PYTHON';
39 chmod 0755, $basename;
51 gruntmaster-compile - Gruntmaster 6000 compiler frontend
55 gruntmaster-compile CPP file.cpp
56 gruntmaster-compile JAVA file.java
60 gruntmaster-compile is a very simple frontend to various comilers. 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.
62 Compile commands for each format:
68 gcc -DONLINE_JUDGE -std=gnu11 -Wall -Wextra -O2 -o $output $input
72 g++ -DONLINE_JUDGE -std=gnu++11 -fabi-version=6 -Wall -Wextra -O2 -o $output $input
76 gmcs -d:ONLINE_JUDGE $input
84 fpc -dONLINE_JUDGE -O2 $input
88 go build -compiler gc $input
92 go build -compiler gccgo $input
96 ghc -DONLINE_JUDGE -Wall -O2 -o $output $input
110 Marius Gavrilescu E<lt>marius@ieval.roE<gt>
112 =head1 COPYRIGHT AND LICENSE
114 Copyright (C) 2014 by Marius Gavrilescu
116 This program is free software: you can redistribute it and/or modify
117 it under the terms of the GNU Affero General Public License as published by
118 the Free Software Foundation, either version 3 of the License, or
119 (at your option) any later version.
This page took 0.026945 seconds and 5 git commands to generate.