# simple makefile

CC = g++

SRC = Makefile index readme arraytimer.cpp countdown.cpp shuffle.cpp \
shuffle_array.cpp shuffle_days.cpp \
single.cpp singleton.cpp singleton.h \
stopwatch.cpp stopwatch.h student.h student.cpp students.cpp

EXE = arraytimer countdown shuffle shuffle_days shuffle_array single student

all :: arraytimer countdown shuffle shuffle_days shuffle_array single students

shuffle_array : shuffle_array.cpp
	$(CC) ${CFLAGS} -o shuffle_array shuffle_array.cpp

shuffle_days : shuffle_days.cpp
	$(CC) ${CFLAGS} -o shuffle_days shuffle_days.cpp

shuffle : shuffle.cpp
	$(CC) ${CFLAGS} -o shuffle shuffle.cpp

countdown : countdown.cpp
	$(CC) ${CFLAGS} -o countdown countdown.cpp

arraytimer : arraytimer.cpp stopwatch.o
	$(CC) ${CFLAGS} -o arraytimer arraytimer.cpp stopwatch.o

stopwatch.o : stopwatch.cpp stopwatch.h
	$(CC) ${CFLAGS} -c stopwatch.cpp

single : single.cpp singleton.o
	$(CC) ${CFLAGS} -o single single.cpp singleton.o

singleton.o : singleton.cpp singleton.h
	$(CC) ${CFLAGS} -c singleton.cpp

students : students.cpp student.o
	$(CC) ${CFLAGS} -o students students.cpp student.o

student.o : student.cpp student.h
	$(CC) ${CFLAGS} -c student.cpp

clean ::
	rm *.o ${EXE} *~ single.tgz single.zip

dist ::
	tar -zcvf single.tgz ${SRC}
	zip single.zip ${SRC}

help :
	@echo "make help screen"
	@echo "targets     ... purpose"
	@echo ""
	@echo "all         ... compile everything"
	@echo "<name>.o    ... compile this intermediate file"
	@echo "            ... stopwatch.o and singleton.o"
	@echo "<name>      ... compile the executable"
	@echo ""
	@echo "Executables: ${EXE}"
	@echo ""
	@echo "Source: ${SRC}"
	@echo ""
	@echo "clean       ... delete all intermediate files"
	@echo "dist        ... create a tarred, zipped and zip files"
	@echo ""
