# Makefile -- John Valois (valoisj@cs.rpi.edu)

# Example DSA project makefile.


# On Unix, delete ".exe"; for GCC, change ".obj" to ".o".
.SUFFIXES: .exe .obj .cxx
.cxx.obj:
	$(CXX) $(CXXFLAGS) -c $<
.cxx.exe:
	$(CXX) $(CXXFLAGS) $< -o $@


# The current settings assume Microsoft Visual C++ running on Windows 95/NT.
CXX = cl
CXXFLAGS = -Zi -GX

# To use GCC instead, change the following settings.
# CXX = g++
# CXXFLAGS = -g


# Set the following based on your project; take care that extensions
# match the platform correctly (note that even on Windows, using GCC
# will produce object files with a ".o" extension).

OBJECTS = main.obj
TESTS = test01.exe test02.exe test03.exe


myproject.exe : clean $(OBJECTS)
	$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@


# Be sure to add new tests both here, on separate lines, and above.
test : clean $(TESTS)
	@test01
	@test02
	@test03


# With GCC, change ".o" to ".obj".
# We always invoke clean rather than try to deal with .h file dependencies.
clean :
	del /f /q $(EXEC) $(TESTS) *.obj *.pdb *.ilk

# On Unix, use the following instead.
# clean :
#	/bin/rm -f $(EXEC) $(TESTS) *.o core
