# YOU MUST READ THESE COMMENTS # # In order to use this make file # # Step 1) MACHINE: comment out the machines you are not using # Step 2) FILES: when you create a new file, make sure you list it # Step 3) PHASE: make sure you have the correct phase turned on # # ISSUES: # this makefile will only work properly with gnu make # it is a very good idea to install makedepend and run "make make" # makedepend often issues lots of warnings with ANSI C++ files # but it will still find all the dependencies you need # if you rename the file from Makefile to makefile you must # change the dependency for gpl.o (hard to notice on WinXp & OSX) CXX = g++ CPPFLAGS = -g -Wall -pedantic # ************************************************************************ # STEP 1) MACHINE 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 LIBS = -lX11 -lglut -lGL -lGLU -lm -lfl # older versions of linux might also need -lXi and -lXmu # OS X (comment out these lines if not using OSX) # -- if this doesn't work, replace the directory specified using -I # with the one glut.h lives in (use the locate to find it "$locate glut.h") #LIBS = -framework GLUT -framework OpenGL -lobjc #CPPFLAGS = -g -I/System/Library/Frameworks/GLUT.framework/Versions/A/Headers # ************************************************************************ # STEP 2) FILES # when you add a new .cpp file to your program, put it in the following # list, and also put a .o version in the C++OBJ list # Use a \ at the end of the line to continue on next line C++SRC = error.cpp gpl_assert.cpp gpl.cpp indent.cpp C++OBJ = error.o gpl_assert.o gpl.o indent.o # command to compile the gpl executable gpl: y.tab.o lex.yy.o $(C++OBJ) g++ -g -o gpl y.tab.o lex.yy.o $(C++OBJ) $(LIBDIRS) $(LIBS) # ************************************************************************ # STEP 3) PHASE -- select the correct version of flags for gpl.cpp # # comment out the phases you are NOT working on # gpl.cpp uses three flags (SYMBOL_TABLE, PRINT_SYMBOL_TABLE, GRAPHICS) # to control how it is compiled. You can set any combination of these # flags on the compilation command line. # The following allow you to select the correct combination for # the phase you are currently working on # WARNING: must start command lines with a tab (i.e. before the g++) # Phase 2 & 3: no symbol table, no graphics gpl.o: gpl.cpp Makefile g++ $(CPPFLAGS) -c gpl.cpp -o gpl.o # Phase 4 & 5: symbol table AND print the symbol table, no graphics #gpl.o: gpl.cpp Makefile # g++ -DSYMBOL_TABLE -DPRINT_SYMBOL_TABLE $(CPPFLAGS) -c gpl.cpp # Phase 6, 7 : symbol table AND print the symbol table, with graphics #gpl.o: gpl.cpp Makefile # g++ -DSYMBOL_TABLE -DPRINT_SYMBOL_TABLE -DGRAPHICS $(CPPFLAGS) -c gpl.cpp # Phase 8 : symbol table with graphics #gpl.o: gpl.cpp Makefile # g++ -DSYMBOL_TABLE -DGRAPHICS $(CPPFLAGS) -c gpl.cpp y.tab.c y.tab.h: gpl.y bison -vyd gpl.y y.tab.o: gpl.y bison -vyd gpl.y $(CXX) $(CPPFLAGS) -c y.tab.c lex.yy.c: gpl.l flex gpl.l # the -DYY_NO_UNPUT prevents a warning that yyunput() was defined but not used lex.yy.o: lex.yy.c y.tab.h $(CXX) $(CPPFLAGS) -DYY_NO_UNPUT -c lex.yy.c make: y.tab.c lex.yy.c makedepend $(C++SRC) y.tab.c lex.yy.c gpl.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 "************************************************************" # has .exe for cygwin, but won't affect linux/unix clean: rm -f $(C++OBJ) gpl gpl.exe lex.yy.c lex.yy.o \ y.output y.tab.h y.tab.c y.tab.o \ *.stackdump # The following dependencies were generated by makedepend. # makedepend is a utility that reads all source files and recursively finds # all dependencies. It puts a line below "# DO NOT DELETE" for each dependency # makedepend does not come with cygwin, you have to go find it on the web # DO NOT DELETE error.o: you_have_not_typed_make_make_yet