diff options
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -33,11 +33,12 @@ RB_LIBS = FileList[ 'lib/*.rb' ] -SPV_FILES = [ - 'glsl/vert.spv', - 'glsl/frag.spv' +GLSL_FILES = FileList[ + 'glsl/*.glsl' ] +SPV_FILES = GLSL_FILES.ext('.spv') + LIBRARIES = [ 'SDL2', 'SDL2_image', @@ -80,18 +81,17 @@ task :pkg do `tar -czvf pkg/#{name}.tar.gz --transform 's,^,#{name}/,' #{files}` end -task :shaders do - system('glslangValidator -V glsl/shader.vert -o glsl/vert.spv') and - system('glslangValidator -V glsl/shader.frag -o glsl/frag.spv') +rule '.spv' => ['.glsl'] do |t| + system("glslangValidator -V #{t.source} -o #{t.name}") end -task build: CPP_OBJS do +task build: CPP_OBJS + SPV_FILES do libs = LIBRARIES.inject('') {_1 + "-l#{_2} "} `g++ -o #{OBJ} #{CPP_OBJS} #{libs}` end -task :install do +task install: :build do destdir = ENV['DESTDIR'] || '' # Install engine |