rake-convert 0.0.3 → 0.0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rake/convert.rb +17 -17
- metadata +2 -1
data/lib/rake/convert.rb
CHANGED
@@ -4,20 +4,6 @@ $convert = false
|
|
4
4
|
$makefile = ''
|
5
5
|
$configure = ''
|
6
6
|
|
7
|
-
clean = []
|
8
|
-
|
9
|
-
if (Rake::Task[:clean] rescue nil) || (Rake::Task[:clobber] rescue nil)
|
10
|
-
if defined?(CLOBBER)
|
11
|
-
CLOBBER.include 'configure', 'Makefile'
|
12
|
-
end
|
13
|
-
|
14
|
-
if (Rake::Task[:clobber] rescue nil)
|
15
|
-
clean << :clobber
|
16
|
-
elsif (Rake::Task[:clean] rescue nil)
|
17
|
-
clean << :clean
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
7
|
# Makefile stuff
|
22
8
|
def sh (args)
|
23
9
|
if $convert
|
@@ -239,7 +225,7 @@ end
|
|
239
225
|
# configure stuff
|
240
226
|
|
241
227
|
desc 'Convert the Rakefile to Makefile/configure'
|
242
|
-
task :convert
|
228
|
+
task :convert, [:makefile, :configure] do |task, args|
|
243
229
|
class << task
|
244
230
|
def escape (name)
|
245
231
|
name.gsub(/[:]/, '_')
|
@@ -288,6 +274,20 @@ task :convert => clean do |task|
|
|
288
274
|
end
|
289
275
|
end
|
290
276
|
|
277
|
+
args.with_defaults(makefile: 'Makefile', configure: 'configure')
|
278
|
+
|
279
|
+
if (Rake::Task[:clean] rescue nil) || (Rake::Task[:clobber] rescue nil)
|
280
|
+
if defined?(CLOBBER)
|
281
|
+
CLOBBER.include args.makefile, args.configure
|
282
|
+
end
|
283
|
+
|
284
|
+
if (Rake::Task[:clobber] rescue nil)
|
285
|
+
Rake::Task[:clobber].invoke
|
286
|
+
elsif (Rake::Task[:clean] rescue nil)
|
287
|
+
Rake::Task[:clean].invoke
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
291
291
|
$convert = true
|
292
292
|
|
293
293
|
task.add_env(EXPORT)
|
@@ -314,11 +314,11 @@ task :convert => clean do |task|
|
|
314
314
|
$makefile << "\trm -rf #{f}\n"
|
315
315
|
end
|
316
316
|
|
317
|
-
File.open(
|
317
|
+
File.open(args.makefile, 'w') {|f|
|
318
318
|
f.write $makefile
|
319
319
|
}
|
320
320
|
|
321
|
-
File.open(
|
321
|
+
File.open(args.configure, 'w', 0755) {|f|
|
322
322
|
f.puts 'CC=${CC:-gcc}'
|
323
323
|
f.puts 'LIBS='
|
324
324
|
f.puts 'FILE=`mktemp -u`'
|