-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathRakefile
More file actions
132 lines (118 loc) · 2.81 KB
/
Rakefile
File metadata and controls
132 lines (118 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# frozen_string_literal: true
require_relative 'examples/rakefile.rb'
desc "Documentation"
task :doc do
sh "rdoc --encoding=UTF-8 --title=ruby-Z80 --main=README.rdoc README.rdoc LICENSE.md CHANGELOG.md lib/z80.rb lib/z80/*.rb lib/z80/utils/*.rb lib/zxlib/*.rb lib/zxlib/*/*.rb lib/zxutils/*.rb lib/zxutils/*/*.rb lib/z80lib3d/*.rb"
sh "cp -v examples/*.jpg doc/examples/"
sh "cp -v examples/*.png doc/examples/"
sh "cp -v examples/*.tap doc/examples/"
end
desc "Build the gem"
task :gem do
sh "gem build z80.gemspec"
end
desc "Update the local gem library with the current z80rb sources"
task :update => [:uninstall, :clean, :gem, :install]
desc "Install the library at local machnie"
task :install => :gem do
sh "gem install z80-*.gem"
end
desc "Uninstall the library from local machnie"
task :uninstall do
sh "gem uninstall z80"
end
desc "Clean"
task :clean do
sh "rm z80-*.gem"
end
EXAMPLES = %w[
bfont_demo.rb
bfont_demo_hires.rb
calculator.rb
crc.rb
dots.rb
ghosts.rb
horse.rb
labyrinth.rb
mathi_test.rb
multifill.rb
palette64.rb
qface3d128.rb
quat3d128.rb
sprites.rb
stars.rb
test_ham256.rb
test_music.rb
]
desc "Compile examples"
task :examples do
EXAMPLES.each do |example|
puts '','='*60, "Example: #{example}".center(40), '-'*60
sh "ruby -Ilib #{File.join("examples", example)}"
end
Rake::Task['example:gallery'].invoke
end
UTIL_TESTS = %w[
z80/stdlib.rb
z80/utils/collision_field.rb
z80/utils/shuffle.rb
z80/utils/sincos.rb
z80/utils/sort.rb
z80/utils/vec_deque.rb
zxlib/ay_sound.rb
zxlib/math.rb
zxlib/gfx/draw.rb
zxutils/ay_music.rb
zxutils/ay_music_player.rb
zxutils/benchmark.rb
zxutils/gallery.rb
zxutils/multitasking.rb
zxutils/multitasking_io.rb
]
desc "Compile utils' tests"
task :utils do
UTIL_TESTS.each do |path|
puts '','='*60, "Utility: #{path}".center(40), '-'*60
sh "ruby -Ilib #{File.join("lib", path)}"
end
end
TESTS = %w[
test.math_i.mul16_9.rb
test.math_i.mul8_24.rb
test.math_i.mul8_24a.rb
test.math_i.mul8_signed.rb
test.math_i.mul9_24.rb
test.math_i.mul_const.rb
test.math_i.mul_const8_24.rb
test.math_i.mul_const8_24a.rb
test.math_i.mul_const_ex.rb
test.math_i.mul_signed9.rb
test.math_i.mul_signed9_24.rb
test.zxlib.basic.se.rb
]
desc "Compile external tests"
task :test do
TESTS.each do |path|
puts '','='*60, "Test: #{path}".center(40), '-'*60
sh "ruby -Ilib #{File.join("tests", path)}"
end
end
BENCHES = %w[
bench.divmod.rb
bench.mul.rb
bench.mul8_24.rb
bench.mul_const.rb
bench.mul_signed9.rb
bench.mul_signed9_lim.rb
bench.rnd.rb
bench.sincos_mul.rb
bench.sort.rb
bench.ubcd.rb
]
desc "Compile benchmarks"
task :bench do
BENCHES.each do |path|
puts '','='*60, "Benchmark: #{path}".center(40), '-'*60
sh "ruby -Ilib #{File.join("tests", path)}"
end
end