CROSS=

CC=g++
CFLAGS=-g -Wall $(CROSS)
LFLAGS=$(CROSS)
OBJS=CreditCard.o Test_CreditCard.o Money.o
EXOBJS=CreditCardExtra.o Test_CreditCardExtra.o Money.o

default: test

all: test extra

test: $(OBJS)
	$(CC) -o Test_CreditCard $(LFLAGS) $(OBJS)

extra: $(EXOBJS)
	$(CC) -o Test_CreditCardExtra $(LFLAGS) $(EXOBJS)


# list of file dependencies
Test_CreditCard.o: CreditCard.h Money.h
CreditCard.o: CreditCard.h Money.h
Money.o: Money.h
Test_CreditCardExtra.o: CreditCardExtra.h
CreditCardExtra.o: CreditCardExtra.h Money.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
