summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile16
1 files changed, 8 insertions, 8 deletions
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