#
#    Copyright 2007-2009 Adobe Systems Incorporated
#    Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
#    or a copy at http://stlab.adobe.com/licenses.html)
#

###################################################
#
# Makefile for C++ benchmarks
#  This is a Windows specific makefile derived from makefile
#
###################################################



# Microsoft compiler
#CC = cl
#CPP = cl


# Intel compiler
#CC = icl
#CPP = icl


# GCC
#CC = gcc -mwindows
#CPP = g++ -mwindows


CFLAGS = /nologo /Ox /D "WIN32" /D "NDEBUG" /Wp64 /I "$(INCLUDE)"
CPPFLAGS = /nologo /Ox /TP /EHsc /D "WIN32" /D "NDEBUG" /Wp64 /I "$(INCLUDE)"



#
# our target programs
#

BINARIES = machine.exe \
stepanov_abstraction.exe \
stepanov_vector.exe \
loop_unroll.exe \
simple_types_loop_invariant.exe \
functionobjects.exe \
simple_types_constant_folding.exe



#
# Build rules
#

all : $(BINARIES)


SUFFIXES:
.SUFFIXES: .c .cpp


# declare some targets to be fakes without real dependencies

.PHONY : clean dependencies

# remove all the stuff we build

clean : 
		del -f *.o *.obj $(BINARIES)


#
# Run the benchmarks and generate a report
#
REPORT_FILE = report.txt

report:  $(BINARIES)
	@echo "##STARTING Version 1.0" > $(REPORT_FILE)
	@echo %%DATE%% %%TIME%% >>$(REPORT_FILE)
	@echo "##CFlags: $(CFLAGS)" >> $(REPORT_FILE)
	@echo "##CPPFlags: $(CPPFLAGS)" >> $(REPORT_FILE)
	.\machine >> $(REPORT_FILE)
	.\stepanov_abstraction >> $(REPORT_FILE)
	.\stepanov_vector >> $(REPORT_FILE)
	.\functionobjects >> $(REPORT_FILE)
	.\simple_types_constant_folding >> $(REPORT_FILE)
	.\simple_types_loop_invariant >> $(REPORT_FILE)
	.\loop_unroll >> $(REPORT_FILE)
	@echo %%DATE%% %%TIME%% >>$(REPORT_FILE)
	@echo "##END Version 1.0" >> $(REPORT_FILE)

