if RUBY_PLATFORM =~ /darwin/ then require 'rbuild-bundle' require 'rbuild-cfamily' cg_objects = build_objects(:sources => ['Source/coregraphics.c'], :extra_cflags => '-IRuby') newton_objects = build_objects(:sources => ['Source/newton.c'], :extra_cflags => '-IRuby -INewton -D_NEWTON_USE_LIB') build_bundle(:bundle_name => 'Ascent.app', :resources_directory => 'Resources') build(:targets => ['Ascent.app/Contents/MacOS/Ascent'], :dependencies => ['../RubyGameCommon/RubyGameCommon'], :command => 'cp ../RubyGameCommon/RubyGameCommon Ascent.app/Contents/MacOS/Ascent', :message => 'Copying RubyGameCommon Executable') build(:targets => ['Ascent.app/Contents/Frameworks/OpenAL.framework'], :dependencies => ['../RubyGameCommon/External/openal/macosx/build/OpenAL.framework'], :command => 'cp -r ../RubyGameCommon/External/openal/macosx/build/OpenAL.framework Ascent.app/Contents/Frameworks/', :message => 'Copying OpenAL Framework') build(:targets => ['Ascent.app/Contents/Resources/Ruby/CoreGraphics.bundle'], :dependencies => cg_objects, :command => "gcc -undefined dynamic_lookup -bundle #{cg_objects.join(' ')} -framework Cocoa -o Ascent.app/Contents/Resources/Ruby/CoreGraphics.bundle", :message => 'Building CoreGraphics Bundle') build(:targets => ['Ascent.app/Contents/Resources/Ruby/Newton.bundle'], :dependencies => newton_objects, :command => "gcc -undefined dynamic_lookup -bundle #{newton_objects.join(' ')} -LNewton -lnewton32 -framework Cocoa -o Ascent.app/Contents/Resources/Ruby/Newton.bundle", :message => 'Building Newton Bundle') else exit(1) end