require 'rake/loaders/makefile'

# Setup project files
project_files = common_headers + headers + sources + objects

add_rbx_capi

# A better test for 64 vs 32 bit is welcome. These constants
# are determined in MRI by running a compiled program like
# the following:
#
# int main(int argc, char *argv[]) {
#   return (BASE * (BASE+1)) / BASE == (BASE+1);
# }
#
# where -DBASE=10UL is extended by one 0 until
# the test is false. See MRI ext/bigdecimal/extconf.rb

if $BITS == 64
  add_define "BASE=1000000000UL", "BASE_FIG=9"
else
  add_define "BASE=10000UL", "BASE_FIG=4"
end

bigdecimal = "bigdecimal.#{$DLEXT}"

file bigdecimal => project_files

graph_dependencies sources

import dependency_file

desc "Build Bigdecimal extension"
task :build => bigdecimal
