diff options
| author | arngo <[email protected]> | 2022-01-13 17:39:50 -0500 |
|---|---|---|
| committer | arngo <[email protected]> | 2022-01-13 17:39:50 -0500 |
| commit | 7a6deae5990de0ec76bb2894ec50ff8fed8a5853 (patch) | |
| tree | 2792a8f07ded8dac25c7a2e9eedb14508a2e5318 | |
| parent | 80904b80a055056864569b9f829ae695dbcd5505 (diff) | |
| download | FelFlameEngine-7a6deae5990de0ec76bb2894ec50ff8fed8a5853.tar.gz FelFlameEngine-7a6deae5990de0ec76bb2894ec50ff8fed8a5853.zip | |
set up tasks for building the game for web and linux
| -rw-r--r-- | Rakefile | 27 |
1 files changed, 21 insertions, 6 deletions
@@ -5,12 +5,27 @@ namespace :build do system('env MRUBY_CONFIG=build_config/felflame_linux.rb rake') end end - desc 'Build the game' - task :game do - Dir.chdir("build/temp") do - system('emcc -s WASM=1 -Os -I ../../mruby/include/ ../template/game.c ../../mruby/build/web/lib/libmruby.a -o game.html --closure 1 ../../raylib_lib_files/web/libraylib.a -I ../../raylib/src/ -s USE_GLFW=3') + desc 'Build the game for web' + task :web do + Dir.mkdir("build/web") unless File.exists?("build/web") + Dir.chdir("build/web") do + system('emcc -s WASM=1 -Os -I ../../mruby/include/ ../template/game.c ../../mruby/build/web/lib/libmruby.a -o index.html --closure 1 ../../raylib_lib_files/web/libraylib.a -I ../../raylib/src/ -s USE_GLFW=3') end end + desc 'Build the game for Linux' + task :tux do + Dir.mkdir("build/tux") unless File.exists?("build/tux") + Dir.chdir("build/tux") do + system('zig cc -target native ../template/game.c -o game -lGL -lm -lpthread -ldl -lrt -lX11 -I../../mruby/include -I../../raylib/src ../../raylib_lib_files/libraylib.a ../../mruby/build/host/lib/libmruby.a') + end + end + #desc 'Build the game for Window' + #task :win do + # Dir.mkdir("build/win") unless File.exists?("build/win") + # Dir.chdir("build/win") do + # system('zig cc -target x86_64-windows-gnu ../template/game.c -o game -lwinmm -lgdi32 -lopengl32 -I../../mruby/include -I../../raylib/src ../../raylib_lib_files/raylib.lib ../../mruby/build/host/lib/libmruby.a') + # end + #end end namespace :clean do @@ -24,7 +39,7 @@ end desc "Create a server and open your game in your browser" task :serve do - link = "http://localhost:8000/game.html" + link = "http://localhost:8000/index.html" if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/ system "start #{link}" elsif RbConfig::CONFIG['host_os'] =~ /darwin/ @@ -32,6 +47,6 @@ task :serve do elsif RbConfig::CONFIG['host_os'] =~ /linux|bsd/ system "xdg-open #{link}" end - `ruby -run -ehttpd build/temp/ -p8000` + `ruby -run -ehttpd build/web/ -p8000` end task :s => :serve |
