#	$RCSfile$
#	$Date$

CC = g++
CXX = g++
#CXX = xlC

COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
#LINK.cc = $(CXX)

.PHONY: all lab1 lab2 lab4

all: lab1 lab2 lab3 lab4 lab5
clean: clean_lab1 clean_lab2 clean_lab3 clean_lab4 clean_lab5
	rm -f *.o

LAB1 = lab10 lab11a lab11b lab12 lab13
lab1: $(LAB1)
lab13::
	# 'lab13' is supposed to produce errors so don't bother
	# compiling it at all.  (Would still be nice to compile it for
	# the inherent syntax check, but this is easy.)
clean_lab1:
	rm -f $(LAB1)

LAB2 = lab20 lab21a lab21b lab21bx lab22
lab2: $(LAB2)
lab21b: empl21b.o
lab21bx: empl21bx.o
lab22: empl22.o
clean_lab2:
	rm -f $(LAB2)

LAB3 = lab30.o
lab3: $(LAB3)
clean_lab3:
	rm -f $(LAB3)

LAB4 = lab40a lab40ax lab40b lab41 lab41x lab42
lab4: $(LAB4)
lab40a:  lab40a.o  cler40a.o  empl40a.o  tech40a.o
lab40ax: lab40ax.o cler40ax.o empl40ax.o tech40ax.o
lab40b:  lab40b.o  cler40b.o  empl40b.o  tech40b.o
lab41:   lab41.o   cler41.o   empl41.o   tech41.o
lab41x:  lab41x.o  cler41x.o  empl41x.o  tech41x.o
lab42:   lab42.o
	# 'lab42' should compile but won't link as I don't provide
	# implementations for all members of PhoneList and PhoneListIter.
clean_lab4:
	rm -f $(LAB4)

LAB5 = lab52
lab5: $(LAB5)
clean_lab5:
	rm -f $(LAB5)

floppy:
	mmd a:answers.lab
	mcopy -t README Makefile *.[ch]* a:answers.lab

pkzip:
	@zip -l9 ../zip/answers README Makefile *.[ch]*

# DEPENDENCIES
cler40a.o: cler40a.cpp cler40a.h empl40a.h
cler40ax.o: cler40ax.cpp cler40a.h empl40a.h
cler40b.o: cler40b.cpp cler40b.h empl40a.h
cler41.o: cler41.cpp cler41.h empl41.h
cler41x.o: cler41x.cpp cler41x.h empl41x.h
empl21b.o: empl21b.cpp empl21b.h
empl21bx.o: empl21bx.cpp empl21b.h
empl22.o: empl22.cpp empl22.h
empl40a.o: empl40a.cpp empl40a.h
empl40ax.o: empl40ax.cpp empl40a.h
empl40b.o: empl40b.cpp empl40b.h
empl41.o: empl41.cpp empl41.h
empl41x.o: empl41x.cpp empl41x.h
lab10.o: lab10.cpp 
lab11a.o: lab11a.cpp 
lab11b.o: lab11b.cpp 
lab12.o: lab12.cpp 
lab13.o: lab13.cpp 
lab20.o: lab20.cpp 
lab21a.o: lab21a.cpp empl21a.h
lab21b.o: lab21b.cpp empl21b.h
lab21bx.o: lab21bx.cpp empl21b.h
lab30.o: lab30.cpp
lab40a.o: lab40a.cpp empl40a.h cler40a.h tech40a.h
lab40ax.o: lab40ax.cpp empl40a.h cler40a.h tech40a.h
lab40b.o: lab40b.cpp empl40b.h cler40b.h empl40a.h tech40b.h
lab41.o: lab41.cpp empl41.h cler41.h tech41.h
lab41x.o: lab41x.cpp empl41x.h cler41x.h tech41x.h
lab42.o: lab42.cpp sllist.h phonelist.h
tech40a.o: tech40a.cpp tech40a.h
tech40ax.o: tech40ax.cpp tech40a.h
tech40b.o: tech40b.cpp tech40b.h
tech41.o: tech41.cpp tech41.h empl41.h
tech41x.o: tech41x.cpp tech41x.h empl41x.h
