From f1f1576543bb4e0f3b9bc4cd0ba4a12a70546c3c Mon Sep 17 00:00:00 2001 From: Frederico Linhares Date: Tue, 30 Aug 2022 17:45:40 -0300 Subject: feat Create 2d graphics pipeline --- Rakefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 6e6388e..ee510f5 100644 --- a/Rakefile +++ b/Rakefile @@ -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 -- cgit v1.2.3