# Makefile for CSCI410 Program 1 # # 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 testlexer # creates a lexical analyzer and links it with a test program # # # gmake submit # submit your completed PA1 to the course account # # CHANGE HISTORY # # MOD 5/31/06 by CMB # added rules for printToken.o and StringTab.o # took out extra dependency for espresso-lex.o # ESPRHOME= /auto/home-scf-05/csci410/espresso ESPRLEXHOME= $(ESPRHOME)/lexer CXX=g++ CXXFLAGS= -g -Wall -Wno-unused # flex flags FFLAGS= -oespresso-lex.cc OBJS = testlexer.o espresso-lex.o printToken.o StringTab.o testlexer: $(OBJS) $(CXX) $(CXXFLAGS) $(OBJS) -o $@ espresso-lex.o: espresso.tab.h parser.h lexer.h StringTab.h espresso-lex.cc: espresso.flex flex $(FFLAGS) espresso.flex testlexer.o: StringTab.h espresso.tab.h printToken.h lexer.h parser.h printToken.o: printToken.h StringTab.o: StringTab.h # 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 $(ESPRLEXHOME)/StringTab.h . -ln -s $(ESPRLEXHOME)/StringTab.cc . -ln -s $(ESPRLEXHOME)/printToken.h . -ln -s $(ESPRLEXHOME)/printToken.cc . -ln -s $(ESPRLEXHOME)/espresso.tab.h . -ln -s $(ESPRLEXHOME)/testlexer.cc . -ln -s $(ESPRLEXHOME)/lexer.h . -ln -s $(ESPRLEXHOME)/parser.h . -ln -s $(ESPRLEXHOME)/Makefile . -$(ESPRHOME)/bin/safecopy $(ESPRLEXHOME)/espresso.flex . -$(ESPRHOME)/bin/safecopy $(ESPRLEXHOME)/README . -$(ESPRHOME)/bin/safecopy $(ESPRLEXHOME)/test.esp . ################ SUBMIT RULE ################ ## you will have to change the submit command if you want to ## submit additional files. e.g. if you change lexer.h ## you will to add it to the list of files below submit: submit -user csci410 -tag PA1 espresso.flex test.esp README