# default target "all" builds the executable file 'runmaze' and the # executable 'p4sort' all : runmaze p4sort # runmaze is dependent on the following .o (object) files # add any new .o files to the list # build it using g++ runmaze : runmaze.o MazeRunner.o RandomMazeRunner.o Maze.o SquareMaze.o VisualizeSquareMazeRunner.o GPKernel.o g++ -o runmaze -g runmaze.o MazeRunner.o RandomMazeRunner.o Maze.o SquareMaze.o VisualizeSquareMazeRunner.o GPKernel.o -L/usr/X11R6/lib -lX11 # runmaze.o is dependant on one .cpp file, and several .h files # IMPORTANT: when you #include a new .h file, be sure to add it here. Otherwise, the 'make' command may not re-build your program even though you changed a file. # -Wall: make the compiler display all warnings it knows about; hopefully it'll catch something for us # -c: only compile, don't link (we do that above) # -g: put in debug information, for those of you who are using debuggers (like gdb or xxgdb) runmaze.o : runmaze.cpp Maze.h SquareMaze.h MazeRunner.h RandomMazeRunner.h VisualizeSquareMazeRunner.h g++ -Wall -c -g runmaze.cpp # and same idea for other .o files MazeRunner.o : MazeRunner.cpp Maze.h MazeRunner.h g++ -Wall -c -g MazeRunner.cpp RandomMazeRunner.o : RandomMazeRunner.cpp Maze.h MazeRunner.h RandomMazeRunner.h g++ -Wall -c -g RandomMazeRunner.cpp SquareMaze.o : SquareMaze.cpp Maze.h SquareMaze.h g++ -Wall -c -g SquareMaze.cpp Maze.o : Maze.cpp Maze.h g++ -Wall -c -g Maze.cpp VisualizeSquareMazeRunner.o : VisualizeSquareMazeRunner.cpp VisualizeSquareMazeRunner.h Maze.h SquareMaze.h g++ -Wall -c -g VisualizeSquareMazeRunner.cpp GPKernel.o : GPKernel.c GPKernel.h g++ -c -g GPKernel.c # p4sort is dependent on the following .o (object) files. Note that no # templated files have .o files here. That's because their code is # included in every file that includes their .h files. # add any new .o files to the list # build it using g++ p4sort : p4sort.o MinHeap.o HeapInst.o g++ -o p4sort -g p4sort.o MinHeap.o HeapInst.o p4sort.o : p4sort.cpp PQueue.h MinHeap.h MinHeap.cpp HeapInst.cpp g++ -Wall -c -g p4sort.cpp MinHeap.o : MinHeap.h MinHeap.cpp g++ -Wall -c -g MinHeap.cpp HeapInst.o : MinHeap.cpp MinHeap.h g++ -Wall -c -g HeapInst.cpp # 'clean' removes any files that were created via the Makefile, leaving you with only your original source code files clean : rm *.o *~ rm p4sort rm runmaze