# Makefile for Advanced Models and Programs F2007 Assignment 7 # By Martin Kjeldsen 2007-03-14 ### DEFINES ### # This assumes that mono and gmcs are in path (both from the Mono project) # Also assumes that Scanner.frame and Parser.frame are in the # same directory and are not changed PARSER = Parser.cs SCANNER = Scanner.cs MACHINE_SOURCE = Machine.cs EXPRESSIONS_SOURCE = Expressions.cs PARSER_SOURCE = Expressions.ATG RUNNER = Expressions.exe MACHINE_RUNNER = Machine.exe COMPILED_PROGRAM = a.out TEST_FILE = test # this should be changed to whatever the name of test file is ### TARGETS ### # run TEST_FILE using the machine and the compiled source run: $(COMPILED_PROGRAM) $(MACHINE_RUNNER) mono $(MACHINE_RUNNER) $(COMPILED_PROGRAM) # to run the TEST_FILE using Eval eval: $(RUNNER) mono $(RUNNER) $(TEST_FILE) run # check TEST_FILEs types check: $(RUNNER) mono $(RUNNER) $(TEST_FILE) check # compile the TEST_FILE. does not run anything besides the compile process compile: $(COMPILED_PROGRAM) $(PARSER): $(PARSER_SOURCE) mono Coco.exe -namespace Expressions $(PARSER_SOURCE) $(SCANNER): $(PARSER) $(RUNNER): $(SCANNER) $(PARSER) $(EXPRESSIONS_SOURCE) gmcs $(EXPRESSIONS_SOURCE) $(SCANNER) $(PARSER) $(COMPILED_PROGRAM): $(RUNNER) $(TEST_FILE) mono $(RUNNER) $(TEST_FILE) compile $(MACHINE_RUNNER): $(MACHINE_SOURCE) gmcs $(MACHINE_SOURCE) clean: @rm -f $(PARSER) @rm -f $(SCANNER) @rm -f $(PARSER).old @rm -f $(SCANNER).old @rm -f $(RUNNER) @rm -f $(MACHINE_RUNNER) @rm -f $(COMPILED_PROGRAM)