<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\begin{fileverbs}
# Makefile for Lab 08 (Ten Short C++ Labs)
# wget http://oceanai.mit.edu/cpplabs/lab08/Makefile

all: shapes_v1 shapes_v2 shapes_v3 shapes_v4

#----------------------------------------------------------------------
# Builing a simple Triangle and Square subclass
v1_source  = shapes_v1.cpp Triangle.cpp Square.cpp
v1_headers = Triangle.h Square.h 

shapes_v1: ../lib_geometry/libgeometry.a $(v1_source) $(v1_headers)
	g++ -I../lib_geometry -L../lib_geometry -lgeometry -o shapes_v1 $(v1_source) 

#----------------------------------------------------------------------
# Using an inherited function getPerimeter in the subclasses
v2_source  = shapes_v2.cpp TriangleV2.cpp SquareV2.cpp SegListV2.cpp 
v2_headers = TriangleV2.h SquareV2.h SegListV2.h

shapes_v2: ../lib_geometry/libgeometry.a $(v2_source) $(v2_headers)
	g++ -I../lib_geometry -L../lib_geometry -lgeometry -o shapes_v2 $(v2_source) 

#----------------------------------------------------------------------
# Polymorphism: implementing an area() function in the subclasses
v3_source  = shapes_v3.cpp TriangleV3.cpp SquareV3.cpp SegListV3.cpp 
v3_headers = TriangleV3.h SquareV3.h SegListV3.h

shapes_v3: ../lib_geometry/libgeometry.a $(v3_source) $(v3_headers)
	g++ -I../lib_geometry -L../lib_geometry -lgeometry -o shapes_v3 $(v3_source) 

#----------------------------------------------------------------------
# Virtual functions: making area() virtual, using base-class pointers
v4_source  = shapes_v4.cpp TriangleV4.cpp SquareV4.cpp SegListV4.cpp 
v4_headers = TriangleV4.h SquareV4.h SegListV4.h

shapes_v4: ../lib_geometry/libgeometry.a $(v4_source) $(v4_headers)
	g++ -I../lib_geometry -L../lib_geometry -lgeometry -o shapes_v4 $(v4_source) 

#----------------------------------------------------------------------
clean:
	rm -f shapes_v1 shapes_v2 shapes_v3 shapes_v4 
\end{fileverbs}

</pre></body></html>