Skip to content

Commit c498dc6

Browse files
hsbtclaude
andcommitted
Document building with GNU make on mswin
A ruby built this way also builds extension libraries with `make` from PATH, so installing gems with C extensions needs GNU make there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 77cb678 commit c498dc6

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

‎doc/distribution/windows.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,27 @@ sh ../../ruby/configure -C --disable-install-doc --with-opt-dir=C:\Users\usernam
303303
nmake install
304304
```
305305
306+
### Building with GNU make
307+
308+
`nmake` cannot run jobs in parallel. `win32\configure.bat --with-gnu-make` writes `GNUmakefile` instead of `Makefile`, so that you can build with `make -j`. This is experimental, and `nmake` stays the default.
309+
310+
GNU make 4.4 or later built for native Windows is required. `win32\install-gnumake.cmd` downloads the GNU make release, verifies its SHA256, builds it with `cl`, and puts `make.exe` in `.gnumake` under the ruby source directory, or in the directory given as its argument.
311+
312+
```batch
313+
C:
314+
cd \ruby
315+
win32\install-gnumake.cmd
316+
set PATH=C:\ruby\.gnumake;%PATH%
317+
win32\configure --prefix=/usr/local --with-opt-dir=C:/ruby/vcpkg_installed/x64-windows --with-gnu-make
318+
make -j16
319+
make check
320+
make install
321+
```
322+
323+
Use `make` in place of `nmake` for the other targets in this document too, such as `make up`, `make prepare-vcpkg` and `make update-vcpkg`.
324+
325+
The installed ruby also builds extension libraries with `make` found in `PATH`, not with `nmake`. Before installing gems with C extensions, copy `make.exe` from `.gnumake` to a directory in `PATH`, such as the `bin` directory of the install directory, since `make install` does not install it.
326+
306327
### Bugs
307328

308329
You can **NOT** use a path name that contains any white space characters

0 commit comments

Comments
 (0)