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

############################################################################
#  make.settings.msvc
#
#  Part of the STXXL. See http://stxxl.sourceforge.net
#
#  Copyright (C) 2005-2008 Roman Dementiev <dementiev@ira.uka.de>
#  Copyright (C) 2006-2009 Johannes Singler <singler@ira.uka.de>
#  Copyright (C) 2007-2008 Andreas Beckmann <beckmann@cs.uni-frankfurt.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)
############################################################################


# Change this file according to your paths.

# change this path, do not leave spaces at the end of the line 
STXXL_ROOT = "$(TOPDIR)"#

MAKE = nmake /NOLOGO
COMPILER = cl
LINKER = link
WARNINGS =
OPT = /O2 /Ob2 # debug is off
# OPT = /Od # debug is on
DEBUG_COMPILER = /MD /DNDEBUG # debug is off
# DEBUG_COMPILER  = /MDd /Zi # debug is on
DEBUG_LINKER = /OPT:REF # debug is off
# DEBUG_LINKER = /DEBUG # debug is on

LIBNAME = stxxl
# if you change LIBNAME, add /DSTXXL_LIBNAME=\"$(LIBNAME)\" to the compiler options

include make.settings.local

#### TROUBLESHOOTING
#
# For automatical checking of order of the output elements in
# the sorters: stxxl::stream::sort, stxxl::stream::merge_runs,
# stxxl::sort, and stxxl::ksort add
#
#     /DSTXXL_CHECK_ORDER_IN_SORTS
#
# to the compile options.


#### You usually shouldn't need to change the sections below #####


#### STXXL OPTIONS ###############################################

STXXL_SPECIFIC	 = \
	-I$(STXXL_ROOT)/include \
	-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE

##################################################################


#### MICROSOFT VC OPTIONS ########################################

MSVC_COMPILER_OPTIONS = /EHsc /EHs /wd4820 /wd4217 /wd4668 /wd4619 \
 /wd4625 /wd4626 /wd4355 /wd4996 -D_SCL_SECURE_NO_DEPRECATE \
 /F 16777216 /nologo
MSVC_LINKER_OPTIONS = /LIBPATH:$(STXXL_ROOT)\lib\ lib$(LIBNAME).lib \
 /LIBPATH:$(BOOST_ROOT)\lib\ /STACK:16777216 /NOLOGO

##################################################################


#### BOOST OPTIONS ###############################################

BOOST_COMPILER_OPTIONS	 = \
	-D_RTLDLL \
	-DBOOST_LIB_DIAGNOSTIC \
	-DSTXXL_BOOST_TIMESTAMP \
	-DSTXXL_BOOST_CONFIG \
	-DSTXXL_BOOST_FILESYSTEM \
	-DSTXXL_BOOST_THREADS \
	-DSTXXL_BOOST_RANDOM \
	-I$(BOOST_ROOT)

##################################################################


#### DEPENDENCIES ################################################

HEADER_PATH	 = ../include/stxxl/bits

COMMON_FILES	 = \
    ../lib/lib$(LIBNAME).$(LIBEXT) \
	$(HEADER_PATH)/namespace.h \
	$(HEADER_PATH)/noncopyable.h \
	$(HEADER_PATH)/version.h \
	$(HEADER_PATH)/compat_hash_map.h \
	$(HEADER_PATH)/compat_unique_ptr.h \
	$(HEADER_PATH)/parallel.h \
	$(HEADER_PATH)/singleton.h \
	$(HEADER_PATH)/defines.h \
	$(HEADER_PATH)/verbose.h \
	$(HEADER_PATH)/unused.h \
	$(HEADER_PATH)/deprecated.h \
	$(HEADER_PATH)/libstxxl.h \
	$(HEADER_PATH)/msvc_compatibility.h \
	$(HEADER_PATH)/common/aligned_alloc.h \
	$(HEADER_PATH)/common/new_alloc.h \
	$(HEADER_PATH)/common/mutex.h \
	$(HEADER_PATH)/common/rand.h \
	$(HEADER_PATH)/common/semaphore.h \
	$(HEADER_PATH)/common/state.h \
	$(HEADER_PATH)/common/timer.h \
	$(HEADER_PATH)/common/utils.h \
	$(HEADER_PATH)/common/error_handling.h \
	$(HEADER_PATH)/common/simple_vector.h \
	$(HEADER_PATH)/common/switch.h \
	$(HEADER_PATH)/common/tmeta.h \
	$(HEADER_PATH)/common/log.h \
	$(HEADER_PATH)/common/exceptions.h \
	$(HEADER_PATH)/common/tuple.h \
	$(HEADER_PATH)/common/types.h \
	$(HEADER_PATH)/common/settings.h \
	$(HEADER_PATH)/common/seed.h  \
	$(HEADER_PATH)/common/is_sorted.h \
	$(HEADER_PATH)/common/exithandler.h \
	$(HEADER_PATH)/compat/shared_ptr.h \
	$(HEADER_PATH)/compat/type_traits.h

