# This is a more advanced makefile which implements some handy functions # and should make it easier for you to add your own source files to the # project. # # Marked below in the "files" section are the lines you need to # change. ####### FLAGS CC = g++ LIBS = -lm BASE_DIR = . INCLUDES = -I$(BASE_DIR) # Optimizing flags, remove '#' to activate. #CFLAGS = -Wall -O6 -DNDEBUG $(INCLUDES) # Profiling flags, remove '#' to activate. #CFLAGS = -Wall -pg -O6 -DNDEBUG $(INCLUDES) # Debugging flags, insert '#' to deactivate. CFLAGS = -Wall -g $(INCLUDES) ####### Files # The name of the target file TARGET = btree # All headers in the project. Add your new header files here. HEADERS = FileParser.h # All source files in the project. Add your new source files here. SOURCES = FileParser.cpp # All object files in the project. Add .o versions of all your # _untemplated_ .cpp files (probably no new files here for this project). OBJECTS = FileParser.o ####### Implicit rules .SUFFIXES: .SUFFIXES: .c .cc .cpp .o .c.o:; $(CC) -c $(CFLAGS) $< .cpp.o:; $(CC) -c $(CFLAGS) $< .cc.o:; $(CC) -c $(CFLAGS) $< ####### Build rules # No changes should be necessary in this section. all: $(TARGET) $(TARGET): $(OBJECTS) $(HEADERS) $(CC) $(CFLAGS) $(LIBS) -o $(TARGET) $(OBJECTS) purip: $(OBJECTS) purify $(CC) -o purip $(OBJECTS) $(CFLAGS) $(LIBS) $(OBJECTS): $(HEADERS) show: @echo $(SOURCES) $(HEADERS) clean: rm -f *.o *~ full_clean: clean rm -f $(TARGET)