X-Git-Url: http://git.ieval.ro/?p=gruntmaster-daemon.git;a=blobdiff_plain;f=gruntmaster-compile;h=adf2149705ee174356ed7d1912d5c6fbac64acd9;hp=794b514b63edb71c5cb5c13f1c52980bb21c67d5;hb=0220f51aca25f4ca5953c73581381fc8161b0719;hpb=6d1f2d942e383e6f5acb59511caccb425ea8db85 diff --git a/gruntmaster-compile b/gruntmaster-compile index 794b514..adf2149 100755 --- a/gruntmaster-compile +++ b/gruntmaster-compile @@ -11,6 +11,7 @@ my $basename = fileparse $name, qr/\..*/; given ($format){ exec 'gcc', qw/-DONLINE_JUDGE -std=gnu11 -Wall -Wextra -lm -O2 -o/, $basename, $name when 'C'; exec 'g++', qw/-DONLINE_JUDGE -std=gnu++11 -Wall -Wextra -lm -O2 -o/, $basename, $name when 'CPP'; + when ('MONO') { system 'gmcs', '-d:ONLINE_JUDGE', $name and die "gmcs failed: errno=$! return=$?"; rename "$basename.exe", $basename; @@ -29,16 +30,27 @@ given ($format){ exec 'go', qw/build -compiler gccgo/, $name, when 'GCCGO'; exec 'ghc', qw/-DONLINE_JUDGE -Wall -O2 -o/, $basename, $name when 'HASKELL'; exec 'rustc', qw/-O -o/, $basename, $name when 'RUST'; + exec 'obc', qw/-x -o/, $basename, $name when 'OBERON'; + exec 'ocamlc', qw/-o/, $basename, $name when 'OCAML'; + exec 'dmd', qw/-version=ONLINE_JUDGE -O -release -inline -noboundscheck/, $name when 'D'; - when ([qw/GOLFSCRIPT JULIA PERL PYTHON RUBY SBCL/]){ + when ('BRAINFUCK') { + system 'bfc', $name and die "bfc failed: errno=$! return=$?"; + rename "a.out", $basename; + chmod 0755, $basename; + exit + } + + when ([qw/GOLFSCRIPT JULIA PERL PHP PYTHON RUBY SBCL/]){ open IN, '<', $name; open OUT, '>', $basename; - print OUT "#!/usr/bin/golfscript\n" if $_ eq 'GOLFSCRIPT'; - print OUT "#!/usr/bin/julia -O\n" if $_ eq 'JULIA'; - print OUT "#!/usr/bin/perl\n" if $_ eq 'PERL'; - print OUT "#!/usr/bin/python\n" if $_ eq 'PYTHON'; - print OUT "#!/usr/bin/ruby\n" if $_ eq 'RUBY'; - print OUT "#!/usr/bin/sbcl --script\n" if $_ eq 'SBCL'; + print OUT "#!/usr/bin/golfscript\n" if $_ eq 'GOLFSCRIPT'; + print OUT "#!/usr/bin/julia -O\n" if $_ eq 'JULIA'; + print OUT "#!/usr/bin/perl\n" if $_ eq 'PERL'; + print OUT "#!/usr/bin/php -d ONLINE_JUDGE=true\n" if $_ eq 'PHP'; + print OUT "#!/usr/bin/python2.7\n" if $_ eq 'PYTHON'; + print OUT "#!/usr/bin/ruby\n" if $_ eq 'RUBY'; + print OUT "#!/usr/bin/sbcl --script\n" if $_ eq 'SBCL'; print OUT while ; close OUT; close IN; @@ -69,6 +81,10 @@ Compile commands for each format: =over +=item BRAINFUCK + + bfc $input + =item C gcc -DONLINE_JUDGE -std=gnu11 -Wall -Wextra -O2 -o $output $input @@ -105,6 +121,14 @@ Compile commands for each format: ghc -DONLINE_JUDGE -Wall -O2 -o $output $input +=item OCAML + + ocamlc -o $output $input + +=item OBERON + + obc -x -o $output $input + =item RUST rustc -O -o $output $input @@ -113,6 +137,10 @@ Compile commands for each format: cp $input $output +=item PHP + + cp $input $output + =item PYTHON cp $input $output