# on turing, use next line;  on other platforms use following
CROSS=-m32
#CROSS=

CC=g++
CFLAGS=-g -Wall $(CROSS)
LFLAGS=$(CROSS)
OBJS=CreditCard.o TestCard.o


# rule for building the executable
default: $(OBJS)
	$(CC) -o TestCard $(LFLAGS) $(OBJS)

# list of file dependencies
TestCard.o: CreditCard.h
CreditCard.o: CreditCard.h


# rule for building the extra credit
EXOBJS=CreditCardExtra.o TestCardExtra.o

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

TestCardExtra.o: CreditCardExtra.h
CreditCardExtra.o: CreditCardExtra.h


all: default extra

# 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