diff --git a/Makefile b/Makefile index bcd787624f3f5c66702ebc95c95fda0e31a039be..0e01ed072947f300edcb66947f24dc2d94139fad 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CC = g++ CFLAGS = -Wall EXENAME = monad -OBJS = $(EXENAME).o util.o monad_shared.o +OBJS = $(EXENAME).o help.o util.o monad_shared.o IDFILE = .monadid OPTIMIZE = off @@ -17,17 +17,22 @@ endif all: $(EXENAME) $(IDFILE) $(IDFILE): - echo -e 'This file is used for $(EXENAME) directory identification\n$(EXENAME) Build Date:' `date`> $(IDFILE) + echo -e 'This file is used for $(EXENAME) directory identification\n$(EXENAME) Build Date:' `date`> $(IDFILE) $(EXENAME): $(OBJS) $(IDFILE) $(CC) $(CFLAGS) $(OBJS) -o $@ +help.cpp: $(wildcard *.h) README.cpp + +README.cpp: README.txt + sed -e 's/"/\\"/g' -e 's/^/ << "/' -e 's/$$/" << endl/' README.txt > README.cpp + .cpp.o: $(wildcard *.h) $(CC) $(CFLAGS) -c $(@:.o=.cpp) -o $@ .PHONY: clean clean: - rm -f *.o $(EXENAME) $(wildcard $(EXENAME)$(EXENAME)*) $(IDFILE) + rm -f *.o README.cpp $(EXENAME) $(IDFILE) $(wildcard $(EXENAME)$(EXENAME)*) .PHONY: clean.sh clean.sh: $(EXENAME) diff --git a/monad.cpp b/monad.cpp index 9d8da779ff157f2a4dd4c55f2b7ac7ad3683882c..08b82a359c29283ea86456021ed348210d764c48 100755 --- a/monad.cpp +++ b/monad.cpp @@ -2,28 +2,11 @@ // For illinois.edu CS 225 spring 2011 // By Jack Toole -#include <iostream> -#include <fstream> -#include <map> -#include <sstream> -#include <stdlib.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <time.h> -#include <unistd.h> -#include <vector> - -#include "util.h" -#include "monad_shared.h" - -using namespace std; -using namespace util; -using namespace monad_shared; +#include "monad.h" namespace monad { void find_base_dir(const char * argv0); -void printHelp(); void processArgs(int argc, char ** argv); void copyRequiredFiles(); void getLibs(const vector<string> & libs); @@ -279,37 +262,6 @@ void monad::find_base_dir(const char * argv0) } -void monad::printHelp() -{ - cout << "Usage: monad ASSIGNMENT [solution]" << endl - << "Runs the tests for ASSIGNMENT (mp1, lab01, ...)" << endl - << "\'../ASSIGNMENT/\' must exist" << endl - << "If \'../ASSIGNMENT_tests/\' or any necessary library directories do not exist, these will be downloaded to ./ from SVN" << endl << endl - << "monad settings and individual test settings are stored in config.ini files" << endl - << "The following options are available for monad's ./config.ini:" << endl - << "[SVN Root]" << endl - << "; svn base url here (http://.../cs225/)" << endl - << "[Monad Files]" << endl - << "; Any files to be copied from monad ./ to ./ASSIGNMENT/ testing directory" << endl - << "; By default, proxy.cpp is used to run test cases:" << endl - << "proxy.cpp" << endl << endl - << "The following options are available for individual tests' ../ASSIGNMENT_tests/config.ini:" << endl - << "[Required Files]" << endl - << "; Any files that must be copied from the ../ASSIGNMENT directory" << endl - << "main.cpp" << endl - << "[Testing Files]" << endl - << "; Any files that must be copied from ../ASSIGNMENT_tests" << endl - << "; By default, unit_tests.cpp contains the test cases" << endl - << "unit_tests.cpp" << endl - << "[Libraries]" << endl - << "; Any external library folders to be present in the same directory as the" << endl - << "; testing directory. These should be mirrored in [SVN Root]/_public/" << endl - << "; The 'testutil' library in this directory is also available" << endl - << "EasyBMP" << endl - << endl; -} - - void monad::copyRequiredFiles() { // Clear out the temp testing folder