#use "g++" to compile source files. CC = g++ #use "gcc" to compile source files. #CC = gcc #use "g++" to link the object files. LD = g++ #use "gcc" to link the object files. #LD = gcc #Compiler flags: CFLAGS = -Wall -g #Linker flags: LDFLAGS = #Dependency generator: MDEPEND = g++ -M #Dependency generator: #MDEPEND = gcc -M #Clean-up command: RM = /bin/rm -f # The list of source files: SRCS = AssertionTest.cpp LogManager.cpp #Generated object files: OBJS = AssertionTest.o LogManager.o #Program executable name: PROG = AssertionTest ######## RULES ######## # Top-level rule: compile everything all: $(PROG) # The program link rule: $(PROG): $(OBJS) $(LD) $(LDFLAGS) $(OBJS) -o $(PROG) # Meta rule for compiling ".cpp" files %.o: %.cpp $(CC) $(CFLAGS) -c $< # Rule for cleaning up before a recompile: clean: $(RM) $(PROG) $(OBJS) # Rule for creating dependency lists and writing them into a dependency file: .depend: $(RM) .depend $(MDEPEND) $(SRCS) > .depend #Include dependency list: include .depend