# ***** this makefile will only work properly with gnu make ***** # it is a very good idea to install makedepend and run "make make" # NOTE: makedepend often issues lots of warnings with ANSI C++ files # but it will put all the dependencies you need at the bottom of this file # This Makefile links with the X-windows, OpenGL libraries, and Glut library # These libraries are not needed until p6. They are included here to # encourage you to make sure they are properly installed on your system # early in the semester. CXX = g++ CPPFLAGS = -Wall -pedantic -g # uncomment the lines for the machine you are compiling on # windows/cygwin libraries (comment out if not using windows/cygwin) #LIBS = -lfl -lopengl32 -lglut32 -lglu32 # linux/UNIX libraries (comment out next two lines if not using linux/unix) LIBDIRS = -L/usr/X11R6/lib # some linux versions don't need/like the -lX11 and -lglut #LIBS = -lGL -lGLU -lm -lfl LIBS = -lX11 -lglut -lGL -lGLU -lm -lfl # OS X (comment out next two lines if not using OSX) # LIBS = -framework GLUT -framework OpenGL -lobjc # OSX = -D OSX C++SRC = parser.cpp error.cpp gpl_assert.cpp C++OBJ = parser.o error.o gpl_assert.o parser: y.tab.o lex.yy.o $(C++OBJ) g++ -g -o parser y.tab.o lex.yy.o $(C++OBJ) $(LIBDIRS) $(LIBS) y.tab.c y.tab.h: expr.y bison -vyd expr.y y.tab.o: y.tab.c $(CXX) $(CPPFLAGS) -c y.tab.c lex.yy.c: expr.l flex expr.l lex.yy.o: lex.yy.c y.tab.h $(CXX) $(CPPFLAGS) -c lex.yy.c make: makedepend $(C++SRC) y.tab.c lex.yy.c expr.l expr.y @echo "************************************************************" @echo "************************************************************" @echo "************************************************************" @echo "It is \"normal\" for makedepend to generate lots of errors" @echo "If the errors have to do with ANSI C++ include files, ignore them" @echo "************************************************************" clean: rm -f $(C++OBJ) parser lex.yy.c lex.yy.o \ y.output y.tab.h y.tab.c y.tab.o \ *.stackdump Makefile.bak # Makedepend will fill in the correct dependencies at the end of this # file when you make "make": $ make make # The following lines were (or will be) generated by makedepend # DO NOT DELETE error.o: you_have_not_typed_make_make_yet