Skip to content

Commit c0c38fc

Browse files
committed
Make Rakefile follow change of build process
1 parent beeb130 commit c0c38fc

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

bindings/ruby/Rakefile

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ require "bundler/gem_tasks"
33
require "rake/testtask"
44
require_relative "extsources"
55

6+
SOURCES_DIR = "ext/sources"
7+
68
SOURCES = FileList[]
79

810
EXTSOURCES.each do |src|
911
basename = src.pathmap("%f")
10-
dest = basename == "LICENSE" ? basename : src.pathmap("%{../..,ext}p")
12+
dest = basename == "LICENSE" ? basename
13+
: src.pathmap("%{\\.\\./\\.\\.,#{SOURCES_DIR}}p")
14+
.pathmap("%{\\.\\./javascript,#{SOURCES_DIR}/bindings/javascript}p")
1115
dir = dest.pathmap("%d")
1216
file src
1317
directory dir
@@ -18,7 +22,6 @@ EXTSOURCES.each do |src|
1822
end
1923

2024
CLEAN.include SOURCES
21-
CLEAN.include FileList["ext/**/*.o", "ext/**/*.metal", "ext/**/*.tmp", "ext/whisper.{so,bundle,dll}"]
2225

2326
SRC = FileList["ext/*.{c,cpp,h}"]
2427

@@ -36,6 +39,20 @@ file "ext/Makefile" => SRC + ["ext/extconf.rb"] + SOURCES do |t|
3639
ruby "extconf.rb"
3740
end
3841
end
42+
if File.exist? "ext/Makefile"
43+
task :make_clean do
44+
cd "ext" do
45+
sh "make", "clean"
46+
end
47+
end
48+
task clean: :make_clean
49+
task :make_distclean do
50+
cd "ext" do
51+
sh "make", "distclean"
52+
end
53+
end
54+
task clobber: :make_distclean
55+
end
3956

4057
file SO_FILE => "ext/Makefile" do |t|
4158
chdir "ext" do

0 commit comments

Comments
 (0)