Add repository to META.yml
[gruntmaster-daemon.git] / gruntmaster-compile
CommitLineData
da905f9e
MG
1#!/usr/bin/perl -w
2use v5.14;
3no if $] > 5.017011, warnings => 'experimental::smartmatch';
4
9577371b
MG
5use File::Copy qw/copy/;
6
da905f9e
MG
7my ($format, $basename, $name) = @ARGV;
8my $ret = fork // die $!;
9if ($ret) {
9577371b
MG
10 $SIG{ALRM} = sub {kill KILL => $ret};
11 alarm 5;
12 wait;
13 exit $? >> 8
da905f9e 14} else {
9577371b
MG
15 given ($format){
16 exec 'gcc', qw/-DONLINE_JUDGE -std=gnu11 -Wextra -O2 -o/, $basename, $name when 'C';
17 exec 'g++', qw/-DONLINE_JUDGE -std=gnu++11 -fabi-version=6 -Wextra -O2 -o/, $basename, $name when 'CPP';
18 exec 'gmcs', '-d:ONLINE_JUDGE', $name when 'MONO';
19 exec 'javac', $name when 'JAVA';
20 exec 'fpc', qw/-dONLINE_JUDGE -O2 -n/, $name when 'PASCAL';
21 copy $name, $basename when ['PERL', 'PYTHON']
22 }
da905f9e 23}
This page took 0.025735 seconds and 4 git commands to generate.