cocoa port codeblocksproj/rakefile put their stuff in the build folder now

This commit is contained in:
gecko_reverse 2009-02-24 08:25:50 +00:00
parent 714e2b445b
commit 5c158071b8
3 changed files with 52 additions and 51 deletions

View File

@ -33,9 +33,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA]]>
<Build>
<Target title="Cocoa X86">
<Option platforms="Mac;" />
<Option output="DeSmuME.app/Contents/MacOS/DeSmuME" prefix_auto="0" extension_auto="0" />
<Option working_dir="DeSmuME.app/Contents/MacOS" />
<Option object_output="obj/X86" />
<Option output="build/codeblocks/DeSmuME.app/Contents/MacOS/DeSmuME" prefix_auto="0" extension_auto="0" />
<Option working_dir="build/codeblocks/DeSmuME.app/Contents/MacOS" />
<Option object_output="build/codeblocks/x86" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
@ -51,9 +51,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA]]>
</Target>
<Target title="Cocoa PPC">
<Option platforms="Mac;" />
<Option output="DeSmuME.app/Contents/MacOS/DeSmuME" prefix_auto="0" extension_auto="0" />
<Option working_dir="DeSmuME.app/Contents/MacOS" />
<Option object_output="obj/PPC" />
<Option output="build/codeblocks/DeSmuME.app/Contents/MacOS/DeSmuME" prefix_auto="0" extension_auto="0" />
<Option working_dir="build/codeblocks/DeSmuME.app/Contents/MacOS" />
<Option object_output="build/codeblocks/ppc" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>

View File

