# Makefile for CSCI410 Program 2 # You probably won't need to change this file. # # Useful commands to use with this Makefile: # # gmake getfiles # copies or links necessary assignment files to your current directory. # see comments near the bottom of the file for more details. # Generally you should not make and modify a local copy of the shared # files. # # gmake testparser # creates a parser and links it with a lexical analyzer and a test program # (this will compile the lex. anal. module too if it's not compiled) # # gmake testlexer # creates a lexical analyzer and links it with a test program # # # gmake submit # submit your completed PA2 to the course account # # # Changed 1/25/05 by CMB # Changed name of ast.cc to astDump.cc # Fixed some missing .h dependencies ESPRHOME= /auto/home-scf-05/csci410/espresso CXX=g++ CXXFLAGS= -g -Wall -Wno-unused # flex flags FFLAGS= -oespresso-lex.cc # bison flags BFLAGS = -d -v --debug # objs for testparser POBJS = testparser.o espresso-parse.o astDump.o StringTab.o espresso-lex.o printToken.o #objs for testlexer LOBJS = testlexer.o espresso-lex.o printToken.o StringTab.o testparser: $(POBJS) $(CXX) $(CXXFLAGS) $(POBJS) -o $@ StringTab.o: StringTab.h testparser.o: ast.h parser.h astDump.o: ast.h parser.h StringTab.h espresso-parse.o: ast.h parser.h printToken.h StringTab.h espresso-lex.o: espresso.tab.h parser.h lexer.h StringTab.h testlexer.o: StringTab.h espresso.tab.h printToken.h lexer.h parser.h espresso-parse.cc espresso.tab.h: espresso.y bison ${BFLAGS} espresso.y mv -f espresso.tab.c espresso-parse.cc printToken.o: printToken.h testlexer: $(LOBJS) $(CXX) $(CXXFLAGS) $(LOBJS) -o $@ espresso-lex.cc: espresso.flex flex $(FFLAGS) espresso.flex # gmake getfiles # Uses shared copies of files for source code you # do not modify. This means if we change the master version, you will # get the change as well. # Makes local copies of the files you will modify. # Safe to use more than once: Does not overwrite any existing # files in your directory with the same name. # If you are on a different architecture than Solaris, you # will need to make local copies of the source code, and compile # them on your machine. # getfiles: -ln -s $(ESPRHOME)/parser/StringTab.h . -ln -s $(ESPRHOME)/parser/StringTab.cc . -ln -s $(ESPRHOME)/parser/printToken.h . -ln -s $(ESPRHOME)/parser/printToken.cc . -ln -s $(ESPRHOME)/parser/lexer.h . -ln -s $(ESPRHOME)/parser/testlexer.cc . -ln -s $(ESPRHOME)/parser/ast.h -ln -s $(ESPRHOME)/parser/astDump.cc -ln -s $(ESPRHOME)/parser/testparser.cc -ln -s $(ESPRHOME)/parser/parser.h . -ln -s $(ESPRHOME)/parser/TestBad.esp . -ln -s $(ESPRHOME)/parser/Makefile . -$(ESPRHOME)/bin/safecopy $(ESPRHOME)/parser/espresso.y . -$(ESPRHOME)/bin/safecopy $(ESPRHOME)/parser/README . -$(ESPRHOME)/bin/safecopy $(ESPRHOME)/parser/Test.esp . ################ SUBMIT RULE ################ ## you will have to change the submit command if you want to ## submit additional files. submit: submit -user csci410 -tag PA2 espresso.y Test.esp README