CC=g++ CFLAGS=-g -Wall OBJS=CreditCard.o Test_CreditCard.o all: Test_CreditCard Test_CreditCard: $(OBJS) $(CC) -o Test_CreditCard $(OBJS) # list of file dependencies Test_CreditCard.o: CreditCard.h CreditCard.o: CreditCard.h # the following rule is used to compile .cpp files to .o .cpp.o: $(CC) $(CFLAGS) -c $< # the following removes all .o files, but leaves the executable clean: rm -f *.o