IO_LAYER_FILES	 = \
	$(HEADER_PATH)/io/io.h \
	$(HEADER_PATH)/io/iostats.h \
	$(HEADER_PATH)/io/completion_handler.h \
	$(HEADER_PATH)/io/request_interface.h \
	$(HEADER_PATH)/io/request.h \
	$(HEADER_PATH)/io/request_ptr.h \
	$(HEADER_PATH)/io/request_operations.h \
	$(HEADER_PATH)/io/request_with_state.h \
	$(HEADER_PATH)/io/request_with_waiters.h \
	$(HEADER_PATH)/io/serving_request.h \
	$(HEADER_PATH)/io/disk_queues.h \
	$(HEADER_PATH)/io/request_queue.h \
	$(HEADER_PATH)/io/request_queue_impl_worker.h \
	$(HEADER_PATH)/io/request_queue_impl_qwqr.h \
	$(HEADER_PATH)/io/request_queue_impl_1q.h \
	$(HEADER_PATH)/io/file.h \
	$(HEADER_PATH)/io/disk_queued_file.h \
	$(HEADER_PATH)/io/ufs_file_base.h \
	$(HEADER_PATH)/io/syscall_file.h \
	$(HEADER_PATH)/io/mmap_file.h \
	$(HEADER_PATH)/io/simdisk_file.h \
	$(HEADER_PATH)/io/wfs_file_base.h \
	$(HEADER_PATH)/io/wincall_file.h \
	$(HEADER_PATH)/io/boostfd_file.h \
	$(HEADER_PATH)/io/mem_file.h \
	$(HEADER_PATH)/io/fileperblock_file.h \
	$(HEADER_PATH)/io/wbtl_file.h \
	$(HEADER_PATH)/io/create_file.h

MNG_LAYER_FILES	 = \
	$(HEADER_PATH)/mng/adaptor.h \
	$(HEADER_PATH)/mng/block_alloc.h \
	$(HEADER_PATH)/mng/block_alloc_interleaved.h \
	$(HEADER_PATH)/mng/block_prefetcher.h \
	$(HEADER_PATH)/mng/buf_istream.h \
	$(HEADER_PATH)/mng/buf_ostream.h \
	$(HEADER_PATH)/mng/buf_writer.h \
	$(HEADER_PATH)/mng/mng.h \
	$(HEADER_PATH)/mng/bid.h \
	$(HEADER_PATH)/mng/typed_block.h \
	$(HEADER_PATH)/mng/diskallocator.h \
	$(HEADER_PATH)/mng/config.h \
	$(HEADER_PATH)/mng/write_pool.h \
	$(HEADER_PATH)/mng/prefetch_pool.h \
	$(HEADER_PATH)/mng/read_write_pool.h

CONTAINER_FILES	 = \
	$(HEADER_PATH)/containers/pager.h \
	$(HEADER_PATH)/containers/stack.h \
	$(HEADER_PATH)/containers/vector.h \
	$(HEADER_PATH)/containers/priority_queue.h \
	$(HEADER_PATH)/containers/pq_helpers.h \
	$(HEADER_PATH)/containers/pq_mergers.h \
	$(HEADER_PATH)/containers/pq_ext_merger.h \
	$(HEADER_PATH)/containers/pq_losertree.h \
	$(HEADER_PATH)/containers/queue.h \
	$(HEADER_PATH)/containers/map.h \
	$(HEADER_PATH)/containers/deque.h \
	$(HEADER_PATH)/containers/btree/btree.h \
	$(HEADER_PATH)/containers/btree/iterator_map.h \
	$(HEADER_PATH)/containers/btree/leaf.h \
	$(HEADER_PATH)/containers/btree/node_cache.h \
	$(HEADER_PATH)/containers/btree/root_node.h \
	$(HEADER_PATH)/containers/btree/node.h \
	$(HEADER_PATH)/containers/btree/iterator.h

ALGO_FILES	 = \
	$(HEADER_PATH)/algo/adaptor.h \
	$(HEADER_PATH)/algo/inmemsort.h \
	$(HEADER_PATH)/algo/intksort.h \
	$(HEADER_PATH)/algo/run_cursor.h \
	$(HEADER_PATH)/algo/sort.h \
	$(HEADER_PATH)/algo/async_schedule.h \
	$(HEADER_PATH)/algo/ksort.h \
	$(HEADER_PATH)/algo/sort_base.h \
	$(HEADER_PATH)/algo/sort_helper.h \
	$(HEADER_PATH)/algo/losertree.h \
	$(HEADER_PATH)/algo/scan.h \
	$(HEADER_PATH)/algo/stable_ksort.h \
	$(HEADER_PATH)/algo/random_shuffle.h

STREAM_FILES	 = \
	$(HEADER_PATH)/stream/stream.h \
	$(HEADER_PATH)/stream/sort_stream.h \
	$(HEADER_PATH)/stream/choose.h \
	$(HEADER_PATH)/stream/unique.h \
	$(HEADER_PATH)/stream/sorted_runs.h

###################################################################


#### MISC #########################################################

OBJEXT = obj # extension of object file
LIBOBJEXT = obj # extension of object files for the library
LIBEXT = lib # static library file extension
EXEEXT = exe # executable file extension
RM =     del # remove file command
LIBGEN = lib /nologo /out:# library generation
OUT    = /out:# output file for linking and compilation
CLEAN_TARGETS = *.$(OBJEXT) *.$(EXEEXT) *.$(LIBEXT) *.exe.manifest *.pdb *.exp

###################################################################


STXXL_COMPILER_OPTIONS	 = \
	$(STXXL_SPECIFIC) \
	$(OPT) $(DEBUG_COMPILER) $(WARNINGS) \
	$(BOOST_COMPILER_OPTIONS) \
	$(MSVC_COMPILER_OPTIONS)

STXXL_LINKER_OPTIONS	 = \
	$(MSVC_LINKER_OPTIONS) \
	$(DEBUG_LINKER)


# vim: syn=make
