# # Self-Maintaining Makefile # # ----- Make Macros ----- CXXFLAGS = -g -Wall -W -pedantic -O2 -L /usr/openwin/lib CXX = g++ TARGETS = TriWorld OBJECTS = TriWorld.o World.o Ball.o Obstruction.o Triangle.o Edge.o Vertex.o Path.o Tuple.o Tuplex.o Club.o Camera.o Parser.o LIBRARIES = -lglut -lGLU -lGL -lXmu -lXi -lX11 # ----- Make Rules ----- all: $(TARGETS) TriWorld: $(OBJECTS) $(CXX) $(CXXFLAGS) -o TriWorld $(OBJECTS) $(LIBRARIES) clean: rm -f $(TARGETS) $(OBJECTS) # This last target depends on GNU Make and Perl. You don't need to # understand this piece of code. The perl one-liner deletes the old # dependencies and the gcc line adds the new ones. depend: perl -i~ -lpe 'if (m/^# -+(8<-+)+\s*\z/) { print; last; }' Makefile g++ -MM $(OBJECTS:.o=.cpp) >> Makefile # ---- Automatic Rules (generated by typing "make depend") ---- # Feel free to edit beneath this line; your changes will be lost when # make depend is run. # ----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<---- TriWorld.o: TriWorld.cpp World.h Tuple.h Ball.h Obstruction.h Tuplex.h \ Path.h Vertex.h Club.h Camera.h Error.h Parser.h World.o: World.cpp World.h Tuple.h Ball.h Obstruction.h Tuplex.h Path.h \ Vertex.h Club.h Camera.h Triangle.h Edge.h Ball.o: Ball.cpp Ball.h Tuple.h Obstruction.h Tuplex.h Path.h World.h \ Vertex.h Club.h Camera.h Obstruction.o: Obstruction.cpp Obstruction.h Tuple.h Tuplex.h Path.h Triangle.o: Triangle.cpp Triangle.h Obstruction.h Tuple.h Tuplex.h Path.h \ Vertex.h Edge.o: Edge.cpp Edge.h Obstruction.h Tuple.h Tuplex.h Path.h Vertex.h Vertex.o: Vertex.cpp Vertex.h Obstruction.h Tuple.h Tuplex.h Path.h Path.o: Path.cpp Path.h Tuple.h Tuplex.h Tuple.o: Tuple.cpp Tuple.h Tuplex.o: Tuplex.cpp Tuplex.h Tuple.h Club.o: Club.cpp Club.h Camera.o: Camera.cpp Camera.h Tuple.h Ball.h Obstruction.h Tuplex.h \ Path.h Parser.o: Parser.cpp Error.h Parser.h World.h Tuple.h Ball.h \ Obstruction.h Tuplex.h Path.h Vertex.h Club.h Camera.h