Skip to content

Commit 7f3294e

Browse files
committed
update readme
1 parent a2ac16c commit 7f3294e

File tree

1 file changed

+67
-8
lines changed

1 file changed

+67
-8
lines changed

README.md

Lines changed: 67 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,82 @@ This means we emulate MRuby's non-trivial build process entirely in Zig.
2626

2727
## What does work
2828

29-
TODO
29+
Pretty much everything else.
30+
31+
### Command line tools and examples
32+
33+
```
34+
$ zig build -h
35+
Usage: /path/to/zig build [steps] [options]
36+
37+
Steps:
38+
install (default) Copy build artifacts to prefix path
39+
uninstall Remove build artifacts from prefix path
40+
mrbc Run mrbc
41+
host-mrbc Run host-mrbc
42+
mruby Run mruby
43+
mirb Run mirb
44+
mrdb Run mrdb
45+
mruby-strip Run mruby-strip
46+
mrbtest Run mrbtest
47+
example-c Run src/example.c
48+
example-rb Run src/example.rb
49+
example-zig Run src/example.zig
50+
```
51+
52+
For example, to run the MRuby tests
53+
54+
```
55+
zig build -Doptimize=ReleaseFast
56+
57+
# or just `zig build mrbtest` directly
58+
./zig-out/bin/mrbtest
59+
```
60+
```
61+
mrbtest - Embeddable Ruby Test
62+
63+
...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
64+
Total: 1647
65+
OK: 1647
66+
KO: 0
67+
Crash: 0
68+
Warning: 0
69+
Skip: 0
70+
Time: 1.07 seconds
3071
3172
```
32-
zig build mirb
33-
zig build mruby
34-
zig build mrdb
3573

36-
# etc, see `zig build -h` or the `build.zig`
74+
To use `mirb`, `mruby`, etc:
75+
76+
```
77+
./zig-out/bin/mruby -v
78+
mruby 3.3.0 (2024-02-14)
79+
80+
$ ./zig-out/bin/mirb
81+
mirb - Embeddable Interactive Ruby Shell
82+
83+
> MRUBY_VERSION
84+
=> "3.3.0"
3785
```
3886

39-
Building for other targets - e.g, on Linux
87+
### Cross compilation
88+
89+
Linux/Mac are the only targets currently supported, but support for others shouldn't be difficult.
4090

4191
```
42-
zig build -Dtarget=x86_64-macos-none -p macos
43-
zig build -Dtarget=x86_64-linux-musl -p musl
92+
zig build -Doptimize=ReleaseFast -Dtarget=x86_64-macos-none
93+
zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux-musl
94+
zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux-gnu
4495
```
4596

97+
### Using in a Zig project
98+
99+
TODO: document this
100+
101+
## Contributing
102+
103+
Bug reports and pull requests are welcome at https://github.com/jethrodaniel/mruby.zig
104+
46105
## License
47106

48107
[MIT](https://spdx.org/licenses/MIT.html), same as [MRuby](https://github.com/mruby/mruby).

0 commit comments

Comments
 (0)