@ -13,7 +13,7 @@ compile = {
'MMU', 'SPU', 'cflash', 'fs-linux', 'matrix', 'FIFO', 'NDSSystem', 'arm_instructions', 'cp15', 'mc', 'cheatSystem',
'thumb_instructions', 'GPU', 'OGLRender', 'armcpu', 'gfx3d', 'render3D', 'wifi', 'GPU_osd', 'ROMReader', 'texcache',
'bios', 'debug', 'saves', 'readwrite', 'rtc', 'softrender', 'common', 'mic', 'addons'].map { |core_file| '../' + core_file + '.cpp' } ) +
Dir['../utils/*.c'] + Dir['../utils/*.cpp'] + Dir['../utils/decrypt/*.cpp'] + Dir['../addons/*.cpp'],
Dir['../utils/*.c'] + Dir['../utils/*.cpp'] + Dir['../utils/decrypt/*.cpp'] + Dir['../addons/*.cpp'],
:defines => {
:global => ['DESMUME_OBJ_C'],
:cocoa => ['DESMUME_COCOA', 'HAVE_LIBZ', 'HAVE_OPENGL']},
@ -38,7 +38,7 @@ compile = {
link = {
:command => 'gcc',
:files => Dir['*.o'],
:files => Dir[File.dirname(__FILE__) + '/build/rake/o/*.o'],
:libraries => { :cocoa => ['z', 'stdc++'] },
:frameworks => { :cocoa => ['Cocoa', 'OpenGL', 'AudioUnit'] },
:options => {}
@ -53,15 +53,6 @@ def verbose?
raise StandardError, "verbose must be true or false. Type rake help for help"
end
def output_file
ENV['output_filename'] || 'DeSmuME.app'
end
def output_executable
return @tempfile if @tempfile
@tempfile = Tempfile.new('desmume').path
end
# Compile Step
desc 'Compiles the source files'
@ -69,6 +60,11 @@ desc 'Compiles the source files'
task :compile do
puts 'Compiling...'
#create directory to place object files
Dir.mkdir(File.dirname(__FILE__) + '/build') rescue nil
Dir.mkdir(File.dirname(__FILE__) + '/build/rake') rescue nil
Dir.mkdir(File.dirname(__FILE__) + '/build/rake/o') rescue nil
task_options = []
task_options += compile[:options][:global] rescue []
task_options += compile[:options][:cocoa ] rescue []
@ -86,7 +82,9 @@ task :compile do
command = [compile[:command]]
command << filename
command << '-o ' + File.dirname(__FILE__) + '/build/rake/o/' + File.basename(filename) + '.o'
command << '-c'
command += (file_options + task_options).map { |o| '-' + o }
command = command.join ' '
@ -113,13 +111,18 @@ end
desc 'Builds an executable out of the object files'
task :link do#=> :compile do
task :link => :compile do
puts 'Linking...'
Dir.mkdir(File.dirname(__FILE__) + '/build') rescue nil
Dir.mkdir(File.dirname(__FILE__) + '/build/rake') rescue nil
Dir.mkdir(File.dirname(__FILE__) + '/build/rake/DeSmuME.app') rescue nil
Dir.mkdir(File.dirname(__FILE__) + '/build/rake/DeSmuME.app/Contents') rescue nil
Dir.mkdir(File.dirname(__FILE__) + '/build/rake/DeSmuME.app/Contents/MacOS/') rescue nil
command = [link[:command]]
command += link[:files]
command << '-o'
command << output_executable
command << '-o ' + File.dirname(__FILE__) + '/build/rake/DeSmuME.app/Contents/MacOS/DeSmuME'
command += link[:options ][:global].collect { |o| '-' + o } rescue []
command += link[:options ][:cocoa ].collect { |o| '-' + o } rescue []
command += link[:libraries ][:global].collect { |l| '-l ' + l } rescue []
@ -150,20 +153,17 @@ desc 'Builds a Cocoa application bundle out of the linked files'
task :build_cocoa_app => :link do
puts 'Building Application Bundle...'
Dir.mkdir(output_file) rescue Errno::EEXIST
Dir.mkdir(output_file + '/Contents') rescue Errno::EEXIST
Dir.mkdir(output_file + '/Contents/MacOS/') rescue Errno::EEXIST
Dir.mkdir(output_file + '/Contents/Resources/') rescue Errno::EEXIST
Dir.mkdir(File.dirname(__FILE__) + '/build') rescue nil
Dir.mkdir(File.dirname(__FILE__) + '/build/rake') rescue nil
Dir.mkdir(File.dirname(__FILE__) + '/build/rake/DeSmuME.app') rescue nil
Dir.mkdir(File.dirname(__FILE__) + '/build/rake/DeSmuME.app/Contents') rescue nil
Dir.mkdir(File.dirname(__FILE__) + '/build/rake/DeSmuME.app/Contents/Resources') rescue nil
cp 'Info.plist', output_file + '/Contents/Info.plist'
cp 'PkgInfo', output_file + '/Contents/PkgInfo'
cp 'InfoPlist.strings', output_file + '/Contents/Resources/InfoPlist.strings'
cp 'DeSmuME.icns', output_file + '/Contents/Resources/DeSmuME.icns'
cp_r 'translations/*.lproj', output_file + '/Contents/Resources/'
cp output_executable, output_file + '/Contents/MacOS/DeSmuME'
puts 'Built ' + output_file
cp File.dirname(__FILE__) + '../..//Info.plist', File.dirname(__FILE__) + '/build/rake/DeSmuME.app/Contents/Resources/'
cp File.dirname(__FILE__) + '/PkgInfo', File.dirname(__FILE__) + '/build/rake/DeSmuME.app/Contents/Resources/'
cp File.dirname(__FILE__) + '/InfoPlist.strings', File.dirname(__FILE__) + '/build/rake/DeSmuME.app/Contents/Resources/'
cp File.dirname(__FILE__) + '/DeSmuME.icns', File.dirname(__FILE__) + '/build/rake/DeSmuME.app/Contents/Resources/'
system 'cp -r ' + File.dirname(__FILE__) + '/translations/*.lproj ' + File.dirname(__FILE__) + '/build/rake/DeSmuME.app/Contents/Resources/'
end
@ -179,8 +179,10 @@ end
desc 'Runs the executable if it exists'
task :run do
system output_file + '/Contents/MacOS/DeSmuME'
task :run => :build_cocoa_app do
puts 'Running...'
system File.dirname(__FILE__) + '/build/rake/DeSmuME.app/Contents/MacOS/DeSmuME'
puts File.dirname(__FILE__) + '/build/rake/DeSmuME.app/Contents/MacOS/DeSmuME'
end
# Help
@ -195,7 +197,6 @@ task :help do
puts ""
puts "There are several parameters that you can pass:"
puts "(but don't put spaces around the equal signs though)"
puts " output_file = [filename] the name of the executable (default is DeSmuME.app)"
puts " verbose = [true|false] print extra information (default is false)"
puts ""
end

View File

@ -2,22 +2,22 @@
#This script builds the application bundle so that DeSmuME can run when compiled from Code::Blocks
#
lipo DeSmuME.app/Contents/MacOS/DeSmuME_x86 DeSmuME.app/Contents/MacOS/DeSmuME_ppc -create -output DeSmuME.app/Contents/MacOS/DeSmuME
rm -f DeSmuME.app/Contents/MacOS/DeSmuME_x86
rm -f DeSmuME.app/Contents/MacOS/DeSmuME_ppc
lipo build/codeblocks/DeSmuME.app/Contents/MacOS/DeSmuME_x86 DeSmuME.app/Contents/MacOS/DeSmuME_ppc -create -output DeSmuME.app/Contents/MacOS/DeSmuME
rm -f build/codeblocks/DeSmuME.app/Contents/MacOS/DeSmuME_x86
rm -f build/codeblocks/DeSmuME.app/Contents/MacOS/DeSmuME_ppc
#
mkdir -p DeSmuME.app/Contents/Resources
cp Info.plist DeSmuME.app/Contents/Info.plist
cp PkgInfo DeSmuME.app/Contents/PkgInfo
cp InfoPlist.strings DeSmuME.app/Contents/Resources/InfoPlist.strings
cp DeSmuME.icns DeSmuME.app/Contents/Resources/DeSmuME.icns
cp ../../COPYING DeSmuME.app/Contents/Resources/COPYING
cp ../../README DeSmuME.app/Contents/Resources/README
cp ../../README.MAC DeSmuME.app/Contents/Resources/README.MAC
cp ../../AUTHORS DeSmuME.app/Contents/Resources/AUTHORS
cp ../../README.TRANSLATION DeSmuME.app/Contents/Resources/README.TRANSLATION
cp ../../ChangeLog DeSmuME.app/Contents/Resources/ChangeLog
mkdir -p build/codeblocks/DeSmuME.app/Contents/Resources
cp Info.plist build/codeblocks/DeSmuME.app/Contents/Info.plist
cp PkgInfo build/codeblocks/DeSmuME.app/Contents/PkgInfo
cp InfoPlist.strings build/codeblocks/DeSmuME.app/Contents/Resources/InfoPlist.strings
cp DeSmuME.icns build/codeblocks/DeSmuME.app/Contents/Resources/DeSmuME.icns
cp ../../COPYING build/codeblocks/DeSmuME.app/Contents/Resources/COPYING
cp ../../README build/codeblocks/DeSmuME.app/Contents/Resources/README
cp ../../README.MAC build/codeblocks/DeSmuME.app/Contents/Resources/README.MAC
cp ../../AUTHORS build/codeblocks/DeSmuME.app/Contents/Resources/AUTHORS
cp ../../README.TRANSLATION build/codeblocks/DeSmuME.app/Contents/Resources/README.TRANSLATION
cp ../../ChangeLog build/codeblocks/DeSmuME.app/Contents/Resources/ChangeLog
#Localizations
cp -R translations/*.lproj DeSmuME.app/Contents/Resources/
cp -R translations/*.lproj build/codeblocks/DeSmuME.app/Contents/Resources/