#  (C) Copyright  2002. Permission to copy, use, modify, sell and
#  distribute this software is granted provided this copyright notice appears
#  in all copies. This software is provided "as is" without express or implied
#  warranty, and with no claim as to its suitability for any purpose.
#
#
# Boost.date_time build and test Jamfile
#
#  Based on boost.python Jamfile
#
# To run all tests quietly: jam test
#
# Declares the following targets:
#   1. libboost_date_time, a static link library to be linked with all
#      Boost.date_time modules
#

# declare the location of this subproject relative to the root
subproject libs/date_time/build ;

local DATE_TIME_PROPERTIES = $(DATE_TIME_PROPERTIES) <define>DATE_TIME_INLINE <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG ;

#uncomment the line below and comment out the line above to change to 64 bit counted time implementation
#local DATE_TIME_PROPERTIES = $(DATE_TIME_PROPERTIES) <define>DATE_TIME_INLINE ;

local DATE_TIME_INCLUDES = <include>$(BOOST_ROOT) ;

#######################
rule date_time-test ( test-name : sources + )
{
    unit-test $(test-name) : $(sources) <lib>boost_date_time
                           : $(DATE_TIME_INCLUDES) $(DATE_TIME_PROPERTIES) ;
}

rule date_time-example ( example-name : sources + )
{
    exe $(example-name) : $(sources) <lib>boost_date_time
                        : $(DATE_TIME_INCLUDES) $(DATE_TIME_PROPERTIES) ;
}

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

#
# Declare the boost date_time static link library
#

# Base names of the source files for libboost_date_time
local GREGORIAN_CPP_SOURCES = gregorian_types greg_month greg_weekday ;

lib boost_date_time : ../src/gregorian/$(GREGORIAN_CPP_SOURCES).cpp
    # requirements
    : <sysinclude>$(BOOST_ROOT)
      $(DATE_TIME_INCLUDES)
      $(DATE_TIME_PROPERTIES) ;

#dll libboost_gdtl
#  # $(SUFDLL[1])
#    :  ../gregorian/src/$(GREGORIAN_CPP_SOURCES).cpp
#	# requirements
#      : $(DATE_TIME_INCLUDES)
#	<shared-linkable>true
#        <runtime-link>dynamic
#	$(DATE_TIME_PROPERTIES)
#          ;

############# tests ###########
# Generic tests
date_time-test testconstrained_value : ../test/testconstrained_value.cpp ;
date_time-test testint_adapter : ../test/testint_adapter.cpp ;
date_time-test testwrapping_int : ../test/testwrapping_int.cpp ;
date_time-test testtime_resolution_traits : ../test/testtime_resolution_traits.cpp ;
date_time-test testgregorian_calendar : ../test/testgregorian_calendar.cpp ;
date_time-test testint64_range : ../test/testint64_range.cpp ;

# Gregorian Date System 
date_time-test testdate_iterator : ../test/gregorian/testdate_iterator.cpp ;
date_time-test testgreg_month : ../test/gregorian/testgreg_month.cpp ;
date_time-test testcurrent_day : ../test/gregorian/testcurrent_day.cpp ;
date_time-test testformatters : ../test/gregorian/testformatters.cpp ;
date_time-test testparse_date : ../test/gregorian/testparse_date.cpp ;
date_time-test testdate : ../test/gregorian/testdate.cpp ;
date_time-test testgreg_cal : ../test/gregorian/testgreg_cal.cpp ;
date_time-test testgenerators : ../test/gregorian/testgenerators.cpp ;
date_time-test testdate_duration : ../test/gregorian/testdate_duration.cpp ;
date_time-test testgreg_day : ../test/gregorian/testgreg_day.cpp ;
date_time-test testperiod : ../test/gregorian/testperiod.cpp ;
date_time-test testfacet : ../test/gregorian/testfacet.cpp ;

# Posix Time System Tests
date_time-test testtimeperiod   : ../test/posix_time/testperiod.cpp ;
date_time-test testtime         : ../test/posix_time/testtime.cpp ;
date_time-test testtimeduration : ../test/posix_time/testduration.cpp ;
date_time-test testtimeformat   : ../test/posix_time/testformatters.cpp ;
date_time-test testlocal_adjustor : ../test/posix_time/testlocal_adjustor.cpp ;
date_time-test testdst_rules      : ../test/posix_time/testdst_rules.cpp ;
date_time-test testiterator      : ../test/posix_time/testiterator.cpp ;
date_time-test testtime_clock    : ../test/posix_time/testclock.cpp ;
date_time-test testparse_time    : ../test/posix_time/testparse_time.cpp ;


############# examples  ############

date_time-example dates_as_strings : ../example/gregorian/dates_as_strings.cpp ;
date_time-example end_of_month_day : ../example/gregorian/end_of_month_day.cpp ;
date_time-example dates_as_strings : ../example/gregorian/dates_as_strings.cpp ;
date_time-example period_calc : ../example/gregorian/period_calc.cpp ;
date_time-example days_alive : ../example/gregorian/days_alive.cpp ;
date_time-example print_holidays : ../example/gregorian/print_holidays.cpp ;
date_time-example days_since_year_start : ../example/gregorian/days_since_year_start.cpp ;
date_time-example print_month : ../example/gregorian/print_month.cpp ;
date_time-example days_till_new_year : ../example/gregorian/days_till_new_year.cpp ;
date_time-example date_localization : ../example/gregorian/localization.cpp ;

#time examples
date_time-example time_math : ../example/posix_time/time_math.cpp ;
date_time-example local_utc_conversion : ../example/posix_time/local_utc_conversion.cpp ;
date_time-example print_hours : ../example/posix_time/print_hours.cpp ;
date_time-example time_periods : ../example/posix_time/time_periods.cpp ;

