Makefile - # The main linking rule $(EXEC): $(OFILES) g++...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
# The user needs to assign these for their project CCFILES=main.cc Card.cc Deck.cc EXEC=poker # The included dependency file contains all the incremental compilation info, # however we use the implicit rule for making each one which is (simplified): # g++ $(CXXFLAGS) -c -o Foo.o Foo.cc # Thus we place our compiler flags into this default variable CXXFLAGS=-Wall # Create all the needed .o file names from the .cc files OFILES=$(CCFILES:.cc=.o)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: # The main linking rule $(EXEC): $(OFILES) g++ -o $(EXEC) $(OFILES) # Clean not only cleans up object files, but also recreates the dependency file clean: rm -f *~ rm -f *.o rm -f $(EXEC) g++ $(CCFILES) -MM > $(EXEC).d # Always include the dependency file unless we run the clean command, # which will make it even if it does not exist ifneq ($(MAKECMDGOALS), clean) include $(EXEC).d endif...
View Full Document

Ask a homework question - tutors are online