Created
May 14, 2010 19:30
-
-
Save robmerrell/401549 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rake" | |
require "rake/clean" | |
require "fileutils" | |
$pdk_path = "/opt/PalmPDK" | |
SRC = FileList["src/**/*.cpp"] | |
OBJ = SRC.ext("o") | |
CLEAN.include("src/**/*.o") | |
CLOBBER.include("vertiblob") | |
task :default => ["vertiblob"] | |
rule ".o" => ".cpp" do |file| | |
flags = [ | |
"-I#{$pdk_path}/include", | |
"-I#{$pdk_path}/include/SDL" | |
] | |
sh "g++ -arch i386 #{flags.join(' ')} -c -o #{file.name} #{file.source}" | |
end | |
file "vertiblob" => OBJ do | |
libs = [ | |
"-lSDL", | |
"-lSDL_image", | |
"-lpdl", | |
"-L#{$pdk_path}/host/lib", | |
"-framework cocoa", | |
"-lSDLmain" | |
] | |
sh "g++ -arch i386 #{libs.join(' ')} -o vertiblob #{OBJ}" | |
end | |
# File dependencies for incremental building | |
file "main.o" => ["main.cpp", "engine/engine.h", "scenes/gameplay_scene.h", "scenes/gameplay_scene.cpp", "engine/sprite_manager.cpp"] | |
file "engine.o" => ["engine/engine.h", "engine/engine.cpp", "engine/scene.h", "engine/scene.cpp"] | |
file "scene.o" => ["engine/scene.cpp", "engine/scene.h"] | |
file "sprite_manager.o" => ["engine/sprite_manager.h", "engine/sprite_manager.cpp"] | |
file "gameplay_scene.o" => ["scenes/gameplay_scene.cpp", "scenes/gameplay_scene.h"] | |
desc "Copy the app to /media/internal/vertiblob" | |
task :cp do | |
copy_bin = "scp -r -P 10022 vertiblob root@localhost:/media/internal/vertiblob" | |
puts copy_bin | |
system(copy_bin) | |
copy_assets = "scp -r -P 10022 assets root@localhost:/media/internal/vertiblob" | |
puts copy_assets | |
system(copy_assets) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment