# This -*- Makefile -*- is intended for processing with nmake.

############################################################################
#  Makefile.msvc
#
#  Part of the STXXL. See http://stxxl.sourceforge.net
#
#  Copyright (C) 2005-2007 Roman Dementiev <dementiev@ira.uka.de>
#  Copyright (C) 2009, 2010 Johannes Singler <singler@ira.uka.de>
#
#  Distributed under the Boost Software License, Version 1.0.
#  (See accompanying file LICENSE_1_0.txt or copy at
#  http://www.boost.org/LICENSE_1_0.txt)
############################################################################


main: library

TOPDIR=$(MAKEDIR)
include make.settings

library:
	cd common
	$(MAKE) TOPDIR="$(MAKEDIR)" lib
	cd ..
	cd io
	$(MAKE) TOPDIR="$(MAKEDIR)" lib
	cd ..
	cd mng
	$(MAKE) TOPDIR="$(MAKEDIR)" lib
	cd ..
	cd algo
	$(MAKE) TOPDIR="$(MAKEDIR)" lib
	cd ..
	cd lib
	$(MAKE) TOPDIR="$(MAKEDIR)"
	cd ..
	cd common
	$(MAKE) TOPDIR="$(MAKEDIR)" tools
	cd ..
	cd utils
	$(MAKE) TOPDIR="$(MAKEDIR)" tools
	cd ..
	cd io
	$(MAKE) TOPDIR="$(MAKEDIR)" tools
	cd ..
	@echo "Building library is completed."
	@echo "Use the following compiler options with programs using Stxxl: $(STXXL_COMPILER_OPTIONS)"
	@echo "Use the following linker options with programs using Stxxl: $(STXXL_LINKER_OPTIONS)"
	@echo $(STXXL_COMPILER_OPTIONS) > compiler.options
	@echo $(STXXL_LINKER_OPTIONS) > linker.options


tests: library
	cd common
	$(MAKE) TOPDIR="$(MAKEDIR)" tests
	cd ..
	cd io
	$(MAKE) TOPDIR="$(MAKEDIR)" tests
	cd ..
	cd mng
	$(MAKE) TOPDIR="$(MAKEDIR)" tests
	cd ..
	cd containers
	$(MAKE) TOPDIR="$(MAKEDIR)" tests
	cd ..
	cd algo
	$(MAKE) TOPDIR="$(MAKEDIR)" tests
	cd ..
	cd stream
	$(MAKE) TOPDIR="$(MAKEDIR)" tests
	cd ..
	cd utils
	$(MAKE) TOPDIR="$(MAKEDIR)" tests
	cd ..
	@echo "Building tests is completed."
	@echo "Use the following compiler options with programs using Stxxl: $(STXXL_COMPILER_OPTIONS)"
	@echo "Use the following linker options with programs using Stxxl: $(STXXL_LINKER_OPTIONS)"

clean:
	cd lib
	$(MAKE) TOPDIR="$(MAKEDIR)" clean
	cd ..
	cd common
	$(MAKE) TOPDIR="$(MAKEDIR)" clean
	cd ..
	cd io
	$(MAKE) TOPDIR="$(MAKEDIR)" clean
	cd ..
	cd mng
	$(MAKE) TOPDIR="$(MAKEDIR)" clean
	cd ..
	cd containers
	$(MAKE) TOPDIR="$(MAKEDIR)" clean
	cd ..
	cd algo
	$(MAKE) TOPDIR="$(MAKEDIR)" clean
	cd ..
	cd stream
	$(MAKE) TOPDIR="$(MAKEDIR)" clean
	cd ..
	cd utils
	$(MAKE) TOPDIR="$(MAKEDIR)" clean
	cd ..
	@echo "Cleaning completed"

