# Makefile for the TX-0 Reincarnate Problem # # File: Makefile # Date: Fri Oct 12 06:05:39 EDT 2007 # # See demonstration Makefile for documentation. # The program for this problem is named: P = tx0r # The programming language in which the problem is # written has the extension: E = .tx0r # The simulator program for this programming language # is named: S = tx0r_simulator # The file from which this simulator program is # compiled is: F = tx0r_simulator.cc .SUFFIXES: .SUFFIXES: $E default: $P.out # We cannot list $S as a prerequisite because then # $F would be required by the above rule, and it # is not available in the contestants working directory. # But for testing purpose we do need to make $S if # $F exists. # $E: @if test -r $F; then make $S; fi rm -f $* core core.[0-9]* echo >$* '#!/bin/sh' echo >>$* "exec ./$S \$$* $*$E" chmod a+rx $* chmod a+r $*$E # Contestant's simulator, without debugging info. # $S: $F rm -f $S g++ -o $S $F -lm chmod a+x $S # Judge's simulator with debugging info. # judges_$S: $F rm -f judges_$S g++ -g -o judges_$S -DJUDGE $F -lm chmod a+x judges_$S $P.out: $P $P.in rm -f $P.out core core.[0-9]* chmod a+x . hpcm_sandbox -cputime 60 \ -datasize 4m \ -stacksize 4m \ -filesize 50k \ -tee $P.out \ $P \ <$P.in $P.debug: $P $P.in rm -f $P.debug core core.[0-9]* chmod a+x . hpcm_sandbox -cputime 60 \ -datasize 4m \ -stacksize 4m \ -filesize 4m \ -tee $P.debug \ $P -debug \ <$P.in debug: $P.debug submit: $P.out hpcm_submit $P $P$E in-submit: $P.out hpcm_submit -in $P $P$E inout-submit: $P.out hpcm_submit -inout $P $P$E solution-submit: $P.out hpcm_submit -solution $P $P$E # We must not remove simulator from the contestant's # directory which has no $F to remake it. # clean: rm -f $P *.class core core.[0-9]* \ *.out *.debug *.fout *.jout *.jfout \ $P.fas $P.lib make_$P_*input @if test -r $F; \ then echo rm -f $S judges_$S; \ rm -f $S judges_$S; fi # Author: walton@deas.harvard.edu # # The authors have placed this file in the public # domain; they make no warranty and accept no liability # for this file. # # RCS Info (may not be true date or author): # # $Author: walton $ # $Date: 2007/10/12 10:05:50 $ # $RCSfile: Makefile,v $ # $Revision: 1.4 $