# Makefile for timeOfDay class and associated main programs
# Donald Duck (don't put real name on exam questions :-) 
# 4/18/06 for CISC181, practice for E02


# CCC= g++ or CCC=CC is how we specify which compiler we are using.

CCC = g++ 

# BINARIES is a variable that is just a list, separated by spaces, of all
# of our executable programs (the ones we actually run).

BINARIES= main 

# the "all" target or "all" rule is typically has, as the dependencies
# just the list of binaries.  By putting a $ in front of the variable BINARIES,
# and putting { } around it, we say "use the value of that variable".

all: ${BINARIES}

# for the "main" rule, list as the dependencies, all the .o files that
# have to be linked together to make up main.
# The dependencies are the things that come after the colon on the first
# line of a rule.  The "target" is the thing before the colon.

main: timeOfDay.o main.o
	${CCC} timeOfDay.o main.o -o main


# OR, I could have said, as the command:
# 	${CCC} timeOfDay.o main.o -o $@
#
#  The $@ means "use here, whatever the name of the target is".
#  Since the target is called "main", the $@ gets replaced by main,
#  which makes both versions of this rule equivalent.

# the clean rule is a target called "clean"
# the command on the next line must start with a tab character (not spaces)
# the command is one the removes all .o files, all the binaries, and
# a few other things that tend to clutter up projects, e.g. a.out and core

clean:
	/bin/rm -f *.o core a.out ${BINARIES}

# Note: we haven't talked much about "core" yet, so if you left it out on this
# exam that would be ok.  We'll talk about it before the final exam